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

RE: st: making new variables for each obs


From   "David Harrison" <[email protected]>
To   <[email protected]>
Subject   RE: st: making new variables for each obs
Date   Tue, 25 Jan 2005 14:47:51 -0000

Or even...

forvalues i=1/10 {
    egen std`i' = rsd(v`i'-v`=`i'+9')
}

-----Original Message-----

egen std1=rsd(v1-v10)
egen std2=rsd(v2-v11)
egen std3=rsd(v3-v12)

Just make sure your variables v1-v12 are in order.

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index