----------------------------------------------------------------------------------
name:
log: D:\USF\issues\2066\2066.log
log type: text
opened on: 7 Mar 2024, 21:18:29
. do "C:\Users\rc22989\AppData\Local\Temp\STD2434_000000.tmp"
. /* Note: The data file produced will be at the individual level and cover all a
> ges, irrespective of the variables requested.
> In this current version of the tool, it is not possible to select variables by
> wave - though you may edit the code below to do so. */
.
. /*******************************************************************************
> *********
> * Sample Code for your request: f52ac44389924ce3bd30cf41399e35fd *
> ********************************************************************************
> *********/
. clear all
. set more off
.
. // Replace "where" with the filepath of the working folder (where any temporary
> files created by this programme will be stored) eg: c:\ukhls\temp
. cd "D:\USF\issues\2066"
D:\USF\issues\2066
.
. // Replace "where" with the folderpath where the data has been downloaded and un
> zipped eg: c:\ukhls_data\UKDA-6614-stata\stata\stata13_se\ukhls
. global ukhls "D:\UKHLS\w13\UKDA-6614-stata\stata\stata13_se\ukhls"
.
. // Replace "where" with the filepath of the folder where you want to store the f
> inal dataset produced by this programme. eg: c:\ukhls\results
. global outputpath "D:\USF\issues\2066"
.
. // The file produced by this programme will be named as below. If you want to ch
> ange the name do it here.
. local outputfilename "UKHLS_2066"
.
. // By default the data will be extracted from the waves whose letter prefixes ar
> e written below, and merged. If you want to a different selection of waves, make
> the change here
. local allWaves = "h i j"
.
. // These variables from the indall files will be included. These include some ke
> y variables as determined by us PLUS any variables requested by you.
. local indallvars "age_dv country ethn_dv gor_dv hhsize hidp mastat_dv nchild_dv
> pidp pno psnen01_lw psnen01_xw psnen91_lw psnen91_xw psnen99_lw psnen99_xw psnen
> ub_lw psnenub_xw psnenui_lw psnenui_xw psnenus_lw psnenus_xw psu racel_dv sex_dv
> strata urban_dv"
.
. // These variables from the indresp files will be included. These include some k
> ey variables as determined by us PLUS any variables requested by you.
. local indvars "age_dv country ethn_dv gor_dv hhsize hhtype_dv hidp ind5mus_lw in
> d5mus_xw indbd91_lw indbdub_lw indin01_lw indin01_xw indin91_lw indin91_xw indin
> 99_lw indin99_xw indinub_lw indinub_xw indinui_lw indinui_xw indinus_lw indinus_
> xw indns91_lw indnsub_lw indpxub_lw indpxub_xw indpxui_lw indpxui_xw indpxus_lw
> indpxus_xw indscub_lw indscub_xw indscui_lw indscui_xw indscus_lw indscus_xw jbb
> gy jbsat jbsemp jbstat jsboss jspart jssize mastat_dv nchild_dv pidp pno psu rac
> el_dv sclfsato sex_dv strata tenure_dv ukborn urban_dv wkaut1 wkaut2 wkaut3 wkau
> t4 wkaut5"
.
. // These variables from the child files will be included. These include some key
> variables as determined by us PLUS any variables requested by you.
. local chvars "age_dv chddvub_lw chddvub_xw chddvui_lw chddvui_xw country gor_dv
> hhsize hidp pidp pno psnen01_lw psnen91_lw psnenub_lw psnenub_xw psnenui_lw psne
> nui_xw psnenus_lw psnenus_xw psu sex_dv strata urban_dv"
.
. // These variables from the hhresp files will be included. These include some ke
> y variables as determined by us PLUS any variables requested by you.
. local hhvars "country fihhmnnet1_dv gor_dv hhden01_xw hhden91_xw hhden99_xw hhde
> nub_xw hhdenui_xw hhdenus_xw hhsize hhtype_dv hidp ieqmoecd_dv nkids_dv psu stra
> ta tenure_dv urban_dv"
.
. // These variables from the youth files will be included. These include some key
> variables as determined by us PLUS any variables requested by you.
. local youthvars "age_dv country ethn_dv gor_dv hidp pidp pno psu racel_dv sex_dv
> strata urban_dv ythscub_xw ythscui_xw ythscus_xw"
.
.
. ////////////////////////////////////////////////////////////////////////////////
> /////////////////////////////////////////////////////////////////////////
> // Anything below this line should not be changed! Any changes to the selection
> of variables and waves, and location of folders, should be made above. //
. ////////////////////////////////////////////////////////////////////////////////
> /////////////////////////////////////////////////////////////////////////
>
. // this program returns all variable names with the wave prefix
. program define getVars, rclass
1. version 14.0
2. if ("`1'" != "") {
3. local wavemyvars = " `1'"
4. local wavemyvars = subinstr("`wavemyvars'"," "," `2'_",.)
5. local wavemyvars = substr("`wavemyvars'",2,.)
6. }
7. else local wavemyvars = ""
8. return local fixedVars "`wavemyvars'"
9. end
.
. // this program to returns which variables exist in this wave
. program define getExistingVars, rclass
1. version 14.0
2. local all = ""
3. foreach var in `1' {
4. capture confirm variable `var'
5. if !_rc {
6. local all = "`all' `var'"
7. }
8. }
9. return local existingVars "`all'"
10. end
.
. //loop through each wave
. foreach wave in `allWaves' {
2. // find the wave number
. local waveno=strpos("abcdefghijklmnopqrstuvwxyz","`wave'")
3.
. // find the wave household vars
. getVars "`hhvars'" `wave'
4. local wavehhvars = "`r(fixedVars)'"
5.
. // find the wave individual vars
. getVars "`indvars'" `wave'
6. local waveindvars = "`r(fixedVars)'"
7.
. // find the wave all individual vars
. getVars "`indallvars'" `wave'
8. local waveindallvars = "`r(fixedVars)'"
9.
. // find the wave child vars
. getVars "`chvars'" `wave'
10. local wavechvars = "`r(fixedVars)'"
11.
. // find the wave youth vars
. getVars "`youthvars'" `wave'
12. local waveyouthvars = "`r(fixedVars)'"
13.
. // open the the household level file with the required variables
. use "$ukhls/`wave'_hhresp", clear
14. getExistingVars "`wave'_hidp `wavehhvars'"
15. keep `r(existingVars)'
16.
. // if only household variables are required, skip this part and return a
> ll households
. if ("`indvars'" != "" || "`chvars'" != "" || "`youthvars'" != "") {
17. // if any individual variable is required, first merge INDAL
> L keeping the pipd (and possibly some default variables?), so that other files c
> an merge on it.
. merge 1:m `wave'_hidp using "$ukhls/`wave'_indall"
18. drop _merge
19. // drop loose households with no individuals
. drop if (pidp == .)
20.
. // keep only variables that were requested and exist in this wav
> e
. getExistingVars "pidp `wave'_hidp `wavehhvars' `waveindallvars'"
21. keep `r(existingVars)'
22.
. // add any requested individual variables
. if ("`indvars'" != "") {
23. merge 1:1 pidp using "$ukhls/`wave'_indresp"
24. drop _merge
25. // keep only variables that were requested and exist
> in this wave
. getExistingVars "pidp `wave'_hidp `wavehhvars' `waveindv
> ars' `waveyouthvars' `wavechvars' `waveindallvars'"
26. keep `r(existingVars)'
27. }
28. // add any requested youth variables
. if ("`waveyouthvars'" != "") {
29. merge 1:1 pidp using "$ukhls/`wave'_youth"
30. drop _merge
31. // keep only variables that were requested and exist
> in this wave
. getExistingVars "pidp `wave'_hidp `wavehhvars' `waveindv
> ars' `waveyouthvars' `wavechvars' `waveindallvars'"
32. keep `r(existingVars)'
33. }
34. // add any requested child variables
. if ("`wavechvars'" != "") {
35. merge 1:1 pidp using "$ukhls/`wave'_child"
36. drop _merge
37. // keep only variables that were requested and exist
> in this wave
. getExistingVars "pidp `wave'_hidp `wavehhvars' `waveindv
> ars' `waveyouthvars' `wavechvars' `waveindallvars'"
38. keep `r(existingVars)'
39. }
40. }
41.
. // create a wave variable
. gen wavename=`waveno'
42.
. // drop the wave prefix from all variables
. rename `wave'_* *
43.
. // save the file that was created
. save temp_`wave', replace
44.
. }
(Substantive data from responding households)
(label h_hrpno already defined)
(label h_hrpid already defined)
(label h_hhresp_dv already defined)
(label h_urban_dv already defined)
(label h_gor_dv already defined)
(label h_country already defined)
(label h_npensioner_dv already defined)
(label h_hhsize already defined)
(label h_ringfence already defined)
(label h_hhlang already defined)
(label h_hglitrans already defined)
(label h_hglieng already defined)
(label h_ivfho already defined)
(label h_quarter already defined)
(label h_month already defined)
(label h_strata already defined)
(label h_psu already defined)
(label h_hhorig already defined)
Result Number of obs
-----------------------------------------
Not matched 1,830
from master 0 (_merge==1)
from using 1,830 (_merge==2)
Matched 54,778 (_merge==3)
-----------------------------------------
(0 observations deleted)
(label pid already defined)
(label h_pno already defined)
(label h_hhorig already defined)
(label h_memorig already defined)
(label h_psu already defined)
(label h_strata already defined)
(label h_sampst already defined)
(label h_month already defined)
(label h_quarter already defined)
(label h_ivfio already defined)
(label h_ioutcome already defined)
(label h_sex already defined)
(label h_dvage already defined)
(label h_birthy already defined)
(label h_marstat already defined)
(label h_livesp already defined)
(label h_livewith already defined)
(label h_employ already defined)
(label h_lingua already defined)
(label h_hgpart already defined)
(label h_hgbiom already defined)
(label h_hgbiof already defined)
(label h_hgadoptm already defined)
(label h_hgadoptf already defined)
(label h_respm16 already defined)
(label h_respf16 already defined)
(label h_ringfence already defined)
(label h_origadd already defined)
(label h_intdatd_if already defined)
(label h_intdatm_if already defined)
(label h_intdaty_if already defined)
(label h_doby_if already defined)
(label h_age_if already defined)
(label h_ppsex already defined)
(label h_fnpid already defined)
(label h_mnpid already defined)
(label h_pn1pid already defined)
(label h_pn1pno already defined)
(label h_pn1sex already defined)
(label h_pn2pid already defined)
(label h_pn2pno already defined)
(label h_pn2sex already defined)
(label h_pns1pid already defined)
(label h_pns1pno already defined)
(label h_pns1sex already defined)
(label h_pns2pid already defined)
(label h_pns2pno already defined)
(label h_pns2sex already defined)
(label h_grfpid already defined)
(label h_grmpid already defined)
(label h_hhsize already defined)
(label h_ff_ivlolw already defined)
(label h_sex_dv already defined)
(label h_age_dv already defined)
(label h_intdatd_dv already defined)
(label h_intdatm_dv already defined)
(label h_intdaty_dv already defined)
(label h_doby_dv already defined)
(label h_pensioner_dv already defined)
(label h_marstat_dv already defined)
(label h_npn_dv already defined)
(label h_npns_dv already defined)
(label h_ngrp_dv already defined)
(label h_nnsib_dv already defined)
(label h_nnssib_dv already defined)
(label h_npensioner_dv already defined)
(label h_ethn_dv already defined)
(label h_racel_dv already defined)
(label h_country already defined)
(label h_gor_dv already defined)
(label h_urban_dv already defined)
(label h_hhresp_dv already defined)
(label h_agegr5_dv already defined)
(label h_agegr10_dv already defined)
(label h_agegr13_dv already defined)
(label h_livesp_dv already defined)
(label h_cohab_dv already defined)
(label h_single_dv already defined)
(label h_mastat_dv already defined)
(label h_hhtype_dv already defined)
(label h_buno_dv already defined)
(label h_depchl_dv already defined)
(label h_nchild_dv already defined)
(label h_ndepchl_dv already defined)
(label h_adresp15_dv already defined)
(label h_respm16_dv already defined)
(label h_respf16_dv already defined)
(label h_rach16_dv already defined)
(label h_hrpid already defined)
(label h_hrpno already defined)
(label h_ppid already defined)
(label h_ppno already defined)
(label h_sppid already defined)
(label h_sppno already defined)
(label h_fnpno already defined)
(label h_fnspid already defined)
(label h_fnspno already defined)
(label h_mnpno already defined)
(label h_mnspid already defined)
(label h_mnspno already defined)
(label h_grfpno already defined)
(label h_grmpno already defined)
(label h_scflag_dv already defined)
Result Number of obs
-----------------------------------------
Not matched 17,314
from master 17,314 (_merge==1)
from using 0 (_merge==2)
Matched 39,294 (_merge==3)
-----------------------------------------
(label pid already defined)
(label h_pno already defined)
(label h_hhorig already defined)
(label h_memorig already defined)
(label h_psu already defined)
(label h_strata already defined)
(label h_sampst already defined)
(label h_ivfio already defined)
(label h_sex already defined)
(label h_dvage already defined)
(label h_ypsocweb already defined)
(label h_ypnetcht already defined)
(label h_ypnpal already defined)
(label h_ypesta already defined)
(label h_ypesti already defined)
(label h_ypestb already defined)
(label h_ypestj already defined)
(label h_ypestc already defined)
(label h_ypestk already defined)
(label h_ypeste already defined)
(label h_ypestf already defined)
(label h_ypamar already defined)
(label h_ypapar already defined)
(label h_ringfence already defined)
(label h_intdatd_if already defined)
(label h_intdatm_if already defined)
(label h_intdaty_if already defined)
(label h_doby_if already defined)
(label h_age_if already defined)
(label h_fnpid already defined)
(label h_mnpid already defined)
(label h_pn1pid already defined)
(label h_pn1pno already defined)
(label h_pn1sex already defined)
(label h_pn2pid already defined)
(label h_pn2pno already defined)
(label h_pn2sex already defined)
(label h_pns1pid already defined)
(label h_pns1pno already defined)
(label h_pns1sex already defined)
(label h_pns2pid already defined)
(label h_pns2pno already defined)
(label h_pns2sex already defined)
(label h_grfpid already defined)
(label h_grmpid already defined)
(label h_sex_dv already defined)
(label h_age_dv already defined)
(label h_intdatd_dv already defined)
(label h_intdatm_dv already defined)
(label h_intdaty_dv already defined)
(label h_doby_dv already defined)
(label h_npn_dv already defined)
(label h_npns_dv already defined)
(label h_ngrp_dv already defined)
(label h_nnsib_dv already defined)
(label h_nnssib_dv already defined)
(label h_ethn_dv already defined)
(label h_racel_dv already defined)
(label h_country already defined)
(label h_gor_dv already defined)
(label h_urban_dv already defined)
(label h_hhresp_dv already defined)
(label h_agegr5_dv already defined)
(label h_agegr10_dv already defined)
(label h_agegr13_dv already defined)
(label h_buno_dv already defined)
(label h_adresp15_dv already defined)
(label h_rach16_dv already defined)
(label h_hrpid already defined)
(label h_hrpno already defined)
(label h_fnpno already defined)
(label h_fnspid already defined)
(label h_fnspno already defined)
(label h_mnpno already defined)
(label h_mnspid already defined)
(label h_mnspno already defined)
(label h_grfpno already defined)
(label h_grmpno already defined)
Result Number of obs
-----------------------------------------
Not matched 53,336
from master 53,336 (_merge==1)
from using 0 (_merge==2)
Matched 3,272 (_merge==3)
-----------------------------------------
(label h_grmpno already defined)
(label h_grfpno already defined)
(label h_mnspno already defined)
(label h_mnspid already defined)
(label h_mnpno already defined)
(label h_fnspno already defined)
(label h_fnspid already defined)
(label h_fnpno already defined)
(label h_hrpno already defined)
(label h_hrpid already defined)
(label h_adresp15_dv already defined)
(label h_depchl_dv already defined)
(label h_buno_dv already defined)
(label h_agegr13_dv already defined)
(label h_agegr10_dv already defined)
(label h_agegr5_dv already defined)
(label h_hhresp_dv already defined)
(label h_urban_dv already defined)
(label h_gor_dv already defined)
(label h_country already defined)
(label h_nnssib_dv already defined)
(label h_nnsib_dv already defined)
(label h_ngrp_dv already defined)
(label h_npns_dv already defined)
(label h_npn_dv already defined)
(label h_doby_dv already defined)
(label h_intdaty_dv already defined)
(label h_intdatm_dv already defined)
(label h_intdatd_dv already defined)
(label h_age_dv already defined)
(label h_sex_dv already defined)
(label h_grmpid already defined)
(label h_grfpid already defined)
(label h_pns2sex already defined)
(label h_pns2pno already defined)
(label h_pns2pid already defined)
(label h_pns1sex already defined)
(label h_pns1pno already defined)
(label h_pns1pid already defined)
(label h_pn2sex already defined)
(label h_pn2pno already defined)
(label h_pn2pid already defined)
(label h_pn1sex already defined)
(label h_pn1pno already defined)
(label h_pn1pid already defined)
(label h_mnpid already defined)
(label h_fnpid already defined)
(label h_age_if already defined)
(label h_doby_if already defined)
(label h_intdaty_if already defined)
(label h_intdatm_if already defined)
(label h_intdatd_if already defined)
(label h_ringfence already defined)
(label h_newentrant already defined)
(label h_region already defined)
(label h_hhlang already defined)
(label h_hglitrans already defined)
(label h_hglieng already defined)
(label h_lingua already defined)
(label h_reasref97 already defined)
(label h_reasref96 already defined)
(label h_reasref32 already defined)
(label h_reasref31 already defined)
(label h_reasref30 already defined)
(label h_reasref26 already defined)
(label h_reasref25 already defined)
(label h_reasref24 already defined)
(label h_reasref23 already defined)
(label h_reasref22 already defined)
(label h_reasref21 already defined)
(label h_reasref20 already defined)
(label h_reasref15 already defined)
(label h_reasref14 already defined)
(label h_reasref13 already defined)
(label h_reasref12 already defined)
(label h_reasref11 already defined)
(label h_reasref10 already defined)
(label h_newdad already defined)
(label h_newmum already defined)
(label h_hgadoptf already defined)
(label h_hgadoptm already defined)
(label h_hgbioad2 already defined)
(label h_hgbioad1 already defined)
(label h_hgbiof already defined)
(label h_hgbiom already defined)
(label h_livpar already defined)
(label h_pensioner already defined)
(label h_rjrflag already defined)
(label h_bedsits already defined)
(label h_purposeblt already defined)
(label h_housebun already defined)
(label h_dwltype already defined)
(label h_hhelig already defined)
(label h_respemail already defined)
(label h_respemailconf already defined)
(label h_hhemail already defined)
(label h_ctitle already defined)
(label h_newper already defined)
(label h_curstat already defined)
(label h_movctry already defined)
(label h_moveyr already defined)
(label h_movemth already defined)
(label h_lvwhy already defined)
(label h_mothr already defined)
(label h_stillres already defined)
(label h_includ already defined)
(label h_dieprisyr already defined)
(label h_dieprismth already defined)
(label h_more already defined)
(label h_ageif already defined)
(label h_nebirthy already defined)
(label h_nesex already defined)
(label h_jnyear already defined)
(label h_jnmnth already defined)
(label h_rejoinero already defined)
(label h_rejoiner already defined)
(label h_joiner already defined)
(label h_ynew already defined)
(label h_prishome already defined)
(label h_abspris already defined)
(label h_unihome already defined)
(label h_absun already defined)
(label h_birthy already defined)
(label h_dvage already defined)
(label h_sex already defined)
(label h_ivfho already defined)
(label h_ivfio already defined)
(label h_quarter already defined)
(label h_month already defined)
(label h_sampst already defined)
(label h_strata already defined)
(label h_psu already defined)
(label h_memorig already defined)
(label h_hhorig already defined)
(label h_pno already defined)
(label pid already defined)
Result Number of obs
-----------------------------------------
Not matched 45,059
from master 45,059 (_merge==1)
from using 0 (_merge==2)
Matched 11,549 (_merge==3)
-----------------------------------------
(file temp_h.dta not found)
file temp_h.dta saved
(Substantive data from responding households)
(label i_hhorig already defined)
(label i_psu already defined)
(label i_strata already defined)
(label i_month already defined)
(label i_quarter already defined)
(label i_ivfho already defined)
(label i_hglieng already defined)
(label i_hglitrans already defined)
(label i_hhlang already defined)
(label i_ringfence already defined)
(label i_hhsize already defined)
(label i_npensioner_dv already defined)
(label i_country already defined)
(label i_gor_dv already defined)
(label i_urban_dv already defined)
(label i_hhresp_dv already defined)
(label i_hrpid already defined)
(label i_hrpno already defined)
Result Number of obs
-----------------------------------------
Not matched 2,682
from master 0 (_merge==1)
from using 2,682 (_merge==2)
Matched 50,012 (_merge==3)
-----------------------------------------
(0 observations deleted)
(label i_scflag_dv already defined)
(label i_grmpno already defined)
(label i_grfpno already defined)
(label i_mnspno already defined)
(label i_mnspid already defined)
(label i_mnpno already defined)
(label i_fnspno already defined)
(label i_fnspid already defined)
(label i_fnpno already defined)
(label i_sppno already defined)
(label i_sppid already defined)
(label i_ppno already defined)
(label i_ppid already defined)
(label i_hrpno already defined)
(label i_hrpid already defined)
(label i_rach16_dv already defined)
(label i_respf16_dv already defined)
(label i_respm16_dv already defined)
(label i_adresp15_dv already defined)
(label i_ndepchl_dv already defined)
(label i_nchild_dv already defined)
(label i_depchl_dv already defined)
(label i_buno_dv already defined)
(label i_hhtype_dv already defined)
(label i_mastat_dv already defined)
(label i_single_dv already defined)
(label i_cohab_dv already defined)
(label i_livesp_dv already defined)
(label i_agegr13_dv already defined)
(label i_agegr10_dv already defined)
(label i_agegr5_dv already defined)
(label i_hhresp_dv already defined)
(label i_urban_dv already defined)
(label i_gor_dv already defined)
(label i_country already defined)
(label i_racel_dv already defined)
(label i_ethn_dv already defined)
(label i_npensioner_dv already defined)
(label i_nnssib_dv already defined)
(label i_nnsib_dv already defined)
(label i_ngrp_dv already defined)
(label i_npns_dv already defined)
(label i_npn_dv already defined)
(label i_marstat_dv already defined)
(label i_pensioner_dv already defined)
(label i_doby_dv already defined)
(label i_intdaty_dv already defined)
(label i_intdatm_dv already defined)
(label i_intdatd_dv already defined)
(label i_age_dv already defined)
(label i_sex_dv already defined)
(label i_ff_ivlolw already defined)
(label i_hhsize already defined)
(label i_grmpid already defined)
(label i_grfpid already defined)
(label i_pns2sex already defined)
(label i_pns2pno already defined)
(label i_pns2pid already defined)
(label i_pns1sex already defined)
(label i_pns1pno already defined)
(label i_pns1pid already defined)
(label i_pn2sex already defined)
(label i_pn2pno already defined)
(label i_pn2pid already defined)
(label i_pn1sex already defined)
(label i_pn1pno already defined)
(label i_pn1pid already defined)
(label i_mnpid already defined)
(label i_fnpid already defined)
(label i_ppsex already defined)
(label i_age_if already defined)
(label i_doby_if already defined)
(label i_intdaty_if already defined)
(label i_intdatm_if already defined)
(label i_intdatd_if already defined)
(label i_origadd already defined)
(label i_ringfence already defined)
(label i_respf16 already defined)
(label i_respm16 already defined)
(label i_hgadoptf already defined)
(label i_hgadoptm already defined)
(label i_hgbiof already defined)
(label i_hgbiom already defined)
(label i_hgpart already defined)
(label i_lingua already defined)
(label i_employ already defined)
(label i_livewith already defined)
(label i_livesp already defined)
(label i_marstat already defined)
(label i_birthy already defined)
(label i_dvage already defined)
(label i_sex already defined)
(label i_ioutcome already defined)
(label i_ivfio already defined)
(label i_quarter already defined)
(label i_month already defined)
(label i_sampst already defined)
(label i_strata already defined)
(label i_psu already defined)
(label i_memorig already defined)
(label i_hhorig already defined)
(label pid already defined)
Result Number of obs
-----------------------------------------
Not matched 16,636
from master 16,636 (_merge==1)
from using 0 (_merge==2)
Matched 36,058 (_merge==3)
-----------------------------------------
(label pid already defined)
(label i_hhorig already defined)
(label i_memorig already defined)
(label i_psu already defined)
(label i_strata already defined)
(label i_sampst already defined)
(label i_ivfio already defined)
(label i_sex already defined)
(label i_dvage already defined)
(label i_ringfence already defined)
(label i_intdatd_if already defined)
(label i_intdatm_if already defined)
(label i_intdaty_if already defined)
(label i_doby_if already defined)
(label i_age_if already defined)
(label i_fnpid already defined)
(label i_mnpid already defined)
(label i_pn1pid already defined)
(label i_pn1pno already defined)
(label i_pn1sex already defined)
(label i_pn2pid already defined)
(label i_pn2pno already defined)
(label i_pn2sex already defined)
(label i_pns1pid already defined)
(label i_pns1pno already defined)
(label i_pns1sex already defined)
(label i_pns2pid already defined)
(label i_pns2pno already defined)
(label i_pns2sex already defined)
(label i_grfpid already defined)
(label i_grmpid already defined)
(label i_sex_dv already defined)
(label i_age_dv already defined)
(label i_intdatd_dv already defined)
(label i_intdatm_dv already defined)
(label i_intdaty_dv already defined)
(label i_doby_dv already defined)
(label i_npn_dv already defined)
(label i_npns_dv already defined)
(label i_ngrp_dv already defined)
(label i_nnsib_dv already defined)
(label i_nnssib_dv already defined)
(label i_ethn_dv already defined)
(label i_racel_dv already defined)
(label i_country already defined)
(label i_gor_dv already defined)
(label i_urban_dv already defined)
(label i_hhresp_dv already defined)
(label i_agegr5_dv already defined)
(label i_agegr10_dv already defined)
(label i_agegr13_dv already defined)
(label i_buno_dv already defined)
(label i_adresp15_dv already defined)
(label i_rach16_dv already defined)
(label i_hrpid already defined)
(label i_hrpno already defined)
(label i_fnpno already defined)
(label i_fnspid already defined)
(label i_fnspno already defined)
(label i_mnpno already defined)
(label i_mnspid already defined)
(label i_mnspno already defined)
(label i_grfpno already defined)
(label i_grmpno already defined)
Result Number of obs
-----------------------------------------
Not matched 49,873
from master 49,873 (_merge==1)
from using 0 (_merge==2)
Matched 2,821 (_merge==3)
-----------------------------------------
(label i_grmpno already defined)
(label i_grfpno already defined)
(label i_mnspno already defined)
(label i_mnspid already defined)
(label i_mnpno already defined)
(label i_fnspno already defined)
(label i_fnspid already defined)
(label i_fnpno already defined)
(label i_hrpno already defined)
(label i_hrpid already defined)
(label i_adresp15_dv already defined)
(label i_depchl_dv already defined)
(label i_buno_dv already defined)
(label i_agegr13_dv already defined)
(label i_agegr10_dv already defined)
(label i_agegr5_dv already defined)
(label i_hhresp_dv already defined)
(label i_urban_dv already defined)
(label i_gor_dv already defined)
(label i_country already defined)
(label i_nnssib_dv already defined)
(label i_nnsib_dv already defined)
(label i_ngrp_dv already defined)
(label i_npns_dv already defined)
(label i_npn_dv already defined)
(label i_doby_dv already defined)
(label i_intdaty_dv already defined)
(label i_intdatm_dv already defined)
(label i_intdatd_dv already defined)
(label i_age_dv already defined)
(label i_sex_dv already defined)
(label i_grmpid already defined)
(label i_grfpid already defined)
(label i_pns2sex already defined)
(label i_pns2pno already defined)
(label i_pns2pid already defined)
(label i_pns1sex already defined)
(label i_pns1pno already defined)
(label i_pns1pid already defined)
(label i_pn2sex already defined)
(label i_pn2pno already defined)
(label i_pn2pid already defined)
(label i_pn1sex already defined)
(label i_pn1pno already defined)
(label i_pn1pid already defined)
(label i_mnpid already defined)
(label i_fnpid already defined)
(label i_age_if already defined)
(label i_doby_if already defined)
(label i_intdaty_if already defined)
(label i_intdatm_if already defined)
(label i_intdatd_if already defined)
(label i_ringfence already defined)
(label i_instdet_code already defined)
(label i_newentrant already defined)
(label i_region already defined)
(label i_hhlang already defined)
(label i_hglitrans already defined)
(label i_hglieng already defined)
(label i_reasref97 already defined)
(label i_reasref96 already defined)
(label i_reasref32 already defined)
(label i_reasref31 already defined)
(label i_reasref30 already defined)
(label i_reasref26 already defined)
(label i_reasref25 already defined)
(label i_reasref24 already defined)
(label i_reasref23 already defined)
(label i_reasref22 already defined)
(label i_reasref21 already defined)
(label i_reasref20 already defined)
(label i_reasref15 already defined)
(label i_reasref14 already defined)
(label i_reasref13 already defined)
(label i_reasref12 already defined)
(label i_reasref11 already defined)
(label i_reasref10 already defined)
(label i_lingua already defined)
(label i_newdad already defined)
(label i_newmum already defined)
(label i_hgadoptf already defined)
(label i_hgadoptm already defined)
(label i_hgbioad2 already defined)
(label i_hgbioad1 already defined)
(label i_hgbiof already defined)
(label i_hgbiom already defined)
(label i_livpar already defined)
(label i_pensioner already defined)
(label i_rjrflag already defined)
(label i_bedsits already defined)
(label i_purposeblt already defined)
(label i_housebun already defined)
(label i_dwltype already defined)
(label i_hhelig already defined)
(label i_respemail already defined)
(label i_respemailconf already defined)
(label i_hhemail already defined)
(label i_ctitle already defined)
(label i_newper already defined)
(label i_curstat already defined)
(label i_movctry already defined)
(label i_moveyr already defined)
(label i_movemth already defined)
(label i_lvwhy already defined)
(label i_mothr already defined)
(label i_stillres already defined)
(label i_includ already defined)
(label i_dieprisyr already defined)
(label i_dieprismth already defined)
(label i_more already defined)
(label i_ageif already defined)
(label i_nebirthy already defined)
(label i_nesex already defined)
(label i_jnyear already defined)
(label i_jnmnth already defined)
(label i_rejoinero already defined)
(label i_rejoiner already defined)
(label i_joiner already defined)
(label i_ynew already defined)
(label i_prishome already defined)
(label i_abspris already defined)
(label i_unihome already defined)
(label i_absun already defined)
(label i_birthy already defined)
(label i_dvage already defined)
(label i_sex already defined)
(label i_ivfho already defined)
(label i_ivfio already defined)
(label i_quarter already defined)
(label i_month already defined)
(label i_sampst already defined)
(label i_strata already defined)
(label i_psu already defined)
(label i_memorig already defined)
(label i_hhorig already defined)
(label pid already defined)
Result Number of obs
-----------------------------------------
Not matched 42,388
from master 42,388 (_merge==1)
from using 0 (_merge==2)
Matched 10,306 (_merge==3)
-----------------------------------------
(file temp_i.dta not found)
file temp_i.dta saved
(Substantive data from responding households)
(label j_hhorig already defined)
(label j_psu already defined)
(label j_strata already defined)
(label j_month already defined)
(label j_quarter already defined)
(label j_ivfho already defined)
(label j_hglieng already defined)
(label j_hglitrans already defined)
(label j_hhlang already defined)
(label j_ringfence already defined)
(label j_hhsize already defined)
(label j_npensioner_dv already defined)
(label j_country already defined)
(label j_gor_dv already defined)
(label j_urban_dv already defined)
(label j_hhresp_dv already defined)
(label j_hrpid already defined)
(label j_hrpno already defined)
Result Number of obs
-----------------------------------------
Not matched 2,316
from master 0 (_merge==1)
from using 2,316 (_merge==2)
Matched 47,797 (_merge==3)
-----------------------------------------
(0 observations deleted)
(label j_scflag_dv already defined)
(label j_grmpno already defined)
(label j_grfpno already defined)
(label j_mnspno already defined)
(label j_mnspid already defined)
(label j_mnpno already defined)
(label j_fnspno already defined)
(label j_fnspid already defined)
(label j_fnpno already defined)
(label j_sppno already defined)
(label j_sppid already defined)
(label j_ppno already defined)
(label j_ppid already defined)
(label j_hrpno already defined)
(label j_hrpid already defined)
(label j_rach16_dv already defined)
(label j_respf16_dv already defined)
(label j_respm16_dv already defined)
(label j_adresp15_dv already defined)
(label j_ndepchl_dv already defined)
(label j_nchild_dv already defined)
(label j_depchl_dv already defined)
(label j_buno_dv already defined)
(label j_hhtype_dv already defined)
(label j_mastat_dv already defined)
(label j_single_dv already defined)
(label j_cohab_dv already defined)
(label j_livesp_dv already defined)
(label j_agegr13_dv already defined)
(label j_agegr10_dv already defined)
(label j_agegr5_dv already defined)
(label j_hhresp_dv already defined)
(label j_urban_dv already defined)
(label j_gor_dv already defined)
(label j_country already defined)
(label j_racel_dv already defined)
(label j_ethn_dv already defined)
(label j_npensioner_dv already defined)
(label j_nnssib_dv already defined)
(label j_nnsib_dv already defined)
(label j_ngrp_dv already defined)
(label j_npns_dv already defined)
(label j_npn_dv already defined)
(label j_marstat_dv already defined)
(label j_pensioner_dv already defined)
(label j_doby_dv already defined)
(label j_intdaty_dv already defined)
(label j_intdatm_dv already defined)
(label j_intdatd_dv already defined)
(label j_age_dv already defined)
(label j_sex_dv already defined)
(label j_ff_ivlolw already defined)
(label j_hhsize already defined)
(label j_grmpid already defined)
(label j_grfpid already defined)
(label j_pns2sex already defined)
(label j_pns2pno already defined)
(label j_pns2pid already defined)
(label j_pns1sex already defined)
(label j_pns1pno already defined)
(label j_pns1pid already defined)
(label j_pn2sex already defined)
(label j_pn2pno already defined)
(label j_pn2pid already defined)
(label j_pn1sex already defined)
(label j_pn1pno already defined)
(label j_pn1pid already defined)
(label j_mnpid already defined)
(label j_fnpid already defined)
(label j_ppsex already defined)
(label j_age_if already defined)
(label j_doby_if already defined)
(label j_intdaty_if already defined)
(label j_intdatm_if already defined)
(label j_intdatd_if already defined)
(label j_origadd already defined)
(label j_ringfence already defined)
(label j_respf16 already defined)
(label j_respm16 already defined)
(label j_hgadoptf already defined)
(label j_hgadoptm already defined)
(label j_hgbiof already defined)
(label j_hgbiom already defined)
(label j_hgpart already defined)
(label j_lingua already defined)
(label j_employ already defined)
(label j_livewith already defined)
(label j_livesp already defined)
(label j_marstat already defined)
(label j_birthy already defined)
(label j_dvage already defined)
(label j_sex already defined)
(label j_ioutcome already defined)
(label j_ivfio already defined)
(label j_quarter already defined)
(label j_month already defined)
(label j_sampst already defined)
(label j_strata already defined)
(label j_psu already defined)
(label j_memorig already defined)
(label j_hhorig already defined)
(label pid already defined)
Result Number of obs
-----------------------------------------
Not matched 15,794
from master 15,794 (_merge==1)
from using 0 (_merge==2)
Matched 34,319 (_merge==3)
-----------------------------------------
(label pid already defined)
(label j_hhorig already defined)
(label j_memorig already defined)
(label j_psu already defined)
(label j_strata already defined)
(label j_sampst already defined)
(label j_ivfio already defined)
(label j_sex already defined)
(label j_dvage already defined)
(label j_ypsocweb already defined)
(label j_ypnetcht already defined)
(label j_ypnpal already defined)
(label j_ypesta already defined)
(label j_ypesti already defined)
(label j_ypestb already defined)
(label j_ypestj already defined)
(label j_ypestc already defined)
(label j_ypestk already defined)
(label j_ypeste already defined)
(label j_ypestf already defined)
(label j_ypamar already defined)
(label j_ypapar already defined)
(label j_ringfence already defined)
(label j_intdatd_if already defined)
(label j_intdatm_if already defined)
(label j_intdaty_if already defined)
(label j_doby_if already defined)
(label j_age_if already defined)
(label j_fnpid already defined)
(label j_mnpid already defined)
(label j_pn1pid already defined)
(label j_pn1pno already defined)
(label j_pn1sex already defined)
(label j_pn2pid already defined)
(label j_pn2pno already defined)
(label j_pn2sex already defined)
(label j_pns1pid already defined)
(label j_pns1pno already defined)
(label j_pns1sex already defined)
(label j_pns2pid already defined)
(label j_pns2pno already defined)
(label j_pns2sex already defined)
(label j_grfpid already defined)
(label j_grmpid already defined)
(label j_sex_dv already defined)
(label j_age_dv already defined)
(label j_intdatd_dv already defined)
(label j_intdatm_dv already defined)
(label j_intdaty_dv already defined)
(label j_doby_dv already defined)
(label j_npn_dv already defined)
(label j_npns_dv already defined)
(label j_ngrp_dv already defined)
(label j_nnsib_dv already defined)
(label j_nnssib_dv already defined)
(label j_ethn_dv already defined)
(label j_racel_dv already defined)
(label j_country already defined)
(label j_gor_dv already defined)
(label j_urban_dv already defined)
(label j_hhresp_dv already defined)
(label j_agegr5_dv already defined)
(label j_agegr10_dv already defined)
(label j_agegr13_dv already defined)
(label j_buno_dv already defined)
(label j_adresp15_dv already defined)
(label j_rach16_dv already defined)
(label j_hrpid already defined)
(label j_hrpno already defined)
(label j_fnpno already defined)
(label j_fnspid already defined)
(label j_fnspno already defined)
(label j_mnpno already defined)
(label j_mnspid already defined)
(label j_mnspno already defined)
(label j_grfpno already defined)
(label j_grmpno already defined)
Result Number of obs
-----------------------------------------
Not matched 47,607
from master 47,607 (_merge==1)
from using 0 (_merge==2)
Matched 2,506 (_merge==3)
-----------------------------------------
(label j_grmpno already defined)
(label j_grfpno already defined)
(label j_mnspno already defined)
(label j_mnspid already defined)
(label j_mnpno already defined)
(label j_fnspno already defined)
(label j_fnspid already defined)
(label j_fnpno already defined)
(label j_hrpno already defined)
(label j_hrpid already defined)
(label j_adresp15_dv already defined)
(label j_depchl_dv already defined)
(label j_buno_dv already defined)
(label j_agegr13_dv already defined)
(label j_agegr10_dv already defined)
(label j_agegr5_dv already defined)
(label j_hhresp_dv already defined)
(label j_urban_dv already defined)
(label j_gor_dv already defined)
(label j_country already defined)
(label j_nnssib_dv already defined)
(label j_nnsib_dv already defined)
(label j_ngrp_dv already defined)
(label j_npns_dv already defined)
(label j_npn_dv already defined)
(label j_doby_dv already defined)
(label j_intdaty_dv already defined)
(label j_intdatm_dv already defined)
(label j_intdatd_dv already defined)
(label j_age_dv already defined)
(label j_sex_dv already defined)
(label j_grmpid already defined)
(label j_grfpid already defined)
(label j_pns2sex already defined)
(label j_pns2pno already defined)
(label j_pns2pid already defined)
(label j_pns1sex already defined)
(label j_pns1pno already defined)
(label j_pns1pid already defined)
(label j_pn2sex already defined)
(label j_pn2pno already defined)
(label j_pn2pid already defined)
(label j_pn1sex already defined)
(label j_pn1pno already defined)
(label j_pn1pid already defined)
(label j_mnpid already defined)
(label j_fnpid already defined)
(label j_age_if already defined)
(label j_doby_if already defined)
(label j_intdaty_if already defined)
(label j_intdatm_if already defined)
(label j_intdatd_if already defined)
(label j_ringfence already defined)
(label j_instdet_code already defined)
(label j_newentrant already defined)
(label j_region already defined)
(label j_hhlang already defined)
(label j_hglitrans already defined)
(label j_hglieng already defined)
(label j_reasref97 already defined)
(label j_reasref96 already defined)
(label j_reasref32 already defined)
(label j_reasref31 already defined)
(label j_reasref30 already defined)
(label j_reasref26 already defined)
(label j_reasref25 already defined)
(label j_reasref24 already defined)
(label j_reasref23 already defined)
(label j_reasref22 already defined)
(label j_reasref21 already defined)
(label j_reasref20 already defined)
(label j_reasref15 already defined)
(label j_reasref14 already defined)
(label j_reasref13 already defined)
(label j_reasref12 already defined)
(label j_reasref11 already defined)
(label j_reasref10 already defined)
(label j_lingua already defined)
(label j_newdad already defined)
(label j_newmum already defined)
(label j_hgadoptf already defined)
(label j_hgadoptm already defined)
(label j_hgbioad2 already defined)
(label j_hgbioad1 already defined)
(label j_hgbiof already defined)
(label j_hgbiom already defined)
(label j_livpar already defined)
(label j_pensioner already defined)
(label j_rjrflag already defined)
(label j_bedsits already defined)
(label j_purposeblt already defined)
(label j_housebun already defined)
(label j_dwltype already defined)
(label j_hhelig already defined)
(label j_respemail already defined)
(label j_respemailconf already defined)
(label j_hhemail already defined)
(label j_ctitle already defined)
(label j_newper already defined)
(label j_curstat already defined)
(label j_movctry already defined)
(label j_moveyr already defined)
(label j_movemth already defined)
(label j_lvwhy already defined)
(label j_mothr already defined)
(label j_stillres already defined)
(label j_includ already defined)
(label j_dieprisyr already defined)
(label j_dieprismth already defined)
(label j_more already defined)
(label j_ageif already defined)
(label j_nebirthy already defined)
(label j_nesex already defined)
(label j_jnyear already defined)
(label j_jnmnth already defined)
(label j_rejoinero already defined)
(label j_rejoiner already defined)
(label j_joiner already defined)
(label j_ynew already defined)
(label j_prishome already defined)
(label j_abspris already defined)
(label j_unihome already defined)
(label j_absun already defined)
(label j_birthy already defined)
(label j_dvage already defined)
(label j_sex already defined)
(label j_ivfho already defined)
(label j_ivfio already defined)
(label j_quarter already defined)
(label j_month already defined)
(label j_sampst already defined)
(label j_strata already defined)
(label j_psu already defined)
(label j_memorig already defined)
(label j_hhorig already defined)
(label pid already defined)
Result Number of obs
-----------------------------------------
Not matched 40,554
from master 40,554 (_merge==1)
from using 0 (_merge==2)
Matched 9,559 (_merge==3)
-----------------------------------------
(file temp_j.dta not found)
file temp_j.dta saved
.
. // open the file for the first wave (wave a_)
. local firstWave = substr("`allWaves'", 1, 1)
. use temp_`firstWave', clear
(Substantive data from responding households)
.
. // loop through the remaining waves appending them in the long format
. local remainingWaves = substr("`allWaves'", 3, .)
.
. foreach w in `remainingWaves' {
2. // append the files for the second wave onwards
. append using temp_`w'
3. }
.
. // check how many observations are available from each wave
. tab wavename
wavename | Freq. Percent Cum.
------------+-----------------------------------
8 | 56,608 35.51 35.51
9 | 52,694 33.05 68.56
10 | 50,113 31.44 100.00
------------+-----------------------------------
Total | 159,415 100.00
.
. // move pidp to the beginning of the file
. order pidp, first
.
. // save the long file
. save "$outputpath/`outputfilename'", replace
file D:\USF\issues\2066/UKHLS_2066.dta saved
.
. // erase temporary files
. foreach w in `allWaves' {
2. erase temp_`w'.dta
3. }
.
end of do-file
. log close
name:
log: D:\USF\issues\2066\2066.log
log type: text
closed on: 7 Mar 2024, 21:23:18
----------------------------------------------------------------------------------