I'm new to the forum, so apologies in advance if I don't exactly follow proper protocol. I have a 3-year panel. The attached contrived example contains the varnames mentioned here. There is a var in the most recent year (2011) that assigns each household (hhid) to a geographic sub region (sregion). Many of the same households appear in the earlier two years, but the sregion variable appears only in 2011. I want to assign a value for sregion to observations where the same hhid in 2011 appears in the earlier years. For example, I want to assign sregion=6 for hhid=106 in the earlier years. Similarly, I want sregion=1 for hhid=101, and sregion=2 for hhid=102 in the earlier years. I want the other values of sregion to remain missing. NOTE: The actual hhid values are 11 digits long, and there are too many to use something like 'replace sregion=6 if hhid==106' for all the values.
The sregion variable is crucial to my work. My goal here is to increase n by pulling in observations from earlier years, but they need an sregion value.
Thanks in advance for any help you can provide.
The sregion variable is crucial to my work. My goal here is to increase n by pulling in observations from earlier years, but they need an sregion value.
Thanks in advance for any help you can provide.
Comment