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]

RE: st: AW: creating subsamples in panel data


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   RE: st: AW: creating subsamples in panel data
Date   Fri, 6 Aug 2010 22:39:03 +0200

<>

BTW, to prevent confusion:

***********
clear*
set obs 1
gen x=1/1000
count if x==float(1/1000)
***********

The syntax "1/1000" within an expression means 1 divided by 1000. It is only
under very specific circumstances, such as in the specification of a range
for the -forvalues- command, that it denotes a sequence of numbers. Also,
for comparison purposes, you must use the double equal sign, as Daniel has
already pointed out.


HTH
Martin


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Bontempo, Daniel
E
Sent: Freitag, 6. August 2010 20:43
To: [email protected]
Subject: RE: st: AW: creating subsamples in panel data

You need to say "if rank==1/1000"

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of David Kehrl
Sent: Friday, August 06, 2010 1:42 PM
To: [email protected]
Subject: Re: st: AW: creating subsamples in panel data

Thanks a lot for your help. I think I get the principle. But when i
try doing the regression
" xtreg credit assets repo" and try to add the "if rank=1/1000" e.g.
im getting syntax error.
what is the right way do the conditionary part?

Regards,
David

2010/8/6 Martin Weiss <[email protected]>:
>
> <>
>
> This is a dopey example that shows you valuable techniques in this area:
>
> *************
> clear*
> set obs 10
> gen byte bank=_n
>
> //expand to # of time periods
> expand 4
>
> //get time period
> bys bank: gen byte time=_n
>
> //xtset the thing
> xtset bank time
> gen assets =rnormal(1000000,200000)
>
> l, noo sepby(bank)
>
> //get average assets
> bys bank: egen avassets=mean(assets)
> egen tag=tag(bank)
> egen rank=rank(avassets) if tag
>
> gen x=rnormal()
>
> //regressions based on average assets
> reg avassets x if inrange(rank,1,4)
> reg avassets x if inrange(rank,5,7)
> reg avassets x if inrange(rank,8,10)
> *************
>
>
>
> HTH
> Martin
>
>
> -----Ursprüngliche Nachricht-----
> Von: [email protected]
> [mailto:[email protected]] Im Auftrag von David Kehrl
> Gesendet: Freitag, 6. August 2010 18:00
> An: [email protected]
> Betreff: Re: st: AW: creating subsamples in panel data
>
> Yes i want to use the average asset size over the whole sample period.
> But my main problem is that once I have e.g. ranked the asset variabel
> i dont know who I can connect the ranking to the other variables
> without mixing  observations from different banks.
> For example i used collapse but the I only get the asset variabel in
> order and not the other ones.
> But obviously I need to order the whole dataset by asset size.
> But maybe I am just confused and missing the point?
>
> Thanks so much,
>
> David
>
> 2010/8/6 Martin Weiss <[email protected]>:
>>
>> <>
>>
>>
>> Some function in -help egen- will be the solution, I guess, e.g. the
>> -pctile- function, or -rank-. Do you want to base the decision on average
>> assets of the bank over the entire sample period, or on those in a
> specific
>> year?
>>
>>
>>
>> HTH
>> Martin
>>
>> -----Ursprüngliche Nachricht-----
>> Von: [email protected]
>> [mailto:[email protected]] Im Auftrag von David Kehrl
>> Gesendet: Freitag, 6. August 2010 17:43
>> An: [email protected]
>> Betreff: st: creating subsamples in panel data
>>
>> Hi,
>>
>> 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.
>>
>> Kindly,
>>
>> David Kehrl
>> *
>> *   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/
>>
>
> *
> *   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/
>

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


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