Hello,

I have a similar question as in https://www.statalist.org/forums/for...same-household which has not been resolved yet.

Below I show data of 3 variables: the interview year (int_year), the year the household moved into the house (hhmove) and if the house has a pool (poolacc; 1=yes, 2= no).

FYI: the data comes from the American Housing Survey, which interviews the same houses every 2 years.
For variables of other housing characteristics I have values for all interview years (2001-2011), except for variable 'poolacc'. For this variable, only values in 2011 are available.
I am trying to impute/copy the same values of poolacc of int_year=2011 to the other interview years as my mentor has instructed me (assuming the houses always had or did not have a pool in the years before).


Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float int_year int hhmove byte poolacc 2009 2008 . 2009 2007 . 2009 2007 . 2009 2008 . 2009 2007 . 2009 2007 . 2009 2007 . 2009 2007 . 2009 2007 . 2009 2008 . end
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float int_year int hhmove byte poolacc 2011 2009 2 2011 2010 2 2011 2009 2 2011 2010 1 2011 2009 2 2011 2010 2 2011 2011 1 2011 2009 1 2011 2010 2 2011 2009 2 end
Thanks in advance!