Wencke,
You can use -egen- to generate variables with the mean and standard deviation.
. sysuse auto
. bysort rep78 foreign: egen mpgmean = mean(mpg)
. bysort rep78 foreign: egen mpgsd = sd(mpg)
The mean and standard deviation can also be calculated with
-summarize-. Enter -return list- to see which results you can access
with other commands.
. sum mpg
. return list
. gen mpgmean = r(mean)
. gen mpgsd = r(sd)
Friedrich
On Sat, Feb 23, 2008 at 6:47 AM, Wencke <[email protected]> wrote:
> Dear Stata-Users,
>
> how can I store estimates of mean values as well as their standard
> deviation as new variables in my dataset?
>
> This is the command for the mean-values, I am using:
> mean maxgrip, over(gender ph013_)
>
> Thank you very much for helping.
>
> All the best,
> Wencke Gwozdz
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/