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

st: re: panel data manipulation


From   Christopher Baum <[email protected]>
To   [email protected]
Subject   st: re: panel data manipulation
Date   Mon, 16 May 2005 06:05:25 -0400

Re my program that creates separate variables for each year: easily changed to what you want (I think)

webuse grunfeld,clear
gen allquartile = .
qui forv i=1935/1954 {
egen quartile`i' = cut(mvalue) if year==`i', group(4)
replace allquartile=quartile`i'+1 if quartile`i' < .
}
su allquartile

This will create a single variable for which each firm is classified in the quartile in which it falls each year (which may differ over years).

Kit
*
*   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