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

st: RE: panel data management - dividing into quartiles


From   "Dev Vencappa" <[email protected]>
To   <[email protected]>
Subject   st: RE: panel data management - dividing into quartiles
Date   Sun, 15 May 2005 22:47:04 +0100

>>
  Keeping in mind what the experts say about how the dangers of running the regression the way you intend to, here's something simple until the other experts come up with something more economical.

*for each country, report the efficiency scores in the 1st,2nd,3rd,4th quartiles of assets.i.e.
*work out average efficiency scores by size quartiles. 

*create the quartile variable first

gen quartile=.

*assuming you are creating 4 quartiles & your company is coded as numeric

 levels companyname, local(levels)
foreach k of local levels{
forvalues x=1980/1995{  /*if these are your years for example*/
centiles assets, centile(25 50 75)
replace quartile=1 if assets<=r(c_1) & companyname==`k' & year==`x'
replace quartile=2 if assets>r(c_1) & assets<=r(c_2)  & companyname==`k' & year==`x'
replace quartile=3 if assets>r(c_2) & assets<=r(c_3)  & companyname==`k' & year==`x'
replace quartile=4 if assets>r(c_3)  & companyname==`k' & year==`x'
}
}


Hope that works.
Dev


>>> [email protected] 05/15/05 10:17 pm >>>
I would not recommend you go this, but instead use quantile regression
(-qreg-) to examine the conditional distribution of assets.

Partitioning the dependent variable into quartiles could produce incorrect
results.  Koenker and Hallock (2001 "Quantile Regression" Journal of
Economic Perspectives, 15:4 pages 143 -156) refer to this as "truncation on
the dependent variable."  This method of truncation is vulnerable to
selection bias, since one is truncating the full sample based on the
dependent variable in the model. This can produce both biased and
inconsistent estimates.


Scott


> -----Original Message-----
> From: [email protected] [mailto:owner-
> [email protected]] On Behalf Of Crystal Lopez
> Sent: Sunday, May 15, 2005 3:10 PM
> To: [email protected] 
> Subject: st: panel data management - dividing into quartiles
> 
> Hi,
> 
> I have a panel data set, with data on a number of
> companies over a number of years. Each observation is
> a particular company and year, and has various data
> for that observation.
> 
> I would like to divide my data into 4 quartiles or 5
> quintiles, on the basis of one of my variables,
> assets. So I would like to create a variable, call it
> quartile, that has the value 1 if that observation is
> in the top quartile of assets for that year, has the
> value 2 if that observation is in the second quartile
> of assets for that year, etc. (So of course a company
> might have different values of "quartile" in different
> years, depending on which quartile of assets it fits
> into in a particular year. The quartiles will probably
> contain somewhat different companies in each year.)
> The reason that I want to do this is that I can run
> regressions separately for each quartile.
> 
> I was thinking that I would need to use the by var:
> command, as in "by assets: ", but I'm not sure how to
> do it, although it seems like it should be simple.
> 
> Thanks in advance for any help!
> 
> Crystal
> 



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


This message has been checked for viruses but the contents of an attachment
may still contain software viruses, which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.


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