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 on April 23, and its replacement, is already up and running.

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

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:

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