Project

General

Profile

Support #2107 » wave 6 query.do

Saddaf Naaz Akhtar, 05/17/2024 02:24 PM

 
cd "path to the working folder"
global datain "path to the data"
foreach w in a b c d e f g h i j k l m{
use "$datain/ukhls/`w'_indresp", clear
isvar pidp ?_jbhas ?_jbsemp ?_jbstat ?_jbpen ?_jbpenm ?_age_dv ?_ethn_dv ?_sex_dv ?_jboff
keep `r(varlist)'
rename `w'_* *
gen wave=strpos("abcdefghijklmnopqrstuvwxyz","`w'")
save `w', replace
}

use a, clear

foreach w in b c d e f g h i j k l m{
append using `w'
}


isid pidp wave

// save the long file
save xyz, replace


keep if age_dv>=45 & age_dv<=64
ta sex_dv,m

drop if sex_dv<1

/// Did paid work last week ??

ta jbhas,m

//(drop the missing/proxy/dontknow/ observations )
drop if jbhas<1
recode jbhas (1=1 "Yes") (2=0 "No"),g(paid_work)
keep if paid_work==1
*****************paid work last week (if you are an employee)
recode jbsemp (1=1 "employee") (else=0 "Not"),g(empl)

keep if empl==1

***Does your present employer offer a pension scheme for which you are eligible?
recode jbpen (1=1 "Yes") (else=0 "No"),g(pension_scheme_runs)

recode ethn_dv (1=0 "White") (2/4=1 "Otherwhite") (9=2 "Indian") (10=3 "Pakistani") (11=4 "Bangladeshi") (12=5 "Chinese") (14/16=6 "Black") (5/8=7 "Mixed") (else =8 "Arabs&otherAsian"),gen (ethnic)

byso sex_dv: ta ethnic pension_scheme_runs, r nof chi2




(3-3/7)