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
vce(cluster var1 var2) varlist not allowed r(101)Hi!, I am trying to run fixed effect with two-way clustering. For instance: reghdfe capx x1 x2, abs…
keep observations between staryear and endyear.Dear All, I have this dataset, Code: * Example generated by -dataex-. To install: ssc install datae…
Replace if value is a dateHi, I am trying to replace the value of one variable when the condition holds (the condition is that…
calculating the number by comparing this period and previous periodDear All, Suppose that I have this data Code: * Example generated by -dataex-. To install: ssc inst…
Panel data graphHi. I need help. I want to make a graph with panel data, in which I must include the trend of the c…
Subscribe to:
Post Comments (Atom)
0 Response to Generate var using sequential variables names
Post a Comment