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
Creating a variable that is chosen from two different distributions with probability=0.5Hi there, I am trying to create a variable u with 1000 observations that is distributed according t…
Holtz-Eakin, Newey and Rosen regression on a lagged variableI have a variable operating income and I want to auto regress it on lagged operating income using th…
Trouble horizontally orienting estpost tabstat table of summary statisticsHi all—I am a Stata 17 user on several operating systems. I have run into some version of this probl…
support - neophyte stataHello everybody! Can you please help me with the following problem? I have created an easy example…
eventstudy 2 by Thomas Kaspereit - Implementation and conceptual questionDear all, I'm working on my Master's Thesis and came across eventstudy2, an excellent event study t…
Subscribe to:
Post Comments (Atom)
0 Response to Generate var using sequential variables names
Post a Comment