Hi everyone,
p1_1 p1_2 p1_3 p2_1 p2_2 p2_3 p3_1 p3_2 p3_3
1 1 1 2 2 2 3 3 3
1 1 1 2 2 2 3 3 3
1 1 1 2 2 2 3 3 3
1 1 1 2 2 2 3 3 3
1 1 1 2 2 2 3 3 3
1 1 1 2 2 2 3 3 3
1 1 1 2 2 2 3 3 3
I would like to generate a sum of the values with sequential variable names, using loops.
generate p1= p1_1 + p1_2 + p1_3
generate p2= p2_1 + p2_2 + p2_3
generate p3= p3_1 + p3_2 + p3_3
Thanks you....
Related Posts with Generate var using sequential variables names
Assumptions SLRHi everyone, I ran a regress model, but when I checked for the assumptions, they were all violated.…
Postfile __000000 already existsHi I am running Stata 15.1 on a Windows 7 8 core desktop. I am trying to run postfile but keep gett…
Large coefficients in a regression where the dependent variable is log-transformedHi all, In my regression, the dependent variable is log-transformed (wdealsize). Code: Linear re…
Maximum likelihood probit estimation (multiple outcomes)I am interested in how the characteristics of policy i and the characteristics of insurance j influe…
String variable to numeric variable, -encode- command generates new values.I have a couple hundred thousand income observations within my data. However, when I tried to create…
Subscribe to:
Post Comments (Atom)
0 Response to Generate var using sequential variables names
Post a Comment