Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[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" <hong.nguyen@scranton.edu>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
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/


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