Hi all,
I am supposed to get a single mean_weight variable.
Original egen code: egen weight_mean = rowmean(weight1 weight2 weight3)
Code I used:
foreach var of varlist weight1 weight2 weight3 {
su `var', d
egen `var'_mean = rowmean(`var')
}
I am not sure where I went wrong, but I ended up with three mean_weight variables (mean_weight1, mean_weight2, mean_weight3) after using the code above. I am supposed to get mean_weight alone.
Related Posts with Looping egen mean weight
Pre and post policy countHI, So I have panel data for 5 years (4,5,6,7,8) and I am evaluating a policy change that happened …
one year entry for each variableDear all, I'm having a problem with the shape of my data. It is formatted as follows: YEAR id1 i…
weird characters of ChineseI have used the following codes to translate the Chiense characters in my dataset (attached). But it…
create a table with mean sd and t-test ==0I would like to create a table with the variables as columns and the mean, the standard deviation an…
How do I graph a parameter t distributionDear Statalisters, I have a regression coefficient x2=.2227885 with a SE=.056563 and a 95% Conf. In…
Subscribe to:
Post Comments (Atom)
0 Response to Looping egen mean weight
Post a Comment