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]

st: Generating new lines/record for groups of data


From   Navid Asgari <[email protected]>
To   [email protected]
Subject   st: Generating new lines/record for groups of data
Date   Tue, 22 May 2012 23:51:14 +0800

Hi all,

I would like to add new records to my data by groups. My longitudinal
data-set looks like this (the maximum length of a panel is 4
years[from 1990 to  1993, but some Firms have less observations, so I
have an unbalanced panel data])

Firm_ID      Year     var1   Var2
-------------------------------------------
G33            1990      2       2.5
G33            1991      3.4    1.2
G33            1992      5.6    2.8
G33            1993      8.1    9.2
KL1            1992      3       2.22


As you can see "G33" has three records from 1990 to 1993... Now I want
to make it look like a balanced panel data:

Firm_ID      Year     var1   Var2
-------------------------------------------
G33            1990      2       2.5
G33            1991      3.4    1.2
G33            1992      5.6    2.8
G33            1993      8.1    9.2
KL1            1992      3       2.22
KL1             1990     .         .
KL1             1991     .         .
KL1             1993     .         .


Thanks in advance!

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