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
Dynamic panel data estimation, 2+ periods only for dependent variableHi everyone, Essentially, I would like to run a first difference regression which includes the lag o…
Singular weighting matrix in 2-step GMM with xtabond2Dear Statalisters, When running a GMM in a 2-step procedure we use the optimal weighting matrix to …
Regression on time-series and cross-sectional dataHi, While writing an essay on transitions to democracy in SSA mainly using logit models for surviva…
Descriptive Data Table (Socio-demographic data)Hi there, I was wondering whether I could get a table like this on STATA? Array Thanks, Aslan …
Variable loopingCheers, Here is the code that I have Code: gen date1990 = amo + ayear gen date1992 = bmo + byear …
Subscribe to:
Post Comments (Atom)
0 Response to Generate the difference between 2 variables
Post a Comment