Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: capture mean and std.dev. from the sum comand


From   Edwin Leuven <e.leuven@uva.nl>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: capture mean and std.dev. from the sum comand
Date   Fri, 26 Mar 2004 16:47:34 +0100 (CET)

egen meanr = mean(rain), by(state year)
egen stdr  = sd(rain), by(state year)
g flood = rain > meanr + stdr

?

On Fri, 26 Mar 2004, Justin G. Gardner wrote:

> Hello stata listers
> 
> I have a panel data on 50 states and I would like to create a dummy variable for "flood" if the rainfall in a state exceeds its mean by more than one standard deviation.
> 
> I know there is a way to capture values from various commands.  My plan is to summarize by state and then capture the mean and standard deviation for each state.  Then generate the dummy variable.  The problem is I have yet to find the code to do this.  I have seen this done for other commands, you can for example capture the beta hat vector when you use the regress command.  Can somebody point me to an online resource?
> 
> Thanks for the help.
> Justin G. Gardner
> Department of Agriculture and Consumer Economics
> University of Illinois at Urbana-Champaign
> *
> *   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/
> 
*
*   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/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index