/****************************************************************************** Program: HRS_variables.do Purpose: Pulls relevant demographic, dementia, and caregiving variables from HRS, RAND HRS, and HRS-researcher-contributed data sets and combines them into one file and transforms from wide to long format. Created: 10/10/2024 Input Datasets: - RAND HRS Longitudinal File 2020 (V2) (https://hrsdata.isr.umich.edu/data-products/rand-hrs-longitudinal-file-2020) - RAND HRS Family Data 2018 (V2) (https://hrsdata.isr.umich.edu/data-products/rand-hrs-family-data-2018) - RAND HRS Detailed Imputations 2020 (V2) (https://hrsdata.isr.umich.edu/data-products/rand-hrs-detailed-imputations-file-2020) - Langa-Weir Classification of Cognitive Function (1995-2020) (https://hrsdata.isr.umich.edu/data-products/langa-weir-classification-cognitive-function-1995-2020) Note: To run, update relevent paths and code as needed wherever you see "UPDATE HERE" in the comments. *******************************************************************************/ clear all *version 17.1 // Created and tested on Stata version 17.1 (Linux) set maxvar 20000 set more off cap log close log using "HRS_variables.log", replace ************************************ **** DATA LOCATIONS ***** ************************************ /*UPDATE HERE: Change the paths to where you are storing these datasets. - Assign the data folder to where you want the output dataset to be. - If working in the ENCLAVE, these files are available in a subfolder of contributed files in the public HRS data folder. - If downloading the input data from HRS's website, use the links in the header above. */ global data "/update/here" global randhrs "/update/here" global randimp "/update/here" global randfam "/update/here" global langaweir "/update/here" ************************************ **** INPUT DATASET NAMES ***** ************************************ /*POSSIBLY UPDATE HERE: update the input dataset names if they have been updated since this code release. - If the datasets have been updated since this code release, find the updated versions here: - RAND HRS Data Files: https://hrsdata.isr.umich.edu/data-products/rand - Langa-Weir Classification of Cognitive Function: https://hrsdata.isr.umich.edu/data-products/contributed-projects */ global randhrsdata "randhrs1992_2020v2.dta" global randimpdata "randhrsimp1992_2020v2.dta" global randfamdata "randhrsfamr1992_2018v2.dta" global langaweirdata "cogfinalimp_9520wide.dta" ************************************ **** YEAR AND WAVE REFERENCES ***** ************************************ local years = "dum1 dum2 dum3 1998 2000 2002 2004 2006 2008 2010 2012 2014 2016 2018 2020" // POSSIBLY UPDATE HERE: If new wave of data is available. local maxwv = "15" // POSSIBLY UPDATE HERE: if new wave of data is available. (Maxwv=15 corresponds with 2020, maxwv=16 corresponds with 2022, etc.) ***************************************************************************** ***************************************************************************** * PREP AND MERGE INPUT DATASETS * ***************************************************************************** ***************************************************************************** ************************************ *** RAND HRS LONGITUDINAL FILE ***** ************************************ use hhidpn hhid pn /*IDs*/ /// /*DEMOGRAPHICS*/ /// r*agey_e /*Age at interview*/ /// rabyear /*Birth year*/ /// radage_y /*Age at death*/ /// radyear /*Death year*/ /// raracem /*Race*/ /// rahispan /*Whether Hispanic*/ /// raeduc /*Education (summary)*/ /// raedegrm /*Highest Edu Degree*/ /// r*mstat /*Marital Status*/ /// h*cpl /*Coupled Household Indicator*/ /// r*govmd /*Has Medicaid*/ /// r*hiltc /*Has Long-Term Care Insurance*/ /// r*tyltc /*Type of Long-Term Care Insurance*/ /// r*lbrfh /*Labor Force Status*/ /// r*jyears /*Total years worked*/ /// r*work /*Curently working for pay*/ /// h*hhres /*Number of people in HH*/ /// raevbrn /*Number of children ever born*/ /// h*itot /*Total household income (R+S)*/ /// h*inpov /*Whether in poverty*/ /// h*inpovr /*Ratio HH Income to poverty threshold*/ /// h*povhhi /*HH Inc to check poverty. Includes all HH members*/ /// h*atotb /*Total household wealth*/ /// /*WEIGHTS AND SAMPLE VARIABLES*/ /// inw* /*Responded in current wave*/ /// rexitwv /*Wave Exit Interview was Administered*/ /// hacohort /*Sample Cohort*/ /// r*wthh /*Household analysis weight*/ /// r*wtresp /*Person-level analysis weight*/ /// r*wtcrnh /*Combined respondent and Nursing home weight*/ /// r*lbwgtr /*Weight for LB Psychosocial Survey*/ /// /*LIVING ARRAINGEMENTS*/ /// r*nhmliv /*Lives in NH at time of IW.*/ /// /*UNPAID CAREGIVING MEASURES*/ /// r*hlpdysu /*Days unpaid helpers helped last month*/ /// r*hlphrsu /*Hours unpaid helpers helped last month*/ /// r*hlprun /*Number of unpaid helpers who helped last month*/ /// r*inhpun /*Number of unpaid helpers who ever helped*/ /// /*PAID CAREGIVING MEASURES*/ /// r*hlprpn /*Number of paid helpers who helped last month*/ /// r*inhppn /*Number of paid helpers who ever helped*/ /// r*inhpe /*Any employee of institution ever helped*/ /// /*AMOUNT/FREQUENCY OF PAID CARE*/ /// r*hlpdysp /*Days paid helpers helped last month*/ /// r*hlphrsp /*Hours paid helpers helped last month*/ /// r*hlppdtn /*Total number of helpers paid to help*/ /// r*hlppdta /*Total amount helpers were paid last month*/ /// r*hosp /*Hospital stay indicator, previous 2 years*/ /// r*hspnit /*Number of nights in hospital, previous 2 years*/ /// r*hsptim /*Number of hospital stays, previous 2 years*/ /// r*nrshom /*Nursing Home stay indicator, previous 2 years*/ /// r*nrsnit /*Number of nights in nursing home, previous 2 years*/ /// r*nrstim /*Number of nursing home stays, previous 2 years*/ /// r*homcar /*Home health care indicator, previous 2 years*/ /// r*oopmd /*MedExp: Total OOP amount paid, previous 2 years*/ /// r*oopmdf /*MedExp: imputation flag for total OOP amount*/ /// r*oopmdo /*MedExp: Tot OOP amt paid w/ other, previous 2 years*/ /// r*oopmdof /*MedExp: imputation flag for tot OOP w/ other amount*/ /// /*COGNITIVE FUNCTION MEASURES*/ /// r*cog27 /*27-point cognition summary score*/ /// r*cogtot /*Total cognition summary score (age 65+)*/ /// r*cogtotp /*Total cognition summary score (age 65+, FTF/TEL)*/ /// /*Proxy:*/ /// r*prmem /*Proxy rating of respondent's memory*/ /// r*prchmem /*Proxy rating of respondent's change in memory*/ /// r*lost /*Respondent gets lost in familiar environments*/ /// r*wander /*Respondent ever wanders off*/ /// r*alone /*Respondent can be left alone*/ /// r*haluc /*Respondent hallucinates*/ /// /*PHYSICAL FUNCTION MEASURES*/ /// r*walkra /*Any difficulty walking across room*/ /// r*dressa /*Any difficulty dressing*/ /// r*batha /*Any difficulty bathing, showering*/ /// r*eata /*Any difficulty eating*/ /// r*beda /*Any difficulty getting in/out bed*/ /// r*toilta /*Any difficulty toileting*/ /// r*adl6a /*Any difficulty (summary of ADLs)*/ /// r*phonea /*Any difficulty using a phone*/ /// r*moneya /*Any difficulty managing money*/ /// r*medsa /*Any difficulty taking medications*/ /// r*shopa /*Any difficulty grocery shopping*/ /// r*mealsa /*Any difficulty preparing hot meals*/ /// r*iadl5a /*Any difficulty (summary of IADLs)*/ /// r*walksa /*Any difficulty walking several blocks*/ /// r*joga /*Any difficulty jogging one mile*/ /// r*walk1a /*Any difficulty walking one block*/ /// r*sita /*Any difficulty sitting for 2 hours*/ /// r*chaira /*Any difficulty getting up from a chair*/ /// r*climsa /*Any difficulty climbing several flights of stairs*/ /// r*clim1a /*Any difficulty climbing one flight of stairs*/ /// r*lifta /*Any difficulty lifting/carrying 10 pounds*/ /// r*stoopa /*Any difficulty stooping, kneeling, or crouching*/ /// r*armsa /*Any difficulty reaching arms above shoulder*/ /// r*pusha /*Any difficulty pushing or pulling large objects*/ /// r*dimea /*Any difficulty picking up a dime*/ /// /*HELP WITH PHYSICAL FUNCTIONS (ADLs/IADLs)*/ /// r*walkrh /*Gets help walking across room*/ /// r*dressh /*Gets help dressing*/ /// r*bathh /*Gets help bathing, showering*/ /// r*eath /*Gets help eating*/ /// r*bedh /*Gets help getting in/out bed*/ /// r*toilth /*Gets help toileting*/ /// r*adl6h /*Gets help (summary of ADLs)*/ /// r*phoneh /*Gets help using a phone*/ /// r*moneyh /*Gets help managing money*/ /// r*medsh /*Gets help taking medications*/ /// r*shoph /*Gets help grocery shopping*/ /// r*mealsh /*Gets help preparing hot meals*/ /// r*iadl5h /*Gets help (summary of IADLs)*/ /// /*HEALTH STATUS*/ /// r*shlt /*Self-report of health*/ /// r*hltc3 /*Self-report of health change*/ /// r*hibpe /*Ever had high blood pressure*/ /// r*diabe /*Ever had diabetes*/ /// r*cancre /*Ever had cancer*/ /// r*lunge /*Ever had lung disease*/ /// r*hearte /*Ever had heart problems*/ /// r*stroke /*Ever had stroke*/ /// r*psyche /*Ever had psych problems*/ /// r*arthre /*Ever had arthritis*/ /// r*sleepe /*Ever had sleep disorder*/ /// r*memrye /*Ever had memory problem*/ /// r*alzhee /*Ever had Alzheimers*/ /// r*demene /*Ever had dementia*/ /// r*depres /*Felt depressed*/ /// r*cesd /*CESD score*/ /// r*lblonely3 /*Loneliness 3-item scale*/ /// r*lblonely11 /*Loneliness 11-item scale*/ /// r*lbonchrstr /*Ongoing Chronic Stress Scale*/ /// r*lbposaffect /*Positive affect scale*/ /// r*lbnegaffect /*Negative affect scale*/ /// r*lbsatwlf /*Life satisfaction scale*/ /// using "$randhrs/$randhrsdata" sort hhidpn drop re*death /// drop 3 vars added from using r*eath wildcard above save "$data/randhrs.dta", replace **************************************** ** RAND HRS DETAILED IMPUTATIONS FILE ** **************************************** use hhidpn /*IDs*/ /// /*MEDICAL EXPENDITURES*/ /// r*mhosp /*MedExp Amt: Hospital Stays, prv 2 yrs.*/ /// r*fhosp /*MedExp Flag: imputation flag for hospital stays*/ /// r*mnhm /*MedExp Amt: Nursing Home, prv 2 yrs.*/ /// r*fnhm /*MedExp Flag: imputation flag for nursing home*/ /// r*mhhc /*MedExp Amt: Home health care, prv 2 yrs.*/ /// r*fhhc /*MedExp Flag: imputation flag for HHC*/ /// r*mspec /*MedExp Amt: Spec. Hlth Fac and Services, prv 2 yrs.*/ /// r*fspec /*MedExp Flag: imp flag for Spec. Hlth Fac and Services*/ /// r*mhcsp /*MedExp Amt: HHC/Spec Fac/Serv, prv 2 yrs.*/ /// r*fhcsp /*MedExp Flag: imputation flag for HHC/Spec Fac/Serv*/ /// remchspc /*MedExp Amt: Hospice care in facility (Exit IW only)*/ /// refchspc /*MedExp Flag: imp flag for Hospice care in facility*/ /// remahspc /*MedExp Amt: Hospice care in any loc (Exit IW only)*/ /// refahspc /*MedExp Flag: imp flag for Hospice care in any loc*/ /// using "$randimp/$randimpdata" sort hhidpn save "$data/randimp.dta", replace ********************************* ***** RAND FAMILY DATASET ******* ********************************* use hhidpn /*IDs*/ /// /*HELP FROM CHILDREN*/ /// r*hlpadlkn /*Number of children who help with ADLs*/ /// r*hlpiadlkn /*Number of children who help with IADLs*/ /// r*hlpmoneykn /*Number of children who help manage finances*/ /// r*hlpchrkn /*Number of children who help with chores and errands*/ /// r*hltcstkn /*Number of children who help with health care costs*/ /// using "$randfam/$randfamdata" sort hhidpn save "$data/randfam.dta", replace ********************************** ** LANGA-WEIR COGNITION DATASET ** ********************************** use hhid pn /*IDs*/ /// /*DEMENTIA MEASURES*/ /// cogfunction* /*Cognition Category: 1=Normal, 2=CIND, 3=Demented*/ /// /*COGNITIVE FUNCTION MEASURES*/ /// prxyscore_imp* /*Total: Proxy Score (<2000 0-9; >=2000 0-11)*/ /// imparate_imp* /*Interviewer assessment of Respondent's cognition*/ /// memoryp_imp* /*Proxy Assessment of Memory*/ /// using "$langaweir/$langaweirdata" //Add value labels before rename label def cind 1 "1. Normal" 2 "2. CIND" 3 "3. Demented" .q ".q=not asked this wave" label val cogfunction* cind ** RENAME FROM YEARS TO WAVES ** local vars = "cogfunction prxyscore_imp memoryp_imp" // variable prefixes (not including imparate) // Handle Wave 3 (1995 and 1996) separately foreach var in `vars' { clonevar r3`var' = `var'1995 replace r3`var' = `var'1996 if missing(r3`var') } //Rename Waves 4 forward // Loop through each year and variable to rename for 1998/W4 forward. foreach var in `vars' { forval w = 4/`maxwv' { local year : word `w' of `years' rename `var'`year' r`w'`var' } } // Handle imparate_imp separately due to different years (Available 2000/W5 forward) forval w = 5/`maxwv' { local year : word `w' of `years' rename imparate_imp`year' r`w'imparate_imp } sort hhid pn keep hhid pn r* save "$data/langaweir.dta", replace ********************************* ****** MERGE ******* ********************************* use "$data/randhrs.dta" //Use RAND HRS Longitudinal File as a base. merge 1:1 hhidpn using "$data/randimp.dta" drop if _merge==2 drop _merge merge 1:1 hhidpn using "$data/randfam.dta" drop if _merge==2 drop _merge sort hhid pn merge 1:1 hhid pn using "$data/langaweir.dta" drop if _merge==2 drop _merge sort hhidpn label data "HRS vars on dementia, caregiving, and demog for CAN-D (Wide Format)" save "$data/hrs_cand_wide.dta", replace ***************************************************************************** ***************************************************************************** * RESHAPE WIDE TO LONG * ***************************************************************************** ***************************************************************************** local reshapevars "r@mstat h@cpl r@wthh r@wtresp r@wtcrnh r@shlt r@hltc3 r@depres r@cesd r@sleepe r@hibpe r@diabe r@cancre r@lunge r@hearte r@stroke r@psyche r@arthre r@memrye r@alzhee r@demene r@cogtot r@cog27 r@hosp r@nrshom r@homcar r@hsptim r@nrstim r@hspnit r@nhmliv r@nrsnit r@oopmd r@oopmdf r@prmem r@prchmem r@lost r@wander r@alone r@haluc r@govmd r@hiltc r@tyltc r@lbrfh r@jyears r@work h@hhres h@itot h@povhhi h@inpov h@inpovr h@atotb r@walkra r@dressa r@batha r@eata r@beda r@toilta r@mealsa r@shopa r@moneya r@phonea r@medsa r@walksa r@joga r@walk1a r@sita r@chaira r@climsa r@clim1a r@lifta r@stoopa r@armsa r@pusha r@dimea r@adl6a r@iadl5a r@walkrh r@dressh r@bathh r@eath r@bedh r@toilth r@phoneh r@moneyh r@medsh r@shoph r@mealsh r@adl6h r@iadl5h r@hlpadlkn r@hlpiadlkn r@hlpmoneykn r@hlpchrkn r@hltcstkn r@memoryp_imp r@imparate_imp r@prxyscore_imp r@cogfunction r@agey_e r@oopmdo r@oopmdof r@inhpe r@inhpun r@hlprun r@hlpdysu r@hlphrsu r@inhppn r@hlprpn r@hlpdysp r@hlphrsp r@hlppdta r@hlppdtn r@lbwgtr r@lblonely3 r@lblonely11 r@lbonchrstr r@lbposaffect r@lbnegaffect r@lbsatwlf r@fhosp r@fnhm r@fhhc r@fspec r@mhosp r@mhhc r@mspec r@mnhm r@fhcsp r@mhcsp" rename r14cogtotp r14cogtot //Standardize for long version. rename r15cogtotp r15cogtot //Note: W14 and W15 cogtot only available for FTF/TEL (not web) *Standardize W2 values for these variables to align with later waves: * (Previously, 1=yes, occasionally. 2=yes, some of the time. 3=yes, most of the time. Recoding so 1-3 values all assigned 1=yes.) foreach w2var in r2walkrh r2dressh r2bathh r2eath r2bedh r2toilth { replace `w2var'= 1 if `w2var' ==2 replace `w2var'= 1 if `w2var' ==3 } ** RESHAPE ** reshape long inw `reshapevars', i(hhidpn) j(wave) generate year = 1992 + 2 * (wave - 1) //Create corresponding year variable to wave. NOTE: Wave 2=1994 for all obs, even those that are 1993. (Same with W3 and 1996 vs 1995). Use HACOHORT if differentiation is desired keep if inw==1 // Only keep observations for Respondents in each wave. // Manually create labels for each variable after reshape. label var inw "inw: respondent current wave" label var year "year" label var wave "wave" label var rmstat "rmstat: r marital status" label var hcpl "hcpl: whether couple hhold" label var rwthh "rwthh: household analysis weight" label var rwtresp "rwtresp: person-level analysis weight" label var rwtcrnh "rwtcrnh: combined respondent weight and nurshm resident weight" label var rshlt "rshlt: self-report of health" label var rhltc3 "rhltc3: self-report of health change" label var rdepres "rdepres: cesd: felt depressed" label var rcesd "rcesd: cesd score" label var rsleepe "rsleepe: r ever had sleep disorder" label var rhibpe "rhibpe: r ever had high blood pressure" label var rdiabe "rdiabe: r ever had diabetes" label var rcancre "rcancre: r ever had cancer" label var rlunge "rlunge: r ever had lung disease" label var rhearte "rhearte: r ever had heart problems" label var rstroke "rstroke: r ever had stroke" label var rpsyche "rpsyche: r ever had psych problems" label var rarthre "rarthre: r ever had arthritis" label var rmemrye "rmemrye: r ever had memory problem" label var ralzhee "ralzhee: r ever reported Alzheimer" label var rdemene "rdemene: r ever reported dementia" label var rcogtot "rcogtot: total cognition summary score" label var rcog27 "rcog27: 27-point cognition summary score" label var rhosp "rhosp: hospital stay, previous 2 years" label var rnrshom "rnrshom: nursing home stay, previous 2 years" label var rhomcar "rhomcar: home health care, previous 2 years" label var rhsptim "rhsptim: number of hospital stays, previous 2 years" label var rnrstim "rnrstim: number of nursing home stays, previous 2 years" label var rhspnit "rhspnit: number of nights in hospital, previous 2 years" label var rnhmliv "rnhmliv: live in nursing home at interview" label var rnrsnit "rnrsnit: number of nights in nursing home, previous 2 years" label var roopmd "roopmd: mexp amt: out of pocket medical expense, previous 2 years" label var roopmdf "roopmdf: mexp flag: out of pocket imputed" label var rprmem "rprmem: rate r memory" label var rprchmem "rprchmem: rate r change in memory" label var rlost "rlost: r lost in familiar environments" label var rwander "rwander: r ever wander off" label var ralone "ralone: r can be left alone" label var rhaluc "rhaluc: r hallucinates" label var rgovmd "rgovmd: r has gov plan-medicaid" label var rhiltc "rhiltc: r has long term care ins" label var rtyltc "rtyltc: r type of long term care ins" label var rwork "rwork: r working for pay" label var rlbrfh "rlbrfh: labor force status, no week restriction" label var rjyears "rjyears: r years worked/self-report+jobh" label var hhhres "hhhres: number of people in hh" label var hitot "hitot: income: total household / r+sp only" label var hpovhhi "hpovhhi: hh inc to check poverty" label var hinpov "hinpov: whether in poverty" label var hinpovr "hinpovr: ratio hh inc: poverty threshold" label var hatotb "hatotb: total of all assets--cross-wave" label var rwalkra "rwalkra: r any diff-walk across room" label var rdressa "rdressa: r any diff-dressing" label var rbatha "rbatha: r any diff-bathing, shower" label var reata "reata: r any diff-eating" label var rbeda "rbeda: r any diff-get in/out bed" label var rtoilta "rtoilta: r any diff-using the toilet" label var rmealsa "rmealsa: r any diff-prepare hot meal" label var rshopa "rshopa: r any diff-shop for grocery" label var rmoneya "rmoneya: r any diff-managing money" label var rphonea "rphonea: r any diff-use telephone" label var rmedsa "rmedsa: r any diff-take medications" label var rwalksa "rwalksa: r any diff-walk several blocks" label var rjoga "rjoga: r any diff-jog one mile" label var rwalk1a "rwalk1a: r any diff-walk one block" label var rsita "rsita: r any diff-sit for 2 hours" label var rchaira "rchaira: r any diff-get up from chair" label var rclimsa "rclimsa: r any diff-climb several flights of stairs" label var rclim1a "rclim1a: r any diff-climb 1 flight of stairs" label var rlifta "rlifta: r any diff-lift/carry 10lbs" label var rstoopa "rstoopa: r any diff-stoop/kneel/crouch" label var rarmsa "rarmsa: r any diff-reach/extend arms up" label var rpusha "rpusha: r any diff-push/pull large object" label var rdimea "rdimea: r any diff-pick up a dime" label var radl6a "radl6a: any diff-sum of adls /0-6" label var riadl5a "riadl5a: any diff-sum of iadls /0-5" label var rwalkrh "rwalkrh: r gets help-walk across room" label var rdressh "rdressh: r gets help-dressing" label var rbathh "rbathh: r gets help-bathing, showering" label var reath "reath: r gets help-eating" label var rbedh "rbedh: r gets help-get in/out of bed" label var rtoilth "rtoilth: r gets help-using the toilet" label var rphoneh "rphoneh: r gets help-use telephone" label var rmoneyh "rmoneyh: r gets help-managing money" label var rmedsh "rmedsh: r gets help-take medications" label var rshoph "rshoph: r gets help-shop for groceries" label var rmealsh "rmealsh: r gets help-preparing hot meals" label var radl6h "radl6h: r gets help-sum of adls /0-6" label var riadl5h "riadl5h: r gets help-sum of iadls /0-5" label var rhlpadlkn "rhlpadlkn: number of children help w/adls" label var rhlpiadlkn "rhlpiadlkn: number of children help w/iadls" label var rhlpmoneykn "rhlpmoneykn: number of children help w/finances" label var rhlpchrkn "rhlpchrkn: number of children help w/chores & errands" label var rhltcstkn "rhltcstkn: number of children help w/ health care cost" label var ragey_e "ragey_e: r age (years) at ivw endmon" label var roopmdo "roopmdo: mexp amt: out of pkt med exp w oth" label var roopmdof "roopmdof: mexp flag: out of pkt w oth imputed" label var rinhpe "rinhpe: any employee of institution ever helped" label var rinhpun "rinhpun: number of unpaid helpers ever helped" label var rhlprun "rhlprun: number of unpaid helpers who helped last month" label var rhlpdysu "rhlpdysu: days unpaid helpers helped last month" label var rhlphrsu "rhlphrsu: hours unpaid helpers helped last month" label var rinhppn "rinhppn: number of paid helpers ever helped" label var rhlprpn "rhlprpn: number of paid helpers who helped last month" label var rhlpdysp "rhlpdysp: days paid helpers helped last month" label var rhlphrsp "rhlphrsp: hours paid helpers helped last month" label var rhlppdta "rhlppdta: total amount helpers were paid last month" label var rhlppdtn "rhlppdtn: total number of helpers paid to help" label var rlbwgtr "rlbwgtr: r weight for lb psychosocial survey" label var rlblonely3 "rlblonely3: loneliness 3-item scale" label var rlblonely11 "rlblonely11: loneliness 11-item scale" label var rlbonchrstr "rlbonchrstr: ongoing chronic stress scale" label var rlbposaffect "rlbposaffect: positive affect 13-question scale" label var rlbnegaffect "rlbnegaffect: negative affect 12-question scale" label var rlbsatwlf "rlbsatwlf: life satisfaction scale" label var rfhosp "rfhosp: mexp flag: hospital stays" label var rfnhm "rfnhm: mexp flag: nursing hm" label var rfhhc "rfhhc: mexp flag: home health care" label var rfspec "rfspec: mexp flag: spec hlth facility" label var rmhosp "rmhosp: mexp amt: hospital stays" label var rmhhc "rmhhc: mexp amt: home health care" label var rmspec "rmspec: mexp amt: spec hlth facility" label var rmnhm "rmnhm: mexp amt: nursing hm" label var rfhcsp "rfhcsp: mexp flag: spec hlth facility" label var rmhcsp "rmhcsp: mexp amt: spec hlth facility" label var rmemoryp_imp "rmemoryp_imp: Proxy Assessment of Memory" label var rimparate_imp "rimparate_imp: Interviewer assessment of proxy" label var rprxyscore_imp "rprxyscore_imp: Total: Proxy Score (<2000 0-9; >=2000 0-11)" label var rcogfunction "rcogfunction: Cognition Category: 1=Normal, 2=CIND, 3=Demented" *ADD .q (not asked this wave) to categorical variables not asked every wave: foreach v in rdepres rsleepe rmemrye ralzhee rdemene roopmdf roopmdof rprmem rprchmem rlost rwander ralone rhaluc rtyltc rjoga rwalk1a rwalkra rwalksa rsita rchaira rclimsa rclim1a rstoopa rlifta rdimea rarmsa rpusha rdressa rbatha reata rbeda rmoneya rphonea rmedsa rtoilta rmealsa rshopa rphoneh rmedsh rmoneyh rmealsh rshoph rinhpe rfhosp rfnhm rfhhc rfspec rcogfunction rfhcsp rwalkrh rdressh rbathh reath rbedh rtoilth { replace `v'=.q if `v'==. } *ADD .q TO VALUE LABELS: foreach vallab in YESNO MEDIMPF MDIMPH MDIMP PRMEMRY PRCHMEMRY PRLOST TYLTC ADLA ADL_7H { label define `vallab' .q ".q=not asked this wave", modify } *ADD VALUE LABELS: label val rfhcsp MEDIMPF label val rmemrye YESNO *LABEL AND SAVE DATASET: label data "HRS vars on dementia, caregiving, and demog for CAN-D (Long Format)" save "$data/hrs_cand_long.dta", replace ***************************************************************************** log close