*Change the path to be the one where you keep your main files and folders for this project global path "C:\Users\jwang\Desktop\Working local files\NHATS" *********************************************************** *** NHATS OP Variables for CAN-D *** *** Created by: Jessie Wang *** *** Updated: 12/5/2023 *** *** Data requested: *** *** - NHATS public OP: 2011 - 2023 (Beta) *** *********************************************************** clear all set maxvar 40000 set more off global Round1 "${path}\raw data files\NHATS_Round_1_OP_File_v2.dta" global Round2 "${path}\raw data files\NHATS_Round_2_OP_File_v2.dta" global Round3 "${path}\raw data files\NHATS_Round_3_OP_File.dta" global Round4 "${path}\raw data files\NHATS_Round_4_OP_File.dta" global Round5 "${path}\raw data files\NHATS_Round_5_OP_File_V2.dta" global Round6 "${path}\raw data files\NHATS_Round_6_OP_File_V2.dta" global Round7 "${path}\raw data files\NHATS_Round_7_OP_File.dta" global Round8 "${path}\raw data files\NHATS_Round_8_OP_File.dta" global Round9 "${path}\raw data files\NHATS_Round_9_OP_File.dta" global Round10 "${path}\raw data files\NHATS_Round_10_OP_File.dta" global Round11 "${path}\raw data files\NHATS_Round_11_OP_File.dta" global Round12 "${path}\raw data files\NHATS_Round_12_OP_File.dta" local nhats_op_all round spid opid paidhelpr relatnshp /* caregiver relationship */ eathlp bathhlp toilhlp dreshlp medshlp dochlp insurhlp outhlp insdhlp bedhlp launhlp shophlp mealhlp bankhlp moneyhlp /* help provided (HCBS/paid caregiving measures) */ helpsched numdayswk numdaysmn numhrsday /* frequency of paid care */ sppayshlp govpayhlp inspayhlp othpayhlp progmpaid // sources of payment for paid care /////////////////////////////////////////////////// /// NHATS OP 2011-2023: by SPID /// /////////////////////////////////////////////////// foreach num of numlist 1/12 { use "${Round`num'}", clear rename op`num'* * gen round=`num' ** Correct cross-wave differences /*if round == 1 | round == 5 | round == 12 { rename rl`num'* * rename ia`num'* * } else if round == 3 | round == 7 | round == 9 | round == 11 { rename ia`num'* * } * keep variables * correct cross-wave differences if round == 12 { rename dhigstschl higstschl } */ * saving short data if round == 1 { keep `nhats_op_all' tab round save "${path}\raw data files\NHATS_OP_short.dta", replace } else if round >= 2 { keep `nhats_op_all' append using NHATS_OP_short sort spid opid round tab round save "${path}\raw data files\NHATS_OP_short.dta", replace } } * recode government programs that paid for help gen medicaidpaid = 0 replace medicaidpaid = 1 if progmpaid == 1 gen medicarepaid = 0 replace medicarepaid = 1 if progmpaid == 2 gen stateprogpaid = 0 replace stateprogpaid = 1 if progmpaid == 3 gen otherprogpaid = 0 replace otherprogpaid = 1 if progmpaid == 3 * collapse data by spid replace paidhelpr = . if paidhelpr <= 0 replace paidhelpr = 0 if paidhelpr == 2 drop if paidhelpr == . foreach var in eathlp bathhlp toilhlp dreshlp medshlp dochlp insurhlp outhlp insdhlp bedhlp launhlp shophlp mealhlp bankhlp moneyhlp { replace `var' = 0 if `var' <= 0 gen `var'_paid = 0 gen `var'_unpaid = 0 replace `var'_paid = `var' if paidhelpr == 1 replace `var'_unpaid = `var' if paidhelpr == 0 } foreach var in numdayswk numdaysmn numhrsday { replace `var' = . if `var' <= -1 gen `var'_paid = 0 gen `var'_unpaid = 0 replace `var'_paid = `var' if paidhelpr == 1 replace `var'_unpaid = `var' if paidhelpr == 0 } foreach var in sppayshlp govpayhlp inspayhlp othpayhlp medicaidpaid medicarepaid stateprogpaid otherprogpaid { replace `var' = . if `var' <= -1 replace `var' = 0 if `var' == 2 gen `var'_paid = 0 gen `var'_unpaid = 0 replace `var'_paid = `var' if paidhelpr == 1 replace `var'_unpaid = `var' if paidhelpr == 0 } gen paid_helper_count = 0 gen unpaid_helper_count = 0 replace paid_helper_count = 1 if paidhelpr == 1 replace unpaid_helper_count = 1 if paidhelpr == 0 sort spid round by spid: egen max_numdayswk_paid = max(numdayswk_paid) by spid: egen max_numdayswk_unpaid = max(numdayswk_unpaid) by spid: egen max_numdaysmn_paid = max(numdaysmn_paid) by spid: egen max_numdaysmn_unpaid = max(numdaysmn_unpaid) by spid: egen max_numhrsday_paid = max(numhrsday_paid) by spid: egen max_numhrsday_unpaid = max(numhrsday_unpaid) collapse (sum) paid_helper_count unpaid_helper_count *hlp_paid *hlp_unpaid *paid_paid *paid_unpaid (mean) num*_paid num*_unpaid max*, by(spid round) label variable paid_helper_count "Number of paid helpers" label variable unpaid_helper_count "Number of unpaid helpers" label variable eathlp_paid "No. of paid helpers helped with eating" label variable bathhlp_paid "No. of paid helpers helped with bathing" label variable toilhlp_paid "No. of paid helpers helped with toileting" label variable dreshlp_paid "No. of paid helpers helped with dressing" label variable medshlp_paid "No.of paid helpers helped with medicine" label variable dochlp_paid "No. of paid helpers helped with doctor's visit" label variable insurhlp_paid "No. of paid helpers helped with insurance decisions" label variable outhlp_paid "No. of paid helpers helped with going outside" label variable insdhlp_paid "No. of paid helpers helped with getting around inside" label variable bedhlp_paid "No. of paid helpers helped with getting out of bed" label variable launhlp_paid "No. of paid helpers helped with laundry" label variable shophlp_paid "No. of paid helpers helped with shopping" label variable mealhlp_paid "No. of paid helpers helped with meal prep" label variable bankhlp_paid "No. of paid helpers helped with banking" label variable moneyhlp_paid "No. of paid helpers helped with money matters" label variable numdayswk_paid "Average number of days a week paid helpers helped" label variable numdaysmn_paid "Average number of days a month paid helpers helped" label variable numhrsday_paid "Average number of hours a day paid helpers helped" label variable max_numdayswk_paid "Highest of days a week a paid helper helped" label variable max_numdaysmn_paid "Highest number of days a month a paid helper helped" label variable max_numhrsday_paid "Highest number of hours a day a paid helper helped" label variable sppayshlp_paid "No. of paid helpers SP paid for" label variable govpayhlp_paid "No. of paid helpers government programs paid for" label variable inspayhlp_paid "No. of paid helpers insurance paid for" label variable othpayhlp_paid "No. of paid helpers other sources paid for" label variable inspayhlp_paid "No. of paid helpers insurance paid for" label variable medicaidpaid_paid "No. of paid helpers Medicaid paid for" label variable medicarepaid_paid "No. of paid helpers Medicare paid for" label variable stateprogpaid_paid "No. of paid helpers state programs paid for" label variable otherprogpaid_paid "No. of paid helpers other government programs paid for" label variable eathlp_unpaid "No. of unpaid helpers helped with eating" label variable bathhlp_unpaid "No. of unpaid helpers helped with bathing" label variable toilhlp_unpaid "No. of unpaid helpers helped with toileting" label variable dreshlp_unpaid "No. of unpaid helpers helped with dressing" label variable medshlp_unpaid "No.of unpaid helpers helped with medicine" label variable dochlp_unpaid "No. of unpaid helpers helped with doctor's visit" label variable insurhlp_unpaid "No. of unpaid helpers helped with insurance decisions" label variable outhlp_unpaid "No. of unpaid helpers helped with going outside" label variable insdhlp_unpaid "No. of unpaid helpers helped with getting around inside" label variable bedhlp_unpaid "No. of unpaid helpers helped with getting out of bed" label variable launhlp_unpaid "No. of unpaid helpers helped with laundry" label variable shophlp_unpaid "No. of unpaid helpers helped with shopping" label variable mealhlp_unpaid "No. of unpaid helpers helped with meal prep" label variable bankhlp_unpaid "No. of unpaid helpers helped with banking" label variable moneyhlp_unpaid "No. of unpaid helpers helped with money matters" label variable numdayswk_unpaid "Average number of days a week unpaid helpers helped" label variable numdaysmn_unpaid "Average number of days a month unpaid helpers helped" label variable numhrsday_unpaid "Average number of hours a day unpaid helpers helped" label variable max_numdayswk_unpaid "Highest of days a week an unpaid helper helped" label variable max_numdaysmn_unpaid "Highest number of days an month a unpaid helper helped" label variable max_numhrsday_unpaid "Highest number of hours a day an unpaid helper helped" label variable sppayshlp_unpaid "No. of unpaid helpers SP unpaid for" label variable govpayhlp_unpaid "No. of unpaid helpers government programs unpaid for" label variable inspayhlp_unpaid "No. of unpaid helpers insurance unpaid for" label variable othpayhlp_unpaid "No. of unpaid helpers other sources unpaid for" label variable inspayhlp_unpaid "No. of unpaid helpers insurance unpaid for" label variable medicaidpaid_unpaid "No. of unpaid helpers Medicaid paid for" label variable medicarepaid_unpaid "No. of unpaid helpers Medicare paid for" label variable stateprogpaid_unpaid "No. of unpaid helpers state programs paid for" label variable otherprogpaid_unpaid "No. of unpaid helpers other government programs paid for" sort spid round save "${path}\raw data files\NHATS_OP_merge.dta", replace