Bookmark and Share

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]

AW: st: creating subsamples in panel data


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   AW: st: creating subsamples in panel data
Date   Sat, 7 Aug 2010 10:34:33 +0200

<> 

Kit`s strategy would leave David with three dummies, though. He may be just
as happy with just one:


*************
egen cut95 = pctile(assets) if tin(1,4), p(95)
egen cut99 = pctile(assets) if tin(1,4), p(99)

gen byte size=irecode(assets,cut95,cut99,.)+1
la def siz 1 "small" 2 "medium" 3 "large"
la val size siz
ta size
*************



HTH
Martin

-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Christopher
Baum
Gesendet: Samstag, 7. August 2010 10:04
An: [email protected]
Betreff: Re: st: creating subsamples in panel data

<>
On Aug 7, 2010, at 2:33 AM, David wrote:

> I have have a large panel dataset containing bank data. I have a time
> variabel and a panel variable that identifies every bank uniquely.
> Now I want to divide my data in three groups( by percentiles) by their
> asset size  to run regression for each individual group.
> I tried evey function I know about but nothing seems to work properly.
> I would be extremely grateful for every help I can get on this.If you
> wonder this is for my Bachelor Thesis and kind of new to STATA.


In order to create samples of small (<95th percentile), medium(between 95
and 99th percentile, large (>99th percentile) from my
large database of bank-quarter data:

egen cut95 = pctile(totassets) if tin(`start',`endp'), p(95) by(callqtr)
egen cut99 = pctile(totassets) if tin(`start',`endp'), p(99) by(callqtr)
g byte small = totassets < cut95
g byte medium = totassets >= cut95 & totassets < cut99
g byte large = !small & !medium



Kit Baum   |   Boston College Economics & DIW Berlin   |
http://ideas.repec.org/e/pba1.html
                              An Introduction to Stata Programming  |
http://www.stata-press.com/books/isp.html
   An Introduction to Modern Econometrics Using Stata  |
http://www.stata-press.com/books/imeus.html


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


*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index