[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: Replacing the value of a variable
bysort subject (period) : gen firstcon=con[1]
[email protected] wrote:
Hello,
for each given "subject" and for all 20 "period"s associated with the
respective subject- I would like to fill the variable called "firstcon"
with the value of another variable "con" from "period" 1 of the
respective subject.
For example: if subject 3's "con" variable in "period" 1 is "17" then
this subject's "firstcon" variable should be filled with "17", for all
periods from 1 to 20, i.e., for all 20 rows.
How can I do this? Thank you very much for your help!
Ozgur
*
* 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/