Dear all,
I am using Stata 16, on mac. I have taken a snapshot on the panel dataset I am working with.
Array
I want to generate a new variable called RowMean, which is the arithmetic mean (the average) across all the of variables Participant Ever Smoked 1997? Participant Ever Smoked 1998? and Participant Ever Smoked 1999?. So for example in the first row under the Row Mean variable I would like to calculate the average in Stata: (1+-4+-4)/(3) = -2.3 I am unsure on how to write the Stata code for this?
Thank you in advance for your help
Jason Browen
Related Posts with Row Mean
Generating new observation for all id's in panel dataDear Stata community, can you help me with this issue of adding a generated observation to the data …
Multilevel model: REML or robust SE's?My apologies for the silly question: I've been running a mixed effects model and since I have a smal…
putexcel in foreach loopI am having some issue writing my data to excel in a for loop. I am very new to macros and loops. Ba…
How to calculate institutional investor churn rate and investor turnoverHello My study looks at investor horizon and return predictability. I tried checking the posts on ho…
spatial econometricsGood afternoon someone knows how its possible to use a panel data with spatial econometrics ? what …
Subscribe to:
Post Comments (Atom)
0 Response to Row Mean
Post a Comment