************************************************************************************************************** * Title: Is religiousness really helpful to reduce depressive symptoms at old age? A longitudinal study * Authors: Lore Van Herreweghe (lore.vanherreweghe@kuleuven.be), Wim Van Lancker (wim.vanlancker@kuleuven.be) * Date Created: SEPTEMBER 2018 * Using waves 1, 2, 4 & 5 (release 6.1.1) of the Survey of Health and Retirement in Europe (SHARE) (data available at http://www.share-project.org) * Using Stata 15.1 ************************************************************************************************************** /* The following dofile prepares data for assessing the longitudinal association between religiousness and depressive symptoms in Europeans aged 65+. It makes use of waves 1,2,4 and 5 of SHARE and requires that all four waves are merged into one dataset (in wide format with _wX indicating the wave for each variable). After preparing all necessary variables, the dataset is reshaped into long format in order to perform random and fixed effects models. */ * load merged dataset of waves 1,2,4 & 5 log close _all clear all set more off use "||yourfolderhere||\waves1245.dta" // load merged dataset ******************** *** PREPARE DATA *** ******************** *age categories label define agecats 0"25-49 years" 1"50-54 years" 2"55-59 years" 3"60-64 years " 4"65-69 years" 5"70-74 years" 6"75-79 years" 7"80-84 years" 8"85 years or older" foreach v of varlist age_int_w1 age_int_w2 age_int_w4 age_int_w5 { generate cat`v'= ((`v'>=25)&(`v'<= 49)*0) + ((`v'>=50)&(`v'<=54))*1 + ((`v'>=55)&(`v'<=59))*2 + ((`v'>=60)&(`v'<=64))*3 + ((`v'>=65)&(`v'<=69))*4 + ((`v'>=70)&(`v'<=74))*5 /// + ((`v'>=75)&(`v'<=79))*6 + ((`v'>=80)&(`v'<=84))*7 + ((`v'>=85)&(`v'<=110))*8 + ((`v'==.)|(`v'==.i)|(`v'==.a)|(`v'==.b))*-99 label values cat`v' agecats replace cat`v' =. if cat`v' == -99 label variable cat`v' "Age in categories" } *religious participation: recode for correcting the difference in periodicity between waves 1/2 and 4/5 label define socfreq 0 "Never" 1 "Less often than monthly" 2"Less often than weekly" 3"Almost every month" 4"Almost every week" 5"Almost daily" forvalues i=1/2 { local x : word `i' of ac002d6_w1 ac002d6_w2 local y : word `i' of ac003_6_w1 ac003_6_w2 local z : word `i' of _w1 _w2 local a : word `i' of ac035d6_w4 ac035d6_w5 local b : word `i' of ac036_6_w4 ac036_6_w5 local c : word `i' of _w4 _w5 generate relfreq`z' = . replace relfreq`z'= 5 if `x'==1 & `y' == 1 replace relfreq`z'= 4 if `x'==1 & `y' == 2 replace relfreq`z'= 2 if `x'==1 & `y' == 3 replace relfreq`z'=`x' if `x'==0 & `y'>0 label values relfreq`z' socfreq label variable relfreq`z' "How often in last 4 weeks: taken part in religious organization" generate relfreq`c' = . replace relfreq`c'= 5 if `a'==1 & `b' == 1 replace relfreq`c'= 4 if `a'==1 & `b' == 2 replace relfreq`c'= 3 if `a'==1 & `b' == 3 replace relfreq`c'= 1 if `a'==1 & `b' == 4 replace relfreq`c'=`a' if `a'==0 & `b'>0 label values relfreq`c' socfreq label variable relfreq`c' "How often in last 4 weeks: taken part in religious organization" } *religious participation: dummy label define socdum 0 "Never; Less often than monthly; Less often than weekly; Almost every month" 1 "Almost daily; Almost weekly" forvalues i= 1/4 { local x: word `i' of _w1 _w2 _w4 _w5 local v: word `i' of relfreq_w1 relfreq_w2 relfreq_w4 relfreq_w5 generate reldum`x' = ((`v'>= 0)&(`v'<= 3))*0 + ((`v'>= 4)&(`v'<= 5))*1 + (`v'==.)*-99 replace reldum`x' = . if reldum`x' == -99 label values reldum`x' socdum } *marital status: *dn014__wX is only updated when marital status changes, resulting in missings after wave 1. Therefore using dn044_wX ("is marital status changed?" and baseline marital status to fill in missings) recode dn014__w1 (1/2 = 0) (3/5 = 1) (6=2), generate(marital_w1) label variable marital_w1 "Marital status (wave 1)" generate marital_w2 = marital_w1 replace marital_w2 = 0 if dn044__w2 == 1 & (dn014__w2 == 1 | dn014__w2 == 2) replace marital_w2 = 1 if dn044__w2 == 1 & (dn014__w2 == 3 | dn014__w2 == 4 | dn014__w2 ==5) replace marital_w2 = 2 if dn044__w2 == 1 & (dn014__w2 == 6) label variable marital_w2 "Marital status (wave 2)" generate marital_w4 = marital_w2 replace marital_w4 = 0 if dn044__w4 == 1 & (dn014__w4 == 1 | dn014__w4 == 2) replace marital_w4 = 1 if dn044__w4 == 1 & (dn014__w4 == 3 | dn014__w4 == 4 | dn014__w4 ==5) replace marital_w4 = 2 if dn044__w4 == 1 & (dn014__w4 == 6) label variable marital_w4 "Marital status (wave 4)" generate marital_w5 = marital_w4 replace marital_w5 = 0 if dn044__w5 == 1 & (dn014__w5 == 1 | dn014__w5 == 2) replace marital_w5 = 1 if dn044__w5 == 1 & (dn014__w5 == 3 | dn014__w5 == 4 | dn014__w5 ==5) replace marital_w5 = 2 if dn044__w5 == 1 & (dn014__w5 == 6) label variable marital_w5 "Marital status (wave 5)" label define marital 0 "Married and living together/registred partnership" 1 "Living separated/divorced/never married" 2 "Widowed" label values marital_w1 marital_w2 marital_w4 marital_w5 marital * financial difficulties label define findif 0 "Easily/fairly easily" 1 "With great difficulties/with some difficulties" forvalues i = 1/4 { local a: word `i' of co007__w1 co007__w2 co007__w4 co007__w5 local w: word `i' of _w1 _w2 _w4 _w5 generate findif`w' = ((`a'>=1)&(`a'<=2))*1 + ((`a'>=3)&(`a'<=4))*0 + ((`a'==.)|(`a'==.a)|(`a'==.b))*-99 replace findif`w' = . if findif`w'==-99 label values findif`w' findif } * educational level: categories recode isced1997_r_w1 (0/1 = 0) (2 = 1) (3/4 =2) (5/6 =3) (95/97 =.), generate(educat_w1) recode isced1997_r_w2 (0/1 = 0) (2 = 1) (3/4 =2) (5/6 =3)(95/97 =.), generate(educat_w2) recode isced1997_r_w4 (0/1 = 0) (2 = 1) (3/4 =2) (5/6 =3)(95/97 =.), generate(educat_w4) recode isced1997_r_w5 (0/1 = 0) (2 = 1) (3/4 =2) (5/6 =3)(95/97 =.), generate(educat_w5) label variable educat_w1 "Educational level(wave 1)" label variable educat_w2 "Educational level(wave 2)" label variable educat_w4 "Educational level(wave 4)" label variable educat_w5 "Educational level(wave 5)" label define iscedcat 0 "Primary school (ISCED 0-1)" 1 "Lower secondary (ISCED 2)" 2 "Higher secondary (ISCED 3-4)" 3 "Tertiary education (ISCED 5-6)" label values educat_w1 educat_w2 educat_w4 educat_w5 iscedcat * praying: frequency & dummy recode q35_w1 (1=4) (2=3) (3/4=2) (5=1) (6=0), generate (prayfreq_w1) recode ex029__w2(1=4) (2=3) (3/4=2) (5=1) (6=0), generate(prayfreq_w2) recode ex029__w4(1=4) (2=3) (3/4=2) (5=1) (6=0), generate(prayfreq_w4) recode ex029__w5(1=4) (2=3) (3/4=2) (5=1) (6=0), generate(prayfreq_w5) label variable prayfreq_w1 "Frequency of praying (wave 1)" label variable prayfreq_w2 "Frequency of praying(wave 2)" label variable prayfreq_w4 "Frequency of praying(wave 4)" label variable prayfreq_w5 "Frequency of praying(wave 5)" label define prayfreq 0 "Never praying" 1 "Less than once a week" 2 "Once a week or couple of times a week" 3 "Once daily or almost daily" 4 "More than once a day" label values prayfreq_w1 prayfreq_w2 prayfreq_w4 prayfreq_w5 prayfreq recode q35_w1 (5/6=0) (1/4=1), generate (praydum_w1) recode ex029__w2(5/6=0) (1/4=1), generate (praydum_w2) recode ex029__w4(5/6=0) (1/4=1), generate (praydum_w4) recode ex029__w5(5/6=0) (1/4=1), generate (praydum_w5) label variable praydum_w1 "Praying (wave 1)" label variable praydum_w2 "Praying (wave 2)" label variable praydum_w4 "Praying (wave 4)" label variable praydum_w5 "Praying (wave 5)" label define praydum 0 "No or less than once a week" 1 "Yes, at least weekly" label values praydum_w1 praydum_w2 praydum_w4 praydum_w5 praydum * long-term illness: dummy forvalues i = 1/4 { local a: word `i' of _w1 _w2 _w4 _w5 rename ph004_`a' lngill`a' } recode lngill* (1=1) (5=0) label define lng 0 "No" 1 "Yes" label values lngill_w1 lngill_w2 lngill_w4 lngill_w5 lng * religiously educated: copy across waves clonevar q36_w2 = q36_w1 clonevar q36_w4 = q36_w1 clonevar q36_w5 = q36_w1 * history of depression: rename for reshape command (replace double _) forvalues i = 1/3 { local a: word `i' of _w1 _w2 _w4 clonevar sfdep`a' = mh018_`a' } recode sfdep* (1=1) (5=0) label values sfdep_w1 sfdep_w2 sfdep_w4 lng drop waveid* agep* firstwave_hh* dn014* dn044* co007* ac003* ac035* ac036* co007* age20* dn01* ep* ph00* isced* hhid* ex029* gender_do_* ********************* *** SELECT SAMPLE *** ********************* * Select respondents who entered in wave 1, with no missings at baseline drop if firstwave_w1 != 1 drop if eurod_w1 == . drop if reldum_w1 == . drop if praydum_w1 == . drop if praydum_w1 == .e drop if q36_w1 == .e * Select respondents aged 65+ egen float nonmis_age_int = rownonmiss(age_int_w1 age_int_w2 age_int_w4 age_int_w5) drop if nonmis_age_int == 0 drop if age_int_w1 <= 64 * drop France: no info on praying or rel edu drop if country_w1 == 17 drop if country_w2 == 17 drop if country_w4 == 17 drop if country_w5 == 17 * final sample: 7 719 ********************************* *** RESHAPE FROM WIDE TO LONG *** ********************************* replace country_w4 = country_w1 if country_w4 == . replace country_w2 = country_w1 if country_w2 == . replace country_w5 = country_w1 if country_w5 == . replace educat_w4 = educat_w1 if educat_w4 == . replace educat_w2 = educat_w1 if educat_w2 == . replace educat_w5 = educat_w1 if educat_w5 == . replace gender_w4 = gender_w1 if gender_w4 == . replace gender_w2 = gender_w1 if gender_w2 == . replace gender_w5 = gender_w1 if gender_w5 == . reshape long country gender age_int catage_int eurod eurodcat reldum praydum q36 prayfreq relfreq marital findif educat lngill gali iadl2 sphus2 adl2 sfdep q34_re, i(mergeid) j(round) string *generate id and wave egen id = group(mergeid) sum id egen wave = group(round) global vlist i.marital findif adl2 iadl2 lngill sphus2 i.sfdep global clist gender i.educat i.country sort id wave xtset id wave xtdescribe ******************************** *** DESCRIPTIVES AT BASELINE *** ******************************** svyset, psu(id) strata(wave) vce(linearized) svy: mean eurod, subpop(if wave == 1) svy: proportion eurodcat, subpop(if wave == 1) svy: proportion adl2, subpop(if wave == 1) svy: proportion iadl2, subpop(if wave == 1) svy: proportion sphus2, subpop(if wave == 1) svy: proportion lngill, subpop(if wave == 1) svy: proportion q36, subpop(if wave == 1) svy: proportion reldum, subpop(if wave == 1) svy: proportion prayfreq, subpop(if wave == 1) svy: mean age_int, subpop(if wave == 1) svy: proportion gender, subpop(if wave == 1) svy: proportion findif, subpop(if wave == 1) svy: proportion educat, subpop(if wave == 1) * country differences svy linearized, subpop(if wave == 1): mean eurod, over(country) svy linearized, subpop(if wave == 1): mean reldum, over(country) svy linearized, subpop(if wave == 1): proportion praydum, over(country) svy linearized, subpop(if wave == 1): mean eurodcat, over(country) ********************** *** RANDOM EFFECTS *** ********************** sort id wave xtset id wave xtreg eurod reldum i.prayfreq q36 i.catage_int i.wave, re vce(cluster id) theta xttest0 xtreg eurod reldum i.prayfreq q36 i.catage_int $clist $vlist i.wave, re vce(cluster id) theta ********************* *** FIXED EFFECTS *** ********************* xtreg eurod reldum i.prayfreq i.catage_int i.wave, fe vce(robust) xtreg eurod reldum i.prayfreq i.catage_int $vlist i.wave, fe vce(robust) testparm i.wave * Hausman test quietly xtreg eurod reldum i.prayfreq i.catage_int i.wave, re estimates store b_re quietly xtreg eurod reldum i.prayfreq i.catage_int i.wave, fe estimates store b_fe hausman b_fe b_re, sigmamore