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, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AW: st: creating subsamples in panel data

From   "Martin Weiss" <>
To   <>
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


-----Ursprüngliche Nachricht-----
[] Im Auftrag von Christopher
Gesendet: Samstag, 7. August 2010 10:04
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   |
                              An Introduction to Stata Programming  |
   An Introduction to Modern Econometrics Using Stata  |

*   For searches and help try:

*   For searches and help try:

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