I'm simply trying to save some characteristics of variables into a new file. A generalized version of my code is below:
The problem is that only the characteristics for variable y are shown. I could work around this by creating and merging two different files for each variable, but I'm sure there's a better way.
Thanks in advance!
Code:
capture postutil clear postfile table z x y using "file.dta", replace forvalues i = 1/5 { sum x y if z == `i' post table (`i') (`r(mean)') (`r(mean)') } postclose table
The problem is that only the characteristics for variable y are shown. I could work around this by creating and merging two different files for each variable, but I'm sure there's a better way.
Thanks in advance!
Comment