***variable level xxx (scale) (ordinal) (nominal ) . ********************************************* 1 Education ********************************************* . ********************************************* 2 Health ********************************************* . ********************************************* 1 Education ********************************************* . ********************************************* 1 Education ********************************************* . ********************************************* 1 Education ********************************************* . ********************************************* 1 Education ********************************************* . ********************************************* 1 Education ********************************************* . cd 'C:\1 Barbados\analisys' . GET FILE='02 person_01-10.sav'. ***Check age and make corrections . **If both dates are the same (92% of the cases) compute age= -1 . IF (q1_04 = q1_04_ and q1_04 >0 and q1_04 <111) age=q1_04. EXECUTE. ***529 cases without age . If both values are not the same, choose bith certificate as long as is between 0-110 . IF (age=-1 and q1_04 >0 and q1_04 <111) age=q1_04. EXECUTE. ***210 (3.2%) cases without age . ***For those 210, 69 cses have birth date and enterview day, use it to estimate age . string birth_day (A12) . COMPUTE birth_day =substring(q1_05,1,2). execute . string birth_month (A12) . COMPUTE birth_month =substring(q1_05,4,2). execute . string birth_year (A12) . COMPUTE birth_year =substring(q1_05,7,4). execute . alter type birth_day birth_month birth_year (f8.0). ***if no age and year of interview = year of birth, then age = 0. IF (age = -1 and birth_year = visit1_year) age=0. EXECUTE. ***185 cases . ***if interview year > birth year, and interview month > bitrth month, age = interview year - birth year , IF (age = -1 and birth_year >0 and visit1_year > 0 and visit1_month > birth_month) age=visit1_year - birth_year. EXECUTE. ***182 cases . ***if interview year > birth year, and interview month < bitrth month, age = interview year - birth year - 1 , IF (age = -1 and birth_year >0 and visit1_year > 0 and visit1_month < birth_month) age=visit1_year - birth_year - 1 . EXECUTE. ***143 cases . ***2 CASES THE BITRTH YEAR IS after the first visit (probably born after the 1st. visit and before the 2d. or 3rd visit . ***asign age of 0 . IF (age = -1 and birth_year < visit1_year ) age= 0 . EXECUTE. ***141 cases .. For a few of this cases only aproximations can be made based on other age filters but we will lieve them ***missing for now . RECODE age (-1=SYSMIS). EXECUTE. ***If 3.02 is = 3 and there are values in 303, recode to 1 (yes) 1 case DO IF (q3_03 > 0). RECODE q3_02 (3=1). END IF. EXECUTE. ***If 3.02 is = 2 and there are values in 303, recode to 1 (yes). 6 cases DO IF (q3_03 > 0). RECODE q3_02 (2=1). END IF. EXECUTE. ***If 3.22 is>0 (in secondary) and expenses recode q3_03 to 1 (yes). 3 cases DO IF (q3_22 > 0 and q3_21p>0). RECODE q3_02 (2=1). END IF. EXECUTE. ***review expenditures reported in question 21. compute sum_21=SUM(q3_21a,q3_21b,q3_21c,q3_21d,q3_21e,q3_21f,q3_21g,q3_21h,q3_21i,q3_21j,q3_21k,q3_21l, q3_21m,q3_21n,q3_21o,q3_21p). EXECUTE. ***If 3.10 is>0 (atending public or private) and expenses > 0 recode q3_03 to 1 (yes). 1 case DO IF (q3_10 > 0 and sum_21>0). RECODE q3_02 (2=1). END IF. EXECUTE. ***ID students. COMPUTE student=0. VARIABLE LABEL student "Student during present year" . IF (q3_02 = 1) student=1. EXECUTE. FREQUENCIES VARIABLES=q3_02 student /ORDER=ANALYSIS. *** 1,460 students . SAVE OUTFILE='erase1.sav' /COMPRESSED. ********************. GET FILE='erase1.sav'. ***There is a 4 year old, not in school but reporting expenses. Recode the expenses to 0 . DO IF (hhid = 4161001 and id = 3 and student = 0). RECODE q3_21a q3_21b q3_21c q3_21d q3_21e q3_21f q3_21g q3_21h q3_21i q3_21j q3_21k q3_21l q3_21m q3_21n q3_21o q3_21p (ELSE=SYSMIS). END IF. EXECUTE. ***review expenditures reported in question 21. COMPUTE sum21=q3_21a+q3_21b+q3_21c+q3_21d+q3_21e+q3_21g+q3_21h+q3_21i+q3_21j+q3_21k+q3_21l+q3_21m+ q3_21n+q3_21o. VARIABLE LABELS sum21 'Summ al 3.21 variables without f and p'. EXECUTE. ***If not an student, expenditures are 0 . compute educ = -1. IF (student = 0) educ=0. VARIABLE LABELS educ 'Education expenditures'. EXECUTE. ***1,460 with -1 ***If all individual values are 0 or positive, and at least one is >0, use the individual vlues. IF (student = 1 and educ = -1 and sum21 > 0) educ=sum21. EXECUTE. ***113 with -1 . ***If individual values ant total =0, use 0 as total expenditures . IF (student = 1 and educ = -1 and sum21 = 0 and q3_21p = 0) educ=sum21. EXECUTE. ***29 with -1 . ***one person had missing value in one variable, recode it to 0 . DO IF (hhid = 3042001 and id = 2). RECODE q3_21h (SYSMIS=0). END IF. EXECUTE. IF (hhid = 3042001 and id = 2 and educ = -1) educ=q3_21a+q3_21b+q3_21c+q3_21d+q3_21e+q3_21g+q3_21h+q3_21i+q3_21j+q3_21k+q3_21l+q3_21m+ q3_21n+q3_21o. execute. ***28 with -1 . ***If individual values =0 and sum is within the 95 percentile, use the sum . IF (student = 1 and educ = -1 and sum21 = 0 and q3_21p < 3001 and q3_10 = 1) educ=q3_21p. IF (student = 1 and educ = -1 and sum21 = 0 and q3_21p < 66461 and q3_10 = 2) educ=q3_21p. EXECUTE. ***14 with -1 . ***4 cases with almost all missing values . IF (student = 1 and educ = -1 and q3_21p < 3251 and MISSING(q3_21f) and MISSING(q3_21j)) educ=q3_21p. EXECUTE. ***10 with -1 .This cases do not have values in the individual varialbes and or the total es too high. put as missing RECODE educ (-1=SYSMIS). EXECUTE. ***identify the outliers and estimate value for outliers and the 10 missing cases. ***Id outliers by level and public-private . USE ALL. COMPUTE filter_$=(student = 1). FILTER BY filter_$. EXECUTE. ***24 studentd did not declare the level . ***if primary or secondary school name was reported, recode. SORT CASES BY q3_04(A). AUTORECODE VARIABLES=q3_04 /INTO sec_name /PRINT. SORT CASES BY q3_06(A). AUTORECODE VARIABLES=q3_06 /INTO pri_name /PRINT. RECODE pri_name sec_name (1=0) (ELSE=1). EXECUTE. DO IF (pri_name = 1 & student=1). RECODE q3_03 (SYSMIS=2). END IF. EXECUTE. DO IF (sec_name = 1 & student=1). RECODE q3_03 (SYSMIS=3). END IF. EXECUTE. ***if primary code repored, recode SORT CASES BY q3_07 (A). AUTORECODE VARIABLES=q3_07 /INTO pri_code /PRINT. RECODE pri_code (1=0) (ELSE=1). EXECUTE. DO IF (pri_code = 1 & student=1). RECODE q3_03 (SYSMIS=2). END IF. EXECUTE. ***small children, recode to pre-primary DO IF (age <6 & student=1). RECODE q3_03 (SYSMIS=1). END IF. EXECUTE. ***the remaining 6, recode to other (all are 17 or older) . DO IF (student=1). RECODE q3_03 (SYSMIS=6). END IF. EXECUTE. ***For public or private there are 9missing. If primary, recode to public, if other, recode to private DO IF (q3_03 = 2). RECODE q3_10 (SYSMIS=1). END IF. EXECUTE. DO IF (q3_03 = 6). RECODE q3_10 (SYSMIS=2). END IF. EXECUTE. *combine level and private/public . COMPUTE level_public=q3_03 + (q3_10 / 10). EXECUTE. DELETE VARIABLES sec_name pri_name pri_code . ***For food at school . IF (MISSING(q3_21m)) q3_21m=educ - sum(q3_21a,q3_21b,q3_21c,q3_21d,q3_21e,q3_21g,q3_21h,q3_21i, q3_21j,q3_21k,q3_21l,q3_21n,q3_21o). EXECUTE. ***4 cases remain without information yhat should be imputed . SAVE OUTFILE='erase2.sav' /COMPRESSED. ********************. GET FILE='erase2.sav'. *******************************************************************************. *******************************************************************************. *******************************************************************************. USE ALL. COMPUTE filter_$=(student = 1). FILTER BY filter_$. EXECUTE. ***define varible to be examined. IF (q3_21m >= 0) var=educ - q3_21m . EXECUTE. IF (MISSING(q3_21m)) var=educ . EXECUTE. ***ID missing cases compute lack_data = 0 . IF (student = 1 & MISSING(var)) lack_data=1. EXECUTE. *******************************************************************************. *******************************************************************************. *******************************************************************************. RECODE var (0=SYSMIS). EXECUTE. ***Estandar deviationa from the mean . AGGREGATE /OUTFILE=* MODE=ADDVARIABLES /BREAK=level_public /var_mean=MEAN(var) /var_sd=SD(var). COMPUTE sd_mean=ABS(RND( (var - var_mean)/var_sd,0.1)). EXECUTE. SORT CASES BY sd_mean(D). COMPUTE var_ex=0. EXECUTE. ***Cases replaced: 3 + 10 missing: 11 IF (sd_mean > 7 or lack_data=1) var_ex=var_mean. IF (sd_mean > 7 or lack_data=1)var=var_mean. EXECUTE. FILTER OFF. USE ALL. EXECUTE. DELETE VARIABLES var_mean var_sd sd_mean lack_data. RECODE var var_ex (SYSMIS=0). EXECUTE. FREQUENCIES VARIABLES= var var_ex /ORDER=ANALYSIS. *******************************************************************************. *******************************************************************************. *******************************************************************************. compute education = var /12 . variable labels education "Education espenditure/month/person". compute education_ex = var_ex / 12. variable labels education_ex "Estimated education espenditure/month/person". execute . DELETE VARIABLES var var_ex . DELETE VARIABLES educ sum21 sum_21 . SAVE OUTFILE='erase3.sav' /COMPRESSED. ********************. GET FILE='erase3.sav'. **Now for food at school . *******************************************************************************. *******************************************************************************. *******************************************************************************. USE ALL. COMPUTE filter_$=(student = 1). FILTER BY filter_$. EXECUTE. ***define varible to be examined. compute var= q3_21m . EXECUTE. ***ID missing cases compute lack_data = 0 . IF (student = 1 & MISSING(var)) lack_data=1. EXECUTE. *******************************************************************************. *******************************************************************************. *******************************************************************************. RECODE var (0=SYSMIS). EXECUTE. ***Estandar deviationa from the mean . AGGREGATE /OUTFILE=* MODE=ADDVARIABLES /BREAK=level_public /var_mean=MEAN(var) /var_sd=SD(var). COMPUTE sd_mean=ABS(RND( (var - var_mean)/var_sd,0.1)). EXECUTE. SORT CASES BY sd_mean(D). EXAMINE VARIABLES=sd_mean /PLOT BOXPLOT /COMPARE GROUPS /STATISTICS DESCRIPTIVES /CINTERVAL 95 /MISSING LISTWISE /NOTOTAL. COMPUTE var_ex = 0. EXECUTE. ***Cases replaced: 3 + 4 missing: 7 IF (sd_mean > 6 or lack_data=1) var_ex=var_mean. IF (sd_mean > 6 or lack_data=1) var=var_mean. EXECUTE. FILTER OFF. USE ALL. EXECUTE. FREQUENCIES VARIABLES= var var_ex /ORDER=ANALYSIS. DELETE VARIABLES var_mean var_sd sd_mean lack_data. RECODE var var_ex (SYSMIS=0). EXECUTE. FREQUENCIES VARIABLES= var var_ex /ORDER=ANALYSIS. *******************************************************************************. *******************************************************************************. *******************************************************************************. compute food_school = var /12. VARIABLE LABEL food_school "Food or snacks at school/month/person". compute food_school_ex = var_ex/12. VARIABLE LABEL food_school_ex "Estimated food or snacks at school/month/person". execute . DELETE VARIABLES var var_ex . DELETE VARIABLES level_public filter_$ . SAVE OUTFILE='erase4.sav' /COMPRESSED. ********************. GET FILE='erase4.sav'. ********************************************* 1 Education ********************************************* . ********************************************* 1 Education ********************************************* . ********************************************* 1 Education ********************************************* . ********************************************* 1 Education ********************************************* . ********************************************* 1 Education ********************************************* . GET FILE='erase4.sav'. **Social programs; the inkind variable Q4_03 had several entries, most of them indicate a bi-montlhy monetary value ***this answers look more like cash transfers. A few of them (<30) correspond to in kind benefits. Around half of the inkind ***benefits are trainning programs. and only a few of them (around 5) are food or similar items without any value. ***All food received as donations from government are also recorded int he food section and will be included as part of the ***consumption aggregates . ***The answers in the government socialprograms are not adequate to te included as part of the consumption aggregate. ********************************************* 2 Health ********************************************* . ********************************************* 2 Health ********************************************* . ********************************************* 2 Health ********************************************* . ********************************************* 2 Health ********************************************* . ********************************************* 2 Health ********************************************* . GET FILE='erase4.sav'. FREQUENCIES VARIABLES=q5_20 /ORDER=ANALYSIS. ***488 missing values. USE ALL. COMPUTE filter_$=(MISSING(q5_20)). FILTER BY filter_$. EXECUTE. FREQUENCIES VARIABLES=q5_21 q5_22 q5_23 q5_24 q5_25 q5_26 q5_27 q5_28 /ORDER=ANALYSIS. **if reported expenditure, change to yes. DO IF (q5_26 = 1 or q5_28 > 0). RECODE q5_20 (SYSMIS=1). END IF. EXECUTE. ***if answered no in any question recode to no . DO IF (q5_22 = 2 or q5_24 = 2 or q5_26 = 2). RECODE q5_20 (SYSMIS=2). END IF. EXECUTE. ***476 cases without entry . COMPUTE Sum51_19=SUM(q5_00, q5_01p, q5_01o, q5_02, q5_03a, q5_03b, q5_03c, q5_03d, q5_03e, q5_03f, q5_04, q5_05, q5_06a, q5_06b, q5_06c, q5_06d, q5_06e, q5_06f, q5_07a, q5_07b, q5_07c, q5_07d, q5_08a, q5_08b, q5_08c, q5_08d, q5_08e, q5_08f, q5_08g, q5_09a, q5_09b, q5_10, q5_11, q5_12, q5_13, q5_14, q5_15, q5_16a, q5_16b, q5_17, q5_18a, q5_18b, q5_18c, q5_18d, q5_18e, q5_18f, q5_18g, q5_19 ). EXECUTE. ***If any question in the health module was answered and no expenditure was reported, asume 0 expenditures. DO IF (Sum51_19 >=0 ). RECODE q5_20 (SYSMIS=2). END IF. EXECUTE. ***391 cases without entry . FILTER OFF. USE ALL. EXECUTE. ***id the cases with no health information at all. for these cases the estimated its expenditure shoukd be the average by the ***probability of having a health expenditures. RECODE q5_20 (SYSMIS=1) (ELSE=0) INTO no_health_info. VARIABLE LABELS no_health_info 'Persons with no health information at all'. EXECUTE. AGGREGATE /OUTFILE=* MODE=ADDVARIABLES /BREAK= /no_health_info_mean=MEAN(no_health_info). ***Look at the ones reporting expenditures in the last 30 days . USE ALL. COMPUTE filter_$=(q5_20 = 1). FILTER BY filter_$. EXECUTE. ***Check for values reported in section 5, questions 21, 23, 25, and 28. ***missing cases will be treated as 0. If no expenditure in any or the variables is reported, a total helath expenditure would be made. FREQUENCIES VARIABLES=q5_21 /ORDER=ANALYSIS. DO IF (q5_20=1). RECODE q5_21 (SYSMIS=0). END IF. EXECUTE. FILTER OFF. USE ALL. EXECUTE. ************************************************** START create specific data vairables ***************************************. ***define varible to be examined (Make sure cases with no service o item had a missing value) . COMPUTE var= q5_21 . EXECUTE. ***ID missing cases . COMPUTE lack_data = 0 . IF (q5_20 = 1 & MISSING(var)) lack_data=1. EXECUTE. ***Create variable for level of analysis. If none use a "1" . COMPUTE level= 1 . EXECUTE. ***************************************************** END create specific data vairables ***************************************. ***Estandar deviationa from the mean . AGGREGATE /OUTFILE=* MODE=ADDVARIABLES /BREAK=level /var_mean=MEAN(var) /var_sd=SD(var). COMPUTE sd_mean=ABS(RND( (var - var_mean)/var_sd,0.1)). EXECUTE. SORT CASES BY sd_mean(D). EXAMINE VARIABLES=sd_mean /PLOT BOXPLOT /COMPARE GROUPS /STATISTICS DESCRIPTIVES /CINTERVAL 95 /MISSING LISTWISE /NOTOTAL. COMPUTE var_ex = 0. EXECUTE. FREQUENCIES VARIABLES=lack_data /ORDER=ANALYSIS. ************************************************** START cut-off point for replacement ******************************. ***Cases replaced: 3 + 0 missing: 7 . IF (sd_mean > 6 or lack_data=1) var_ex=var_mean. IF (sd_mean > 6 or lack_data=1) var=var_mean. EXECUTE. ************************************************** END cut-off point for replacement ******************************. RECODE var_ex var (SYSMIS=0). EXECUTE. FREQUENCIES VARIABLES= var var_ex /ORDER=ANALYSIS. ************************************************** START define new varaibles and save file ******************************. compute health21 = var . compute health21_ex = var_ex. execute . DELETE VARIABLES lack_data level var_mean var_sd sd_mean var var_ex . DELETE VARIABLES filter_$ . DELETE VARIABLES Sum51_19 . SAVE OUTFILE='erase5.sav' /COMPRESSED. ********************. GET FILE='erase5.sav'. ************************************************** END define new varaibles and save file ******************************. ***For issing expenditure values in 23, 25 and 28, if the person reported no expenditure en past 30 days (or 0), it is reasonable ***tobelieve the other health expenditures were also 0. USE ALL. COMPUTE filter_$=(no_health_info = 0). FILTER BY filter_$. EXECUTE. DO IF (q5_20 = 2 or q5_21 = 0). RECODE q5_22 q5_24 q5_26 (SYSMIS=2). END IF. EXECUTE. ***there are 2 cases with missing information in questions 21 and 22. since both reported values in questions ***before and after, the value in question 22 will be = 2 =no purchases. DO IF (no_health_info = 0 & q5_20 > 0 & q5_24 > 0). RECODE q5_22 (SYSMIS=2). END IF. EXECUTE. FILTER OFF. USE ALL. EXECUTE. ************************************************** START create specific data vairables ***************************************. ***define varible to be examined (Make sure cases with no service o item had a missing value) . COMPUTE var= q5_23 . EXECUTE. ***ID missing cases . COMPUTE lack_data = 0 . IF (q5_22 = 1 & MISSING(var)) lack_data=1. EXECUTE. ***Create variable for level of analysis. If none use a "1" . COMPUTE level= 1 . EXECUTE. ***************************************************** END create specific data vairables ***************************************. ***Estandar deviationa from the mean . AGGREGATE /OUTFILE=* MODE=ADDVARIABLES /BREAK=level /var_mean=MEAN(var) /var_sd=SD(var). COMPUTE sd_mean=ABS(RND( (var - var_mean)/var_sd,0.1)). EXECUTE. SORT CASES BY sd_mean(D). EXAMINE VARIABLES=sd_mean /PLOT BOXPLOT /COMPARE GROUPS /STATISTICS DESCRIPTIVES /CINTERVAL 95 /MISSING LISTWISE /NOTOTAL. COMPUTE var_ex = 0. EXECUTE. FREQUENCIES VARIABLES=lack_data /ORDER=ANALYSIS. ************************************************** START cut-off point for replacement ******************************. ***Cases replaced: 2 + 9 missing: 11 . IF (sd_mean > 10 or lack_data=1) var_ex=var_mean. IF (sd_mean > 10 or lack_data=1) var=var_mean. EXECUTE. ************************************************** END cut-off point for replacement ******************************. RECODE var_ex var (SYSMIS=0). EXECUTE. FREQUENCIES VARIABLES= var var_ex /ORDER=ANALYSIS. ************************************************** START define new varaibles and save file ******************************. compute health23 = var . compute health23_ex = var_ex. execute . DELETE VARIABLES lack_data level var_mean var_sd sd_mean var var_ex . DELETE VARIABLES filter_$ . *DELETE VARIABLES . SAVE OUTFILE='erase6.sav' /COMPRESSED. ********************. GET FILE='erase6.sav'. ************************************************** END define new varaibles and save file ******************************. USE ALL. COMPUTE filter_$=(no_health_info = 0). FILTER BY filter_$. EXECUTE. FREQUENCIES VARIABLES=q5_24 /ORDER=ANALYSIS. ***There is a valueo out of range (0) inquestion 24. since there is a missing value in Q 25, it will recoded to 2 = no expenditures . DO IF (MISSING(q5_25)). RECODE q5_24 (0=2). END IF. EXECUTE. FILTER OFF. USE ALL. EXECUTE. ************************************************** START create specific data vairables ***************************************. ***define varible to be examined (Make sure cases with no service o item had a missing value) . COMPUTE var= q5_25 . EXECUTE. ***ID missing cases . COMPUTE lack_data = 0 . IF (q5_24 = 1 & MISSING(var)) lack_data=1. EXECUTE. ***Create variable for level of analysis. If none use a "1" . COMPUTE level= 1 . EXECUTE. ***************************************************** END create specific data vairables ***************************************. ***Estandar deviationa from the mean . AGGREGATE /OUTFILE=* MODE=ADDVARIABLES /BREAK=level /var_mean=MEAN(var) /var_sd=SD(var). COMPUTE sd_mean=ABS(RND( (var - var_mean)/var_sd,0.1)). EXECUTE. SORT CASES BY sd_mean(D). EXAMINE VARIABLES=sd_mean /PLOT BOXPLOT /COMPARE GROUPS /STATISTICS DESCRIPTIVES /CINTERVAL 95 /MISSING LISTWISE /NOTOTAL. COMPUTE var_ex = 0. EXECUTE. FREQUENCIES VARIABLES=lack_data /ORDER=ANALYSIS. ************************************************** START cut-off point for replacement ******************************. ***Cases replaced: 1 + 2 missing: 3 . IF (sd_mean > 10 or lack_data=1) var_ex=var_mean. IF (sd_mean > 10 or lack_data=1) var=var_mean. EXECUTE. ************************************************** END cut-off point for replacement ******************************. RECODE var_ex var (SYSMIS=0). EXECUTE. FREQUENCIES VARIABLES= var var_ex /ORDER=ANALYSIS. ************************************************** START define new varaibles and save file ******************************. compute health25 = var . compute health25_ex = var_ex. execute . DELETE VARIABLES lack_data level var_mean var_sd sd_mean var var_ex . DELETE VARIABLES filter_$ . *DELETE VARIABLES . SAVE OUTFILE='erase7.sav' /COMPRESSED. ********************. GET FILE='erase7.sav'. ************************************************** END define new varaibles and save file ******************************. USE ALL. COMPUTE filter_$=(no_health_info = 0). FILTER BY filter_$. EXECUTE. FREQUENCIES VARIABLES=q5_26 /ORDER=ANALYSIS. ***If Q 26 is missing but question 24 was no expenditure, change it to no expenditure . . DO IF (no_health_info = 0 and q5_24 = 2). RECODE q5_26 (SYSMIS=2). END IF. EXECUTE. FILTER OFF. USE ALL. EXECUTE. ************************************************** START create specific data vairables ***************************************. ***define varible to be examined (Make sure cases with no service o item had a missing value) . COMPUTE var= q5_28 . EXECUTE. ***ID missing cases . COMPUTE lack_data = 0 . IF (q5_26 = 1 & MISSING(var)) lack_data=1. EXECUTE. ***Create variable for level of analysis. If none use a "1" . COMPUTE level= 1 . EXECUTE. ***************************************************** END create specific data vairables ***************************************. ***Estandar deviationa from the mean . AGGREGATE /OUTFILE=* MODE=ADDVARIABLES /BREAK=level /var_mean=MEAN(var) /var_sd=SD(var). COMPUTE sd_mean=ABS(RND( (var - var_mean)/var_sd,0.1)). EXECUTE. SORT CASES BY sd_mean(D). EXAMINE VARIABLES=sd_mean /PLOT BOXPLOT /COMPARE GROUPS /STATISTICS DESCRIPTIVES /CINTERVAL 95 /MISSING LISTWISE /NOTOTAL. COMPUTE var_ex = 0. EXECUTE. FREQUENCIES VARIABLES=lack_data /ORDER=ANALYSIS. ************************************************** START cut-off point for replacement ******************************. ***Cases replaced: 5 + 33 missing: 35 . IF (sd_mean > 8 or lack_data=1) var_ex=var_mean. IF (sd_mean > 8 or lack_data=1) var=var_mean. EXECUTE. ************************************************** END cut-off point for replacement ******************************. RECODE var_ex var (SYSMIS=0). EXECUTE. FREQUENCIES VARIABLES= var var_ex /ORDER=ANALYSIS. ************************************************** START define new varaibles and save file ******************************. compute health28 = var . compute health28_ex = var_ex. execute . DELETE VARIABLES lack_data level var_mean var_sd sd_mean var var_ex . DELETE VARIABLES filter_$ . *DELETE VARIABLES . SAVE OUTFILE='erase8.sav' /COMPRESSED. ********************. GET FILE='erase8.sav'. ************************************************** END define new varaibles and save file ******************************. ***Estimate total health expenditures . compute health = health21 + health23 + health25 + health28 . VARIABLE LABELS health 'Total health expenditure/month/person'. EXECUTE. COMPUTE health_ex=health21_ex + health23_ex + health25_ex + health28_ex . VARIABLE LABELS health_ex 'Estimated total health expenditure/month/person'. EXECUTE. SAVE OUTFILE='erase9.sav' /COMPRESSED. ********************. GET FILE='erase9.sav'. ************************************************** END define new varaibles and save file ******************************. GET FILE='erase9.sav' /keep = hhid hhid_string weight psu stratum hhh_gender hh_size mth visit1_day visit1_month visit1_year age birth_day birth_month birth_year student education education_ex food_school food_school_ex no_health_info no_health_info_mean health21 health21_ex health23 health23_ex health25 health25_ex health28 health28_ex health health_ex . execute . RECODE health (SYSMIS=0). EXECUTE. AGGREGATE /OUTFILE=* MODE=ADDVARIABLES /BREAK= /health_mean=MEAN(health). COMPUTE health_mean_prob=health_mean * no_health_info_mean. EXECUTE. IF (no_health_info = 1 and health = 0) health_ex=health_mean_prob. IF (no_health_info = 1 and health = 0) health=health_mean_prob. EXECUTE. SORT CASES BY hhid(A). SAVE OUTFILE='a0 educ_health.sav' /COMPRESSED. ********************. GET FILE='a0 educ_health.sav'. *******************************************************************************************************. GET FILE='a0 educ_health.sav'. ***Sum values to one entry per household . AGGREGATE /OUTFILE= * /BREAK=hhid hhid_string weight psu stratum hh_size /education =SUM(education) /education_ex =SUM(education_ex) /food_school =SUM(food_school) /food_school_ex =SUM(food_school_ex) /health =SUM(health) /health_ex =SUM(health_ex). VARIABLE LABELS education "Education espenditure/month/household". VARIABLE LABELS education_ex "Estimated education espenditure/month/household". VARIABLE LABELS food_school "Food or snacks at school/month/household". VARIABLE LABELS food_school_ex "Estimated food or snacks at school/month/household". VARIABLE LABELS health 'Total health expenditure/month/household'. VARIABLE LABELS health_ex 'Estimated total health expenditure/month/household'. SORT CASES BY hhid(A). SAVE OUTFILE='a1 educ_health.sav' /COMPRESSED. ********************. GET FILE='a1 educ_health.sav'. ********************************************* 2 Health ********************************************* . ********************************************* 2 Health ********************************************* . ********************************************* 2 Health ********************************************* . ********************************************* 2 Health ********************************************* . ********************************************* 2 Health ********************************************* . ***Expenditures in crime prevention from module 8 are in the housing file because is one answer per household. erase file "erase1.sav". erase file "erase2.sav". erase file "erase3.sav". erase file "erase4.sav". erase file "erase5.sav". erase file "erase6.sav". erase file "erase7.sav". erase file "erase8.sav". erase file "erase9.sav".