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 at the end of May, and its replacement, statalist.org is already up and running.


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

RE: st: How to replicate


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
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: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] 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/


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