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: How to replicate


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: How to replicate
Date   Mon, 22 Feb 2010 11:37:07 -0000

See also 

How can I replace missing values with previous or following nonmissing
values or within sequences? 
http://www.stata.com/support/faqs/data/missing.html

Nick 
[email protected] 

Martin Weiss


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

Hailemariam

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. 

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