Statalist


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

st: AW: What to do about multiple observations for one individual in one same period in a panel


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: AW: What to do about multiple observations for one individual in one same period in a panel
Date   Sun, 19 Jul 2009 19:01:05 +0200

<> 

Aggregate the two levels via -egen, group()-:


*************
clear*

input country:mylabel /* 
 */ str10 date, auto 
Argentina   "1990:1"
Argentina   "1990:1"
Argentina   "1990:1"
Argentina   "1990:2"
Argentina   "1990:3"
Argentina   "1990:4"
Argentina   "1990:4"
Argentina   "1990:4"
Argentina   "1990:4"
Argentina   "1991:1"
Argentina   "1991:1"
Argentina   "2008:3"
Argentina   "2008:4"
Argentina   "2008:4"
Brazil      "1990:1"
Brazil      "1990:2"
Brazil      "1990:2"
Brazil      "1990:3"
Brazil      "1990:3"
Brazil      "1990:3"
Brazil      "1990:3"
end

compress

gen date2=/* 
*/ quarterly(date, "YQ")
format date2 %tq
drop date 

//get pseudo-units
egen unit=group(cou date2)

//get bond number
bys cou unit: /* 
*/ gen bond=_n

list, noobs /* 
*/ sepby(cou unit)
*************



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von kokootchke
Gesendet: Sonntag, 19. Juli 2009 18:28
An: statalist
Betreff: st: What to do about multiple observations for one individual in
one same period in a panel

Do you guys know what one can do about multiple observations for one
individual in one same period in a panel? 

A standard panel would be like this (with a bunch of other variables that
are unique for that individual country and time period):

Argentina   1990:1
Argentina   1990:2
Argentina   1990:3
Argentina   1990:4
Argentina   1991:1
...
Argentina   2008:3
Argentina   2008:4
Brazil      1990:1
Brazil      1990:2
Brazil      1990:3
...
Brazil      2008:3

Brazil      2008:4
Colombia    1990:1
Colombia    1990:2
Colombia    1990:3
...
...

Now, imagine I have the following:


Argentina   1990:1
Argentina   1990:1
Argentina   1990:1
Argentina   1990:2
Argentina   1990:3

Argentina   1990:4
Argentina   1990:4
Argentina   1990:4
Argentina   1990:4

Argentina   1991:1
Argentina   1991:1

...

Argentina   2008:3

Argentina   2008:4
Argentina   2008:4

Brazil      1990:1

Brazil      1990:2
Brazil      1990:2

Brazil      1990:3
Brazil      1990:3
Brazil      1990:3
Brazil      1990:3

...

...

You see the difference? Suppose that for each repeated individual (country)
and time period, I have different measurings of some variable. 

More specifically, my problem is one of selection in which countries don't
issue debt bonds in some periods, but when they do issue, they may issue
MULTIPLE bonds, each with a different price, etc.

What can I do about this?

Thank you very much in advance!

Regards,
Adrian

_________________________________________________________________
NEW mobile Hotmail. Optimized for YOUR phone.  Click here.
http://windowslive.com/Mobile?ocid=TXT_TAGLM_WL_CS_MB_new_hotmail_072009
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index