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
Goodness of Fit in Generalized Structural Equation ModelingRecently I am using GSEM to analyze dataset, but I have not found a way to get the goodness of fit s…
For loops for generating cumulative sums of variables?Dear All, I'm pretty new to Stata, and am having difficulty in creating for loops for the followin…
First difference regression and fixed effect regressionHello I try to make a regression, with panel data over a period of eight years, in which I will inve…
Cluster-robust estimationWe have a question regarding the cluster-robust estimation of standard errors in a (1) simple random…
Marginsplot with missing values of x-variableDear all, I am trying to plot fitted values on the month variable. Where Month variable has informa…
Subscribe to:
Post Comments (Atom)
0 Response to Generate the difference between 2 variables
Post a Comment