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: How to replicate
From
Hailemariam Teklewold <[email protected]>
To
statalist <[email protected]>
Subject
RE: st: How to replicate
Date
Sun, 21 Feb 2010 16:37:58 +0000
Thanks a million, Martin. This works very well.
Hailemariam
> From: [email protected]
> To: [email protected]
> Subject: RE: st: How to replicate
> Date: Sun, 21 Feb 2010 15:50:19 +0100
>
>
> <>
>
> If "marital" (status) is regarded as time-invariant in your dataset:
>
> *******
> clear*
>
> input byte ( Year ID edu marital)
> 1 1 10 1
> 2 1 . .
> 3 1 . .
> 4 1 . .
> 1 2 12 2
> 2 2 . .
> 3 2 . .
> 4 2 . .
> 1 3 8 1
> 2 3 . .
> 3 3 . .
> 4 3 . .
> end
>
> list, noo sepby(ID)
>
> bys ID (Year): replace edu=edu[1]
> bys ID (Year): replace marital=marital[1]
>
> list, noo sepby(ID)
> *******
>
>
> HTH
> Martin
>
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Hailemariam
> Teklewold
> Sent: Sonntag, 21. Februar 2010 11:30
> To: statalist
> Subject: RE: st: How to replicate
>
>
> Dear all,
>
> I have a panel data set more than 9000 observation of the following
> structure. But I want to replicate the first year values of the
> time-invariant variables to the remaining years corresponding to each ID.
>
>
>
> Appreciate any help.
>
>
>
>
>
>
>
> Year
>
>
> ID
>
> edu
>
> marital
>
>
> 1
>
> 1
>
> 10
>
> 1
>
>
> 2
>
> 1
>
>
>
>
>
>
> 3
>
> 1
>
>
>
>
>
>
> 4
>
> 1
>
>
>
>
>
>
> 1
>
> 2
>
> 12
>
> 2
>
>
> 2
>
> 2
>
>
>
>
>
>
> 3
>
> 2
>
>
>
>
>
>
> 4
>
> 2
>
>
>
>
>
>
> 1
>
> 3
>
> 8
>
> 1
>
>
> 2
>
> 3
>
>
>
>
>
>
> 3
>
> 3
>
>
>
>
>
>
> 4
>
> 3
>
>
>
>
>
>
> .
>
>
>
>
>
>
>
>
>
>
> Hailemariam
> *
> * 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/
_________________________________________________________________
Hotmail: Trusted email with powerful SPAM protection.
https://signup.live.com/signup.aspx?id=60969*
* 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/