* Wealth index calculation. Mamadou Diallo, 05/03/2018. Burkina Faso MIS 2017-18. cd "C:\Users\21180\OneDrive - ICF\Projects\Analysis\Wealth Index Construction\BF2017\wealth". *cd 'C:\BF7A\Wealth'. include file='Wealth_assets.sps'. missing values QH113 (99.9). execute. set tvars=both. * Macro definitions to perform some recoding automatically. * Note: Do not use an asterisk in front of a macro name to try to comment it out - it will run any way because of the way the macros are expanded. * Delete the line instead or change the spelling of the macro in the comment. * Do not use the names of macros in comments - they will also be expanded too, and likely will fail. *{Create binary variables based on condition and give label }. define dichotomize( !positional !enclose('(',')') / !positional !tokens(1) / !positional !tokens(1) ) compute !2=0. if (!1) !2=1. variable labels !2 !3. value labels !2 0 'No' 1 'Yes'. formats !2 (f1.0). !enddefine. *(Separate shared toilets from non-shared toilets). define shared_fac( !positional !tokens(1) / !positional !tokens(1) / !positional !tokens(1) ). compute !2 = 0. do if (QH106=1). + if (!1=1) !2 = 1. + compute !1 = 0. end if. variable labels !2 !3. value labels !2 0 'No' 1 'Yes'. formats !2 (f1.0). !enddefine. *{Reset missing values to 'does not have', change 2 code to 0}. define no2zero( !positional !tokens(1) ) if (missing(!1) | !1<>1) !1=0. value labels !1 0 'No' 1 'Yes'. !enddefine. *{Construct Variables}. * Source d'eau à boire. dichotomize (QH101=11) QH101_11 "Source d'eau à boire: Robinet - dans le logement". dichotomize (QH101=12) QH101_12 "Source d'eau à boire: Robinet - dans cour/parcelle". dichotomize (QH101=13) QH101_13 "Source d'eau à boire: Robinet - chez un voisin". dichotomize (QH101=14) QH101_14 "Source d'eau à boire: Robinet - public / borne fontaine". dichotomize (QH101=21) QH101_21 "Source d'eau à boire: Puits à pompe ou forage". dichotomize (QH101=31) QH101_31 "Source d'eau à boire: Puits creusé - protégé". dichotomize (QH101=32) QH101_32 "Source d'eau à boire: Puits creusé - non protégé". dichotomize (QH101=41) QH101_41 "Source d'eau à boire: Source - protégé". dichotomize (QH101=42) QH101_42 "Source d'eau à boire: Source - non protégé". *ichotomize (QH101=51) QH101_51 "Source d'eau à boire: Eau de pluie". *ichotomize (QH101=61) QH101_61 "Source d'eau à boire: Camion citerne". dichotomize (QH101=71) QH101_71 "Source d'eau à boire: Charrette avec petite citerne/ tonneau". dichotomize (QH101=81) QH101_81 "Source d'eau à boire: Eau de surface (rivière/barrage/lac/mare/fleuve/canal/canal d'irrigation)". dichotomize (QH101=91) QH101_91 "Source d'eau à boire: Eau de bouteille". dichotomize (QH101=96) QH101_96 "Source d'eau à boire: Autre". * Type de toilettes. dichotomize (QH105=11) QH105_11 "Type de toilettes: Chasse d'eau connectée - à un système d'égout". dichotomize (QH105=12) QH105_12 "Type de toilettes: Chasse d'eau connectée - à une fosse septique". dichotomize (QH105=13 | QH105 = 15) QH105_13 "Type de toilettes: Chasse d'eau connectée - à une fosse d'aisances/à ne sait pas où". *ichotomize (QH105=14) QH105_14 "Type de toilettes: Chasse d'eau connectée - à quelque chose d'autre". *ichotomize (QH105=15) QH105_15 "Type de toilettes: Chasse d'eau connectée - à ne sait pas où". dichotomize (QH105=21) QH105_21 "Type de toilettes: Fosses/latrines - améliorées auto-aérées". dichotomize (QH105=22) QH105_22 "Type de toilettes: Fosses/latrines - avec dalle lavable". dichotomize (QH105=23) QH105_23 "Type de toilettes: Fosses/latrines - sans dalle / trou ouvert". dichotomize (QH105=31 | QH105=41 | QH105=51) QH105_31 "Type de toilettes: Toilettes à compostage/tinette/suspendus". *ichotomize (QH105=41) QH105_41 "Type de toilettes: Seau/tinette". *ichotomize (QH105=51) QH105_51 "Type de toilettes: Toilettes/latrines suspendues". dichotomize (QH105=61) QH105_61 "Type de toilettes: Pas de toilettes / nature". dichotomize (QH105=96) QH105_96 "Type de toilettes: Autre". *hared_fac QH105_11 QH105_11_sh "Type de toilettes: Chasse d'eau connectée - à un système d'égout - shared". shared_fac QH105_12 QH105_12_sh "Type de toilettes: Chasse d'eau connectée - à une fosse septique - shared". shared_fac QH105_13 QH105_13_sh "Type de toilettes: Chasse d'eau connectée - à une fosse d'aisances - shared/à ne sait pas où". *hared_fac QH105_14 QH105_14_sh "Type de toilettes: Chasse d'eau connectée - à quelque chose d'autre - shared". *hared_fac QH105_15 "Type de toilettes: Chasse d'eau connectée - à ne sait pas où - shared". shared_fac QH105_21 QH105_21_sh "Type de toilettes: Fosses/latrines - améliorées auto-aérées - shared". shared_fac QH105_22 QH105_22_sh "Type de toilettes: Fosses/latrines - avec dalle lavable - shared". shared_fac QH105_23 QH105_23_sh "Type de toilettes: Fosses/latrines - sans dalle / trou ouvert - shared". shared_fac QH105_31 QH105_31_sh "Type de toilettes: Toilettes à compostage/tinette/suspendus - shared". *hared_fac QH105_41 "Type de toilettes: Seau/tinette - shared". *hared_fac QH105_51 QH105_51_sh "Type de toilettes: Toilettes/latrines suspendues - shared". shared_fac QH105_96 QH105_96_sh "Type de toilettes: Autre - shared". * Type de combustible. *ichotomize (QH108=1) QH108_1 "Type de combustible: Electricité". dichotomize (QH108=2) QH108_2 "Type de combustible: Gaz propane liquifié (GPL)". dichotomize (QH108=3) QH108_3 "Type de combustible: Gaz naturel". dichotomize (QH108=4) QH108_4 "Type de combustible: Biogaz". *ichotomize (QH108=5) QH108_5 "Type de combustible: Kerosène". dichotomize (QH108=6) QH108_6 "Type de combustible: Charbon, lignite". dichotomize (QH108=7) QH108_7 "Type de combustible: Charbon de bois". dichotomize (QH108=8) QH108_8 "Type de combustible: Bois". dichotomize (QH108=9) QH108_9 "Type de combustible: Pailles/branchages/herbes". dichotomize (QH108=10) QH108_10 "Type de combustible: Résidus agricoles". dichotomize (QH108=11) QH108_11 "Type de combustible: Bouse". dichotomize (QH108=95) QH108_95 "Type de combustible: Pas de repasd préparé dans le ménage". dichotomize (QH108=96) QH108_96 "Type de combustible: Autre". * Vaches/taureaux. if (missing(QH111A) | QH111A = 98 | QH110 <> 1) QH111A=0. missing values QH111A (99). compute QH111A_1 = (QH111A >= 1 & QH111A <= 4). compute QH111A_2 = (QH111A >= 5 & QH111A <= 9). compute QH111A_3 = (QH111A >= 10 & QH111A <= 95). variable labels QH111A_1 'Vaches/taureaux: 1-4' /QH111A_2 'Vaches/taureaux: 5-9' /QH111A_3 'Vaches/taureaux: 10+'. * Autre bétail. if (missing(QH111B) | QH111B = 98 | QH110 <> 1) QH111B=0. missing values QH111B (99). compute QH111B_1 = (QH111B >= 1 & QH111B <= 9). compute QH111B_2 = (QH111B >= 10 & QH111B <= 29). compute QH111B_3 = (QH111B >= 30 & QH111B <= 95). variable labels QH111B_1 'Autre bétail: 1-9' /QH111B_2 'Autre bétail: 10-29' /QH111B_3 'Autre bétail: 30+'. * Chevaux/ânes/mules. if (missing(QH111C) | QH111C = 98 | QH110 <> 1) QH111C=0. missing values QH111C (99). compute QH111C_1 = (QH111C >= 1 & QH111C <= 4). compute QH111C_2 = (QH111C >= 5 & QH111C <= 9). compute QH111C_3 = (QH111C >= 10 & QH111C <= 95). variable labels QH111C_1 'Chevaux/ânes/mules: 1-4' /QH111C_2 'Chevaux/ânes/mules: 5-9' /QH111C_3 'Chevaux/ânes/mules: 10+'. * Chèvres. if (missing(QH111D) | QH111D = 98 | QH110 <> 1) QH111D=0. missing values QH111D (99). compute QH111D_1 = (QH111D >= 1 & QH111D <= 4). compute QH111D_2 = (QH111D >= 5 & QH111D <= 9). compute QH111D_3 = (QH111D >= 10 & QH111D <= 95). variable labels QH111D_1 'Chèvres: 1-4' /QH111D_2 'Chèvres: 5-9' /QH111D_3 'Chèvres: 10+'. * Moutons. if (missing(QH111E) | QH111E = 98 | QH110 <> 1) QH111E=0. missing values QH111E (99). compute QH111E_1 = (QH111E >= 1 & QH111E <= 4). compute QH111E_2 = (QH111E >= 5 & QH111E <= 9). compute QH111E_3 = (QH111E >= 10 & QH111E <= 95). variable labels QH111E_1 'Moutons: 1-4' /QH111E_2 'Moutons: 5-9' /QH111E_3 'Moutons: 10+'. * Poulets/autre volaille. if (missing(QH111F) | QH111F = 98 | QH110 <> 1) QH111F=0. missing values QH111F (99). compute QH111F_1 = (QH111F >= 1 & QH111F <= 9). compute QH111F_2 = (QH111F >= 10 & QH111F <= 29). compute QH111F_3 = (QH111F >= 30 & QH111F <= 95). variable labels QH111F_1 'Poulets/autre volaille: 1-9' /QH111F_2 'Poulets/autre volaille: 10-29' /QH111F_3 'Poulets/autre volaille: 30+'. * Porcs. if (missing(QH111G) | QH111G = 98 | QH110 <> 1) QH111G=0. missing values QH111G (99). compute QH111G_1 = (QH111G >= 1 & QH111G <= 4). compute QH111G_2 = (QH111G >= 5 & QH111G <= 9). compute QH111G_3 = (QH111G >= 10 & QH111G <= 95). variable labels QH111G_1 'Porcs: 1-4' /QH111G_2 'Porcs: 5-9' /QH111G_3 'Porcs: 10+'. * Hectares de terres cultivables. compute landarea = QH113. if (missing(QH113) | QH113 >= 99.8) landarea = 99.9. if (missing(QH112) | QH112 <> 1) landarea=0. missing values landarea (99.9). * Electricité. no2zero QH114A. * Radio. no2zero QH114B. * Television. no2zero QH114C. * Telephone fixe. no2zero QH114D. * Ordinateur. no2zero QH114E. * Refrigerateur/congélateur. no2zero QH114F. * Table/chaise. no2zero QH114G. * Armoire/bibliothèque. no2zero QH114H. * Cuisinière/rechaud. no2zero QH114I. * Fusil de chasse. no2zero QH114J. * Charrue. no2zero QH114K. * Montre. no2zero QH115A. * Telephone portable. no2zero QH115B. * Bicyclette. no2zero QH115C. * Motorcyclette/scooter. no2zero QH115D. * Charrette avec animal. no2zero QH115E. * Voiture/camionnette. no2zero QH115F. * Bateau à moteur. no2zero QH115G. * Pirogue. no2zero QH115H. * recode bateau motor into pirogue. if (QH115G = 1) QH115H = 1. * Compte en banque. no2zero QH116. * Principal matériau du sol du logement. dichotomize (QH131=11) QH131_11 "Principal matériau du sol du logement: Terre/sable". dichotomize (QH131=12) QH131_12 "Principal matériau du sol du logement: Bouse". *ichotomize (QH131=21) QH131_21 "Principal matériau du sol du logement: Planches en bois". *ichotomize (QH131=22) QH131_22 "Principal matériau du sol du logement: Palmes/bambou". *ichotomize (QH131=31) QH131_31 "Principal matériau du sol du logement: Parquet ou bois ciré". *ichotomize (QH131=32) QH131_32 "Principal matériau du sol du logement: Bandes de vinyle/asphalte". dichotomize (QH131=33) QH131_33 "Principal matériau du sol du logement: Carrelage/carreaux". dichotomize (QH131=34) QH131_34 "Principal matériau du sol du logement: Ciment". dichotomize (QH131=35) QH131_35 "Principal matériau du sol du logement: Moquette". *ichotomize (QH131=96) QH131_96 "Principal matériau du sol du logement: Autre". * Principal matériau du toi du logement. dichotomize (QH132=11) QH132_11 "Principal matériau du toi du logement: Pas de toit". dichotomize (QH132=12) QH132_12 "Principal matériau du toi du logement: Chaume/palmes/feuilles". dichotomize (QH132=13) QH132_13 "Principal matériau du toi du logement: Mottes de terre". dichotomize (QH132=21 | QH132=22) QH132_21 "Principal matériau du toi du logement: Natte/Palmes/bambou". *ichotomize (QH132=22) QH132_22 "Principal matériau du toi du logement: Palmes/bambou". dichotomize (QH132=23 | QH132=24) QH132_23 "Principal matériau du toi du logement: Planches en bois/Carton". *ichotomize (QH132=24) QH132_24 "Principal matériau du toi du logement: Carton". dichotomize (QH132=31) QH132_31 "Principal matériau du toi du logement: Tôle". dichotomize (QH132=32 | QH132=34) QH132_32 "Principal matériau du toi du logement: Bois/Tuiles". *ichotomize (QH132=33) QH132_33 "Principal matériau du toi du logement: Zinc/fibre de ciment". *ichotomize (QH132=34) QH132_34 "Principal matériau du toi du logement: Tuiles". dichotomize (QH132=35) QH132_35 "Principal matériau du toi du logement: Ciment". *ichotomize (QH132=36) QH132_36 "Principal matériau du toi du logement: Shingles". *ichotomize (QH132=96) QH132_96 "Principal matériau du toi du logement: Autre". * Principal matériau des murs exterieurs du logement. dichotomize (QH133=11) QH133_11 "Principal matériau des murs exterieurs du logement: Pas de mur". dichotomize (QH133=12) QH133_12 "Principal matériau des murs exterieurs du logement: Bambou/cane/palme/tronc". dichotomize (QH133=13) QH133_13 "Principal matériau des murs exterieurs du logement: Terre". dichotomize (QH133=21) QH133_21 "Principal matériau des murs exterieurs du logement: Bambou avec boue". dichotomize (QH133=22 | QH133 = 23) QH133_22 "Principal matériau des murs exterieurs du logement: Pierres avec boue/Adobe non recouvert". *ichotomize (QH133=23) QH133_23 "Principal matériau des murs exterieurs du logement: Adobe non recouvert". *ichotomize (QH133=24) QH133_24 "Principal matériau des murs exterieurs du logement: Contre-plaqué". *ichotomize (QH133=25) QH133_25 "Principal matériau des murs exterieurs du logement: Carton". *ichotomize (QH133=26) QH133_26 "Principal matériau des murs exterieurs du logement: Bois de récupération". dichotomize (QH133=31) QH133_31 "Principal matériau des murs exterieurs du logement: Ciment". dichotomize (QH133=32) QH133_32 "Principal matériau des murs exterieurs du logement: Pierres avec chaux / ciment". dichotomize (QH133=33) QH133_33 "Principal matériau des murs exterieurs du logement: Briques". dichotomize (QH133=34 | QH133=35) QH133_34 "Principal matériau des murs exterieurs du logement: Blocs de ciment/Adobe recouvert". *ichotomize (QH133=35) QH133_35 "Principal matériau des murs exterieurs du logement: Adobe recouvert". *ichotomize (QH133=36) QH133_36 "Principal matériau des murs exterieurs du logement: Planches en bois/shingles". dichotomize (QH133=96) QH133_96 "Principal matériau des murs exterieurs du logement: Autre". *{Members per sleeping room}. if (hhusual=0) hhusual=hhslept. if (QH109>0) memsleep=trunc(hhusual/QH109). if (QH109=0) memsleep=hhusual. if (missing(QH109) or QH109>=99 or memsleep>=98) memsleep=99. variable labels memsleep 'Number of members per sleeping room'. value labels memsleep 0 'Less than 1 per room'. formats memsleep (f2.0). missing values memsleep (99). * Compute urban and rural variables coded (1/0) for filters later. compute urban=(QHTYPE = 1). compute rural=(QHTYPE = 2). variable labels urban 'Urban' / rural 'Rural'. value labels urban 1 'Urban' / rural 1 'Rural'. formats urban rural (f1.0). execute. * Check on indicator variable creation. frequencies variables=QHTYPE to QH133. * Toilet facility by shared/not shared. crosstabs /tables=QH105 by QH106. * Land area by units - if there are separate units - need to convert them to one unit. *crosstabs /tables=QH113N by QH113U. frequencies variables= QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_41 QH101_42 QH101_71 QH101_81 QH101_91 QH101_96 QH105_11 QH105_12 QH105_13 QH105_21 QH105_22 QH105_23 QH105_31 QH105_61 QH105_96 QH105_12_sh QH105_13_sh QH105_21_sh QH105_22_sh QH105_23_sh QH105_31_sh QH105_96_sh QH108_2 QH108_3 QH108_4 QH108_6 QH108_7 QH108_8 QH108_9 QH108_10 QH108_11 QH108_95 QH108_96 QH114A QH114B QH114C QH114D QH114E QH114F QH114G QH114H QH114I QH114J QH114K QH115A QH115B QH115C QH115D QH115E QH115F QH115H QH116 QH131_11 QH131_12 QH131_33 QH131_34 QH131_35 QH132_11 QH132_12 QH132_13 QH132_21 QH132_23 QH132_31 QH132_32 QH132_35 QH133_11 QH133_12 QH133_13 QH133_21 QH133_22 QH133_31 QH133_32 QH133_33 QH133_34 QH133_96 memsleep QH111A_1 QH111A_2 QH111A_3 QH111B_1 QH111B_2 QH111B_3 QH111C_1 QH111C_2 QH111C_3 QH111D_1 QH111D_2 QH111D_3 QH111E_1 QH111E_2 QH111E_3 QH111F_1 QH111F_2 QH111F_3 QH111G_1 QH111G_2 QH111G_3 landarea . * Turn off weights before all factor analysis. weight off. * Name the dataset window for the HH data for use later. dataset name assets. save outfile='assets.sav'. *** Test Factor Analysis. filter off. execute. * Variables removed totally from PCA analysis. * QH101_51 QH101_61 QH105_14 QH105_14_sh QH105_15 QH105_41 QH105_51 QH105_51_sh QH105_11_sh. * QH108_1 QH108_5 QH115G QH131_21 QH131_22 QH131_31 QH131_32 QH131_96. * QH132_22 QH132_24 QH132_33 QH132_34 QH132_36 QH132_96. * QH133_23 QH133_24 QH133_25 QH133_26 QH133_35 QH133_36 factor /variables QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_41 QH101_42 QH101_71 QH101_81 QH101_91 QH101_96 QH105_11 QH105_12 QH105_13 QH105_21 QH105_22 QH105_23 QH105_31 QH105_61 QH105_96 QH105_12_sh QH105_13_sh QH105_21_sh QH105_22_sh QH105_23_sh QH105_31_sh QH105_96_sh QH108_2 QH108_3 QH108_4 QH108_6 QH108_7 QH108_8 QH108_9 QH108_10 QH108_11 QH108_95 QH108_96 QH114A QH114B QH114C QH114D QH114E QH114F QH114G QH114H QH114I QH114J QH114K QH115A QH115B QH115C QH115D QH115E QH115F QH115H QH116 QH131_11 QH131_12 QH131_33 QH131_34 QH131_35 QH132_11 QH132_12 QH132_13 QH132_21 QH132_23 QH132_31 QH132_32 QH132_35 QH133_11 QH133_12 QH133_13 QH133_21 QH133_22 QH133_31 QH133_32 QH133_33 QH133_34 QH133_96 memsleep QH111A_1 QH111A_2 QH111A_3 QH111B_1 QH111B_2 QH111B_3 QH111C_1 QH111C_2 QH111C_3 QH111D_1 QH111D_2 QH111D_3 QH111E_1 QH111E_2 QH111E_3 QH111F_1 QH111F_2 QH111F_3 QH111G_1 QH111G_2 QH111G_3 landarea /missing meansub /analysis QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_41 QH101_42 QH101_71 QH101_81 QH101_91 QH101_96 QH105_11 QH105_12 QH105_13 QH105_21 QH105_22 QH105_23 QH105_31 QH105_61 QH105_96 QH105_12_sh QH105_13_sh QH105_21_sh QH105_22_sh QH105_23_sh QH105_31_sh QH105_96_sh QH108_2 QH108_3 QH108_4 QH108_6 QH108_7 QH108_8 QH108_9 QH108_10 QH108_11 QH108_95 QH108_96 QH114A QH114B QH114C QH114D QH114E QH114F QH114G QH114H QH114I QH114J QH114K QH115A QH115B QH115C QH115D QH115E QH115F QH115H QH116 QH131_11 QH131_12 QH131_33 QH131_34 QH131_35 QH132_11 QH132_12 QH132_13 QH132_21 QH132_23 QH132_31 QH132_32 QH132_35 QH133_11 QH133_12 QH133_13 QH133_21 QH133_22 QH133_31 QH133_32 QH133_33 QH133_34 QH133_96 memsleep QH111A_1 QH111A_2 QH111A_3 QH111B_1 QH111B_2 QH111B_3 QH111C_1 QH111C_2 QH111C_3 QH111D_1 QH111D_2 QH111D_3 QH111E_1 QH111E_2 QH111E_3 QH111F_1 QH111F_2 QH111F_3 QH111G_1 QH111G_2 QH111G_3 landarea /print univariate initial extraction fscore /criteria factors(1) iterate(25) /extraction pc /rotation norotate /method=correlation. *** Common Factor analysis ***. ** Removed area-specific variables **. ** Agricultural animal variables excluded ** Land area excluded ** Any others ?. *** Common Factor Analysis. filter off. execute. factor /variables QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_41 QH101_42 QH101_71 QH101_81 QH101_91 QH101_96 QH105_11 QH105_12 QH105_13 QH105_21 QH105_22 QH105_23 QH105_31 QH105_61 QH105_96 QH105_12_sh QH105_13_sh QH105_21_sh QH105_22_sh QH105_23_sh QH105_31_sh QH105_96_sh QH108_2 QH108_3 QH108_4 QH108_6 QH108_7 QH108_8 QH108_9 QH108_10 QH108_11 QH108_95 QH108_96 QH114A QH114B QH114C QH114D QH114E QH114F QH114G QH114H QH114I QH114J QH114K QH115A QH115B QH115C QH115D QH115E QH115F QH115H QH116 QH131_11 QH131_12 QH131_33 QH131_34 QH131_35 QH132_11 QH132_12 QH132_13 QH132_21 QH132_23 QH132_31 QH132_32 QH132_35 QH133_11 QH133_12 QH133_13 QH133_21 QH133_22 QH133_31 QH133_32 QH133_33 QH133_34 QH133_96 memsleep /missing meansub /analysis QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_41 QH101_42 QH101_71 QH101_81 QH101_91 QH101_96 QH105_11 QH105_12 QH105_13 QH105_21 QH105_22 QH105_23 QH105_31 QH105_61 QH105_96 QH105_12_sh QH105_13_sh QH105_21_sh QH105_22_sh QH105_23_sh QH105_31_sh QH105_96_sh QH108_2 QH108_3 QH108_4 QH108_6 QH108_7 QH108_8 QH108_9 QH108_10 QH108_11 QH108_95 QH108_96 QH114A QH114B QH114C QH114D QH114E QH114F QH114G QH114H QH114I QH114J QH114K QH115A QH115B QH115C QH115D QH115E QH115F QH115H QH116 QH131_11 QH131_12 QH131_33 QH131_34 QH131_35 QH132_11 QH132_12 QH132_13 QH132_21 QH132_23 QH132_31 QH132_32 QH132_35 QH133_11 QH133_12 QH133_13 QH133_21 QH133_22 QH133_31 QH133_32 QH133_33 QH133_34 QH133_96 memsleep /print univariate initial extraction fscore /criteria factors(1) iterate(25) /extraction pc /rotation norotate /save reg(ALL com) /method=correlation. *** Urban Factor Analysis. filter off. filter by urban. execute. * Variables removed from urban for PCA analysis. * QH101_81 QH105_31 QH105_31_SH QH105_96 QH108_9 QH108_10 QH108_11 QH111C_3 QH133_12. factor /variables QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_41 QH101_42 QH101_71 QH101_91 QH101_96 QH105_11 QH105_12 QH105_13 QH105_21 QH105_22 QH105_23 QH105_61 QH105_12_sh QH105_13_sh QH105_21_sh QH105_22_sh QH105_23_sh QH105_96_sh QH108_2 QH108_3 QH108_4 QH108_6 QH108_7 QH108_8 QH108_95 QH108_96 QH114A QH114B QH114C QH114D QH114E QH114F QH114G QH114H QH114I QH114J QH114K QH115A QH115B QH115C QH115D QH115E QH115F QH115H QH116 QH131_11 QH131_12 QH131_33 QH131_34 QH131_35 QH132_11 QH132_12 QH132_13 QH132_21 QH132_23 QH132_31 QH132_32 QH132_35 QH133_11 QH133_13 QH133_21 QH133_22 QH133_31 QH133_32 QH133_33 QH133_34 QH133_96 memsleep QH111A_1 QH111A_2 QH111A_3 QH111B_1 QH111B_2 QH111B_3 QH111C_1 QH111C_2 QH111D_1 QH111D_2 QH111D_3 QH111E_1 QH111E_2 QH111E_3 QH111F_1 QH111F_2 QH111F_3 QH111G_1 QH111G_2 QH111G_3 landarea /missing meansub /analysis QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_41 QH101_42 QH101_71 QH101_91 QH101_96 QH105_11 QH105_12 QH105_13 QH105_21 QH105_22 QH105_23 QH105_61 QH105_12_sh QH105_13_sh QH105_21_sh QH105_22_sh QH105_23_sh QH105_96_sh QH108_2 QH108_3 QH108_4 QH108_6 QH108_7 QH108_8 QH108_95 QH108_96 QH114A QH114B QH114C QH114D QH114E QH114F QH114G QH114H QH114I QH114J QH114K QH115A QH115B QH115C QH115D QH115E QH115F QH115H QH116 QH131_11 QH131_12 QH131_33 QH131_34 QH131_35 QH132_11 QH132_12 QH132_13 QH132_21 QH132_23 QH132_31 QH132_32 QH132_35 QH133_11 QH133_13 QH133_21 QH133_22 QH133_31 QH133_32 QH133_33 QH133_34 QH133_96 memsleep QH111A_1 QH111A_2 QH111A_3 QH111B_1 QH111B_2 QH111B_3 QH111C_1 QH111C_2 QH111D_1 QH111D_2 QH111D_3 QH111E_1 QH111E_2 QH111E_3 QH111F_1 QH111F_2 QH111F_3 QH111G_1 QH111G_2 QH111G_3 landarea /print univariate initial extraction fscore /criteria factors(1) iterate(25) /extraction pc /rotation norotate /save reg(ALL urb) /method=correlation. *** Rural Factor Analysis. filter off. filter by rural. execute. * Variables removed from rural for PCA analysis. * QH105_13. factor /variables QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_41 QH101_42 QH101_71 QH101_81 QH101_91 QH101_96 QH105_11 QH105_12 QH105_21 QH105_22 QH105_23 QH105_31 QH105_61 QH105_96 QH105_12_sh QH105_13_sh QH105_21_sh QH105_22_sh QH105_23_sh QH105_31_sh QH105_96_sh QH108_2 QH108_3 QH108_4 QH108_6 QH108_7 QH108_8 QH108_9 QH108_10 QH108_11 QH108_95 QH108_96 QH114A QH114B QH114C QH114D QH114E QH114F QH114G QH114H QH114I QH114J QH114K QH115A QH115B QH115C QH115D QH115E QH115F QH115H QH116 QH131_11 QH131_12 QH131_33 QH131_34 QH131_35 QH132_11 QH132_12 QH132_13 QH132_21 QH132_23 QH132_31 QH132_32 QH132_35 QH133_11 QH133_12 QH133_13 QH133_21 QH133_22 QH133_31 QH133_32 QH133_33 QH133_34 QH133_96 memsleep QH111A_1 QH111A_2 QH111A_3 QH111B_1 QH111B_2 QH111B_3 QH111C_1 QH111C_2 QH111C_3 QH111D_1 QH111D_2 QH111D_3 QH111E_1 QH111E_2 QH111E_3 QH111F_1 QH111F_2 QH111F_3 QH111G_1 QH111G_2 QH111G_3 landarea /missing meansub /analysis QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_41 QH101_42 QH101_71 QH101_81 QH101_91 QH101_96 QH105_11 QH105_12 QH105_21 QH105_22 QH105_23 QH105_31 QH105_61 QH105_96 QH105_12_sh QH105_13_sh QH105_21_sh QH105_22_sh QH105_23_sh QH105_31_sh QH105_96_sh QH108_2 QH108_3 QH108_4 QH108_6 QH108_7 QH108_8 QH108_9 QH108_10 QH108_11 QH108_95 QH108_96 QH114A QH114B QH114C QH114D QH114E QH114F QH114G QH114H QH114I QH114J QH114K QH115A QH115B QH115C QH115D QH115E QH115F QH115H QH116 QH131_11 QH131_12 QH131_33 QH131_34 QH131_35 QH132_11 QH132_12 QH132_13 QH132_21 QH132_23 QH132_31 QH132_32 QH132_35 QH133_11 QH133_12 QH133_13 QH133_21 QH133_22 QH133_31 QH133_32 QH133_33 QH133_34 QH133_96 memsleep QH111A_1 QH111A_2 QH111A_3 QH111B_1 QH111B_2 QH111B_3 QH111C_1 QH111C_2 QH111C_3 QH111D_1 QH111D_2 QH111D_3 QH111E_1 QH111E_2 QH111E_3 QH111F_1 QH111F_2 QH111F_3 QH111G_1 QH111G_2 QH111G_3 landarea /print univariate initial extraction fscore /criteria factors(1) iterate(25) /extraction pc /rotation norotate /save reg(ALL rur) /method=correlation. * Label the created score variables. rename variables (com1 urb1 rur1=comscore urbscore rurscore). variable labels comscore 'Common wealth score' /urbscore 'Urban wealth score' /rurscore 'Rural wealth score'. * Reverse the urban score - added 7/30/2018 - TC. compute urbscore = 0 - urbscore. * Add a variable used for linking later. filter off. string rowtype_ (A8). compute rowtype_ = 'EST'. * Calculate regressions. ** Area=urban. filter off. filter by urban. execute. * Declare a dataset to be written to in the regression. dataset declare urbancorv. * Run regression of comscore with urbscore. regression /missing listwise /statistics coeff outs R anova /criteria=pin(.05) pout(.10) /noorigin /dependent comscore /method=enter urbscore /outfile=corv(urbancorv). * Activate file of output from regression. dataset activate urbancorv. * Drop all rows of output except the coefficients. select if (rowtype_ = 'EST'). execute. * Delete unnecessary variables before merging. delete variables DEPVAR_ VARNAME_. * Rename variables containing the constant and the coefficient. rename variables CONST_=urbconst urbscore=urbcoeff. * Re-activate the main household data. dataset activate assets. * merge the coefficients. match files /file = * /table = urbancorv /by ROWTYPE_. execute. * Calculate regressions. ** Area=rural. filter off. filter by rural. execute. * Declare a dataset to be written to in the regression. dataset declare ruralcorv. * Run regression of comscore with rurscore. regression /missing listwise /statistics coeff outs R anova /criteria=pin(.05) pout(.10) /noorigin /dependent comscore /method=enter rurscore /outfile=corv(ruralcorv). * Activate file of output from regression. dataset activate ruralcorv. * Drop all rows of output except the coefficients. select if (rowtype_ = 'EST'). execute. * Delete unnecessary variables before merging. delete variables DEPVAR_ VARNAME_. * Rename variables containing the constant and the coefficient. rename variables CONST_=rurconst rurscore=rurcoeff. * Re-activate the main household data. dataset activate assets. * merge the coefficients. match files /file = * /table = ruralcorv /by ROWTYPE_. execute. dataset close urbancorv. dataset close ruralcorv. dataset activate assets. filter off. *** Calculate combined wealth score from Urban and Rural Scores. * Use coefficients from urban and rural regressions above. compute combscor=0. print formats combscor (f11.5). write formats combscor (f11.5). ** Urban. if (urban = 1) combscor=urbconst+urbcoeff*urbscore. ** Rural. if (rural = 1) combscor=rurconst+rurcoeff*rurscore. variable labels combscor 'Combined national wealth score'. execute. compute hhwt = QHWEIGHT/1000000. variable labels hhwt 'HH weights'. formats hhwt (f12.6). weight by hhwt. filter off. execute. frequencies variables=combscor comscore /format=notable /ntiles=5 /statistics=minimum maximum stddev mean /histogram normal /order=analysis. filter off. filter by urban. execute. frequencies variables=combscor urbscore /format=notable /ntiles=5 /statistics=minimum maximum stddev mean /histogram normal /order=analysis. filter off. filter by rural. execute. frequencies variables=combscor rurscore /format=notable /ntiles=5 /statistics=minimum maximum stddev mean /histogram normal /order=analysis. filter off. execute. *Calculate quintiles and scores for data file. compute hhmemwt=QHWEIGHT*hhusual/1000000. variable labels hhmemwt 'HH members weighting for index'. formats hhmemwt (f12.6). weight by hhmemwt. filter off. filter by urban. execute. rank variables=urbscore (A) /rank /ntiles (5) /print=yes /ties=mean. filter off. filter by rural. execute. rank variables=rurscore (A) /rank /ntiles (5) /print=yes /ties=mean. filter off. execute. rank variables=combscor (A) /rank /ntiles (5) /print=yes /ties=mean. variable labels ncombsco 'Combined wealth index' /nurbscor 'Urban wealth index' /nrurscor 'Rural wealth index'. value labels ncombsco nurbscor nrurscor 1 'Lowest' 2 'Second' 3 'Middle' 4 'Fourth' 5 'Highest'. *** Check on quintiles. frequencies variables=ncombsco nurbscor nrurscor. weight by hhwt. ctables /table ( QH101_11+QH101_12+QH101_13+QH101_14+QH101_21+QH101_31+QH101_32+QH101_41+QH101_42+QH101_71+QH101_81+QH101_91+QH101_96+ QH105_11+QH105_12+QH105_13+QH105_21+QH105_22+QH105_23+QH105_31+QH105_61+QH105_96+ QH105_12_sh+QH105_13_sh+QH105_21_sh+QH105_22_sh+QH105_23_sh+QH105_31_sh+QH105_96_sh+ QH108_2+QH108_3+QH108_4+QH108_6+QH108_7+QH108_8+QH108_9+QH108_10+QH108_11+QH108_95+QH108_96+ QH114A+QH114B+QH114C+QH114D+QH114E+QH114F+QH114G+QH114H+QH114I+QH114J+QH114K+QH115A+QH115B+QH115C+QH115D+QH115E+QH115F+QH115H+QH116+ QH131_11+QH131_12+QH131_33+QH131_34+QH131_35+ QH132_11+QH132_12+QH132_13+QH132_21+QH132_23+QH132_31+QH132_32+QH132_35+ QH133_11+QH133_12+QH133_13+QH133_21+QH133_22+QH133_31+QH133_32+QH133_33+QH133_34+QH133_96+ memsleep+ QH111A_1+QH111A_2+QH111A_3+QH111B_1+QH111B_2+QH111B_3+ QH111C_1+QH111C_2+QH111C_3+QH111D_1+QH111D_2+QH111D_3+ QH111E_1+QH111E_2+QH111E_3+QH111F_1+QH111F_2+QH111F_3+ QH111G_1+QH111G_2+QH111G_3+landarea )[S][Mean F8.3] by (ncombsco+nurbscor+nrurscor)[C] /slabels visible=no. * Alternative instead of ctables. *means tables= QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_41 QH101_42 QH101_71 QH101_81 QH101_91 QH101_96 QH105_11 QH105_12 QH105_13 QH105_21 QH105_22 QH105_23 QH105_31 QH105_61 QH105_96 QH105_12_sh QH105_13_sh QH105_21_sh QH105_22_sh QH105_23_sh QH105_31_sh QH105_96_sh QH108_2 QH108_3 QH108_4 QH108_6 QH108_7 QH108_8 QH108_9 QH108_10 QH108_11 QH108_95 QH108_96 QH114A QH114B QH114C QH114D QH114E QH114F QH114G QH114H QH114I QH114J QH114K QH115A QH115B QH115C QH115D QH115E QH115F QH115H QH116 QH131_11 QH131_12 QH131_33 QH131_34 QH131_35 QH132_11 QH132_12 QH132_13 QH132_21 QH132_23 QH132_31 QH132_32 QH132_35 QH133_11 QH133_12 QH133_13 QH133_21 QH133_22 QH133_31 QH133_32 QH133_33 QH133_34 QH133_96 memsleep QH111A_1 QH111A_2 QH111A_3 QH111B_1 QH111B_2 QH111B_3 QH111C_1 QH111C_2 QH111C_3 QH111D_1 QH111D_2 QH111D_3 QH111E_1 QH111E_2 QH111E_3 QH111F_1 QH111F_2 QH111F_3 QH111G_1 QH111G_2 QH111G_3 landarea by ncombsco nurbscor nrurscor /cells mean count stddev. graph /histogram(normal)=combscor /title= 'Distribution of Households by Wealth Scores'. frequencies variables=combscor /format=notable /ntiles=5 /statistics=stddev minimum maximum semean mean median mode skewness seskew kurtosis sekurt /order=analysis. weight off. filter off. write formats combscor urbscore rurscore (f11.5). * Save final dataset of assets. save outfile='assets.sav'. *** Write out scores file. write outfile='scores.dat' table /QHCLUST QHCONCES QHNUMBER combscor ncombsco urbscore nurbscor rurscore nrurscor. execute. * Produce table 2.6 weighted by de jure population to test. weight by hhmemwt. compute total = 0. variable labels total 'Total'. value labels total 0 ' '. ctables /vlabels variables=QHTYPE QHREGION total Ncombsco display=both /table QHTYPE [C] + QHREGION [C] + total [C] BY Ncombsco [C][rowpct.count '%' F8.1, totals [rowpct.count '%' F8.1, count '' F8.0]] /categories variables=Ncombsco total=yes /titles title='Table 2.6 Wealth Quintiles' '' 'Percent distribution of the de jure population by wealth quintiles, according to residence and region, Burkina Faso MIS 2017-18' corner='Residence/region' /slabels visible=no.