Hi Stata Community,
I was wondering if anyone knew how to refer to variables in specific years for data cleaning purposes.
For a simple example, if in 2009 a survey respondent says their washing machine is 8 years old, I would like to fill in their replacement choice: "repl"=1 in 2001.
In an ideal world, I would love to use syntax like:
replace 2001.repl=1 if 2009.age == 8
Since some of my data has only categories of years, this can get kind of complex:
replace 2004.repl=1 if 2005.age== "0 to 1 years" & 2009.age == "5 to 9 years"
Is any version of this possible with panel data? I have been unsuccessful at locating the appropriate syntax.
Alecia Cassidy
I was wondering if anyone knew how to refer to variables in specific years for data cleaning purposes.
For a simple example, if in 2009 a survey respondent says their washing machine is 8 years old, I would like to fill in their replacement choice: "repl"=1 in 2001.
In an ideal world, I would love to use syntax like:
replace 2001.repl=1 if 2009.age == 8
Since some of my data has only categories of years, this can get kind of complex:
replace 2004.repl=1 if 2005.age== "0 to 1 years" & 2009.age == "5 to 9 years"
Is any version of this possible with panel data? I have been unsuccessful at locating the appropriate syntax.
Alecia Cassidy
Comment