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
Adding up variables with the same valueHi All, Seeking help on adding up variables (columns) with the same values. I have variables diagn…
Computation of mean with nondetects / data with left censored dataHi I would like to know how can I get the mean of my data that has left censored: +----------------…
Help with 2SLS modellingHello everyone, This question is from a paper that I recently read; Laeven.L, and Levine.R, (2009),…
ttest or xtmixedHello everybody, excuse me for my english. I am a french resident and i am doing a research about t…
Estimate monthly data with annual time series dataI would like to calculate an estimate of the monthly population with population data sorted by regio…
Subscribe to:
Post Comments (Atom)
0 Response to Looping egen mean weight
Post a Comment