Hi!
I'm working on Stata 12 from a Mac.
I have a variable of the form: var2 = var1 + 2.
Initially, imagine I have var1 = 2.
I want to replace var1 such that: var1 = 3.
My problem as of now:
I do -replace var1 = 2-, and var1 obviously becomes 2, but var2 is still equal to 2 + 2 = 4. It doesn't take into account that I changed the value of var1.
How can I tell Stata to adjust the value of var2 accordingly? That is, how can I tell Stata that var2 is now equal to 3+2 = 5?
Would anyone have tips on how to do this?
Note: I'm giving a simple example, but my actual variables are more complicated than that, and I change the variables before running estimations various times. It would be pretty inconvenient to have to drop and re-create the variables.
Thanks in advance!
Ana
I'm working on Stata 12 from a Mac.
I have a variable of the form: var2 = var1 + 2.
Initially, imagine I have var1 = 2.
I want to replace var1 such that: var1 = 3.
My problem as of now:
I do -replace var1 = 2-, and var1 obviously becomes 2, but var2 is still equal to 2 + 2 = 4. It doesn't take into account that I changed the value of var1.
How can I tell Stata to adjust the value of var2 accordingly? That is, how can I tell Stata that var2 is now equal to 3+2 = 5?
Would anyone have tips on how to do this?
Note: I'm giving a simple example, but my actual variables are more complicated than that, and I change the variables before running estimations various times. It would be pretty inconvenient to have to drop and re-create the variables.
Thanks in advance!
Ana
Comment