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: RE: Ask how copy values
From
Nick Cox <[email protected]>
To
"'[email protected]'" <[email protected]>
Subject
st: RE: Ask how copy values
Date
Tue, 18 Oct 2011 15:16:23 +0100
At a guess, you want something like
bysort country (year) : gen gdp50 = gdp[1]
where I assume that the first year for every panel is 1950. For more complicated variations on this problem, see
SJ-11-2 dm0055 . . . . . . . . . . . . . . Speaking Stata: Compared with ...
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . N. J. Cox
Q2/11 SJ 11(2):305--314 (no commands)
reviews techniques for relating values to values in other
observations
Nick
[email protected]
Adiwan Fahlan
I want to generate an initial gdp value such as below:
Country year gdp50
1 1950 200
1 1960 200
1 1970 200
2 1950 300
2 1960 300
2 1970 300
.
.
.
20 1970 400
Can anyone help me with the code that generate the initial gdp for all country and year?
*
* 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/