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: create a variable using the first value in time-series data by group
From
PKCHEN UMD <[email protected]>
To
[email protected]
Subject
st: create a variable using the first value in time-series data by group
Date
Mon, 10 Jun 2013 21:33:41 -0400
Hello Statalist,
I have a time-series cross sections dyad-year dataset. I run the
regression and create the prediction variable for each observation. I
want to take the prediction of the first year of each dyad and times
1.3. There is one number for the beginning year of every dyad. Then I
want to compare the rest of years of prediction with the beginning
year. My goal is to create a dummy variable that is 1 if any yearly
prediction for that dayd is more than 1.3*the beginning year
prediction.
I manage to create a variable that contains the 1.3*the first year
prediction using by dyad: gen. But I can only tell stata to fill in
the value of the beginning. The rest of yearly observations are coded
as missing. Is there a command that can autofill the missing value
with the first year prediction I create? Or is there a more succinct
way to create the dummy variable I want?
Thank you very much!
--
Ping-Kuei Chen
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/