Hi ,
I have 20 variables representing an outcome measure.
The same outcome/variable was measure twice at t1 and t2.
My setup is wide and I use Stata 16.1:
var1_1 var1_2 var2_1 var2-2............var20_1 var20_2
I would like to use a loop and generate for each pair of variables the difference.
diff_var1==var1_2 -var1_1
diff _var2==var2_2-var2_1
.............................
diff_var20==var20_2-var20_1
Your help would be greatly appreciated.
Thank you,
Nikos
Related Posts with Generate the difference between 2 variables
 Structural equation modeling: Whether and how to estimate margins w.r.t. a latent variableI’d like to get input from the Stata community on the advisability and potential utility of estimati… Structural equation modeling: Whether and how to estimate margins w.r.t. a latent variableI’d like to get input from the Stata community on the advisability and potential utility of estimati…
 Help to get rolling average (standard deviation) over 5 yearsHello,
I have a panel data like this (unbalanced)
ID Year V1 V2
0 2005 30 19
0 2006 20 67
0 2007 4… Help to get rolling average (standard deviation) over 5 yearsHello,
I have a panel data like this (unbalanced)
ID Year V1 V2
0 2005 30 19
0 2006 20 67
0 2007 4…
 How does the option"ties" work in psmatch2?Hello:
It says in the user's manual : ties not only match nearest neighbor but also other controls w… How does the option"ties" work in psmatch2?Hello:
It says in the user's manual : ties not only match nearest neighbor but also other controls w…
 Share of working hours by a segment of race comparing to the total raceHello everyone,
I'm working with basic monthly sample of CPS and I'd like to calculate for each occ… Share of working hours by a segment of race comparing to the total raceHello everyone,
I'm working with basic monthly sample of CPS and I'd like to calculate for each occ…
 Stata omitting two levels of a variable instead of oneI'm presently working on analyzing a survey with multiple waves. I've used append to attach the diff… Stata omitting two levels of a variable instead of oneI'm presently working on analyzing a survey with multiple waves. I've used append to attach the diff…
Subscribe to:
Post Comments (Atom)
0 Response to Generate the difference between 2 variables
Post a Comment