Support #993

merging birth month and birth year to idresp and youth surveys

Added by Yaroslava Zemlyanska about 4 years ago. Updated almost 4 years ago.

Start date:
% Done:




I am using the Harmonised BHP and Understanding Society dataset to evaluate the impact of raising the minimum legal age for purchase of e-cigarettes on smoking prevalence using regression discontinuity design. I have aggregated the US wave 2-7 datasets into one and reshaped them, however I am not able to merge it with the cross wave id dataset, which contains information on individual's month and year of birth. Without this information, I cannot carry out the analysis. If you could please help me I would really appreciate it! Thank you.

Please find below the description of what I did:

1. I merged waves 2-7 from responding adults 16+ dataset ("indresp") and reshaped it into long format
2. I merged waves 2-7 from youths (age 10-15) dataset and reshaped it into long format
3. I appended the 2 datasets together
4. I tried merging the cross wave id dataset ("xwaveid") with the combined long file as follows:

merge 1:1 pidp using "/Users/.../xwaveid.dta"

however that did not work out because pidp did not uniquely define observations in the long format. I then reshaped the combined file into wide format and repeated the above command to obtain 80'290 matches instead of the full 121'665 that are in xwaveid file. Could you please let me know what am I doing wrong and how can I assign the month and year of birth to all individuals from both youth and adult questionnaires?

Additionally, if my data is in long format, can I run regression discontinuity analysis as if I had cross-sectional data?

Thank you in advance. I look forward to your answer.

Kind regards,



Updated by Stephanie Auty about 4 years ago

  • Status changed from New to In Progress
  • Target version set to X M
  • % 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 about 4 years ago

  • Status changed from In Progress to Feedback
  • Assignee set to Yaroslava Zemlyanska
  • % Done changed from 10 to 80

Dear Yaroslava,

As the long file format you create in the first three steps above will have more than one observation per respondent, you will need to use a m:1 merge when merging xwaveid, rather than 1:1.

Our remit at the User Forum is to answer queries related to Understanding Society data and provide general advice about how to manage the data. Given the number of users we have I'm afraid we cannot advise on individual users' analysis specifically. We do not provide training in statistical methods but there are a wide range of courses available - NCRM provide a use list of course held across the country

Best wishes,
Stephanie Auty - Understanding Society User Support Officer


Updated by Stephanie Auty almost 4 years ago

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

Also available in: Atom PDF