Support #1151

Carrying forward variables across waves, creating 'how long lived at address' variable

Added by Natasha Codiroli over 4 years ago. Updated about 1 month ago.

Questionnaire content
Start date:
% Done:



Hi Understanding Society Support team,

I want to create a variable that tells me how long an individual has lived at their current address. I am using data from waves 1-8 in long format.

I noticed the variable mvyr is mostly missing for waves 2-8, so am assuming it's only asked on the first instance, and again if the person has moved. I have used the code below to carry forward this data if it is missing in later waves, and to calculate the number of years they have lived at their current address.

mvdecode mvyr istrtdaty, mv(-1/-99)
gen home_yrs = istrtdaty - mvyr

foreach x in 2 3 4 5 6 7 8 {
bysort pidp(wave): replace home_yrs=home_yrs1+`x'-1 if home_yrs==. & wave==`x'

Can I check with you that the above calculation looks correct, or whether there is an easier way generally to carry forward response? One problem I've noticed with this calculation is that there is a much higher proportion of people who have lived in their home less than a year in wave 1 compared to later waves.

Thanks for your help,



Updated by Stephanie Auty over 4 years ago

  • Status changed from New to In Progress
  • Assignee changed from Alita Nandi to Stephanie Auty
  • % Done changed from 0 to 10
  • Private changed from Yes to No

Many thanks for your enquiry. The Understanding Society team is looking into it and we will get back to you as soon as we can.

Best wishes,
Stephanie Auty - Understanding Society User Support Officer


Updated by Stephanie Auty over 4 years ago

  • Status changed from In Progress to Feedback
  • Assignee changed from Stephanie Auty to Natasha Codiroli
  • % Done changed from 10 to 60

Dear Natasha,

w_mvyr is only asked of new entrants, which you can see from the Universe in the online documentation and also in the questionnaires:

Other variables you will find useful in identifying people who have moved are listed in the Household Changes index term:
and in the questionnaires in the Annual Event History module:

Please be careful to read the Universe carefully, for example w_adcts is only asked of people who are at the same address as previously, as if they are not at the same address it is implied that they have moved. Some useful variables may be w_origadd and w_ff_all_moved which are computed rather than asked as a question.

Best wishes,


Updated by Stephanie Auty over 4 years ago

  • % Done changed from 60 to 70

Dear Natasha,

Just to add, the month and year of moving are recorded in w_plnowm and w_plnowy4.

Best wishes,


Updated by Understanding Society User Support Team about 1 year ago

  • Status changed from Feedback to Resolved
  • % Done changed from 70 to 100

Updated by Understanding Society User Support Team about 1 month ago

  • Category changed from Data analysis to Questionnaire content

Also available in: Atom PDF