Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: Generating and saving standard deviations using panel data
From
"Hong V. Nguyen" <[email protected]>
To
"[email protected]" <[email protected]>
Subject
st: Generating and saving standard deviations using panel data
Date
Wed, 11 Jul 2012 13:42:55 +0000
I have a panel data set. I need to estimate the standard deviation of a variable for each firm over a time period and save it for use in a regression. So if I have 100 firms and 10 years, then I'd have 100 standard deviations, each estimated using the 10-year period. These standard deviations would then be used in a regression.
This is what I've tried:
by GVKEY: sum RET
gen SD=r(sd)
Thanks.
Hong
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/