Dear All,
I have a somewhat involved problem, but I think it boils down to this. I'm writing a program where I basically want to, in order:
1) modify the user's data
2) create temporary variables
3) restore the user's data
4) do some other stuff that requires the data as restored in 3)
5) use the temporary variables created in 2)
The problem with using preserve before step 1) and restore to do step 3) is that restore seems to drop the temporary variables created in 2), making step 5) impossible.
Maybe there's some tempfile workaround, but I can't think of the right way to do it. I feel like I'm missing something obvious.
edit: I'm using Stata 15 if it matters...
edit 2: I guess I can imagine some horribly complicated thing involving merging of a temporary ds, but the should be something easier, I'd think/hope.
Related Posts with Within .ado files, is there a way to restore data but keep, until the end of program, tempvars created by the program?
test of proportions using prtestHi statalist, I am trying to run a two sample test of proportion using two groups (women who report…
Running mi:reshape after imputation (longitudinal dataset)Hi All I imputed (25 imputations) my longitudinal dataset (in the wide format) which seems to have …
Graph with standard deviation on the y axisDear Stata users, I am trying to replicate the paper "Revisiting the German wage structure" https://…
Stata 16Dear Statalist, I hope this finds you well. I would like to ask regarding the new version of Stata …
Please help me troubleshoot converting string date("20100201") into the format Stata recognizes as dateHi, I was converting string date data (variable Fdate and Pdate, they look like "20100201") into num…
Subscribe to:
Post Comments (Atom)
0 Response to Within .ado files, is there a way to restore data but keep, until the end of program, tempvars created by the program?
Post a Comment