140 likes | 435 Views
MICS Data Processing Workshop. Exporting to SPSS. Secondary Data Processing Flow. Export Data from CSPRO. Import Data into SPSS. Recode Variables. Add Sample Weights, Wealth Index and GPS Data. Run Tables. Secondary Data Processing. Exporting data from CSPRO
E N D
MICS Data Processing Workshop Exporting to SPSS
Secondary Data Processing Flow Export Data from CSPRO Import Data into SPSS Recode Variables Add Sample Weights, Wealth Index and GPS Data Run Tables
Secondary Data Processing • Exporting data from CSPRO • Create SPSS data file and syntax file from CSPRO data file and dictionary • Importing data to SPSS • Executing syntax file created by CSPRO • Recoding variables • Creating new variables and recoding old variables
Secondary Data Processing • Adding sample weights • Sample weights are added from weights spreadsheet • Adding wealth index • Wealth index calculated then added to files • Adding GPS data • Geographic location data added to files • Tabulation • Tables are generated from the analysis files
The Export Application • A batch application • uses export to command • Creates SPSS data and description files for 4 types of case • Household (HH) • Household member (HL) • Woman (WM) • Under-five (CH)
The Household Export • Syntax: export to myhh HH1,HH2,MODHH, MODTO, MODWS, MODHC, MODTN, MODOV, MODCD, MODSI; • Creates • c:\mics\spss\myhh.sps • c:\mics\spss\myhh.dat
The Woman Export • Syntax: if HL6(LN) > 0 then export to mywm HH1,HH2,LN,MODWM, MODCM, MODTT, MODMN, MODMA, MODST, MODCP, MODFG, MODDV, MODSB, MODHA, MODHH, MODWS, MODHC; endif; • Creates • c:\mics\spss\mywm.sps • c:\mics\spss\mywm.dat
The Child Export • Syntax: if HL8(LN) > 0 then export to mych HH1,HH2,LN,MODUF, MODBR, MODCE, MODVA, MODBF, MODCA, MODML, MODIM, MODAN, HL4(UF4), ED3A(UF6), MODHH, MODWS, MODHC; endif; • Creates • c:\mics\spss\mych.sps • c:\mics\spss\mych.dat
Exporting a Household Member • Household member’s data stored in rosters • Must export correct data from each roster for each household member • Loop through household members. For each: • loop through each roster until found household member in that roster • store occurrence number in a variable • export data using occurrence numbers
The Household Member Export noline = 999; i = 1; while i <= HH11 do ... export to myhl HH1, HH2, MODHL(hlline), MODED(edline), MODOR(ovline), MODCL(clline), MODDA(daline), MODMM(mmline), MODHH, MODWS, MODHC; i = i + 1; enddo;
Incrementing Line Numbers while i <= HH11 do hlline = HL1(i); edline = noline; {noline = 999} j = 1; while j <= noccurs(MODHL) do if ED1(j) = hlline then edline = j; j = noccurs(MODHL); endif; j = j + 1; enddo; export...; i = i + 1; enddo;
Secondary Data Processing Flow Export Data from CSPRO Import Data into SPSS Recode Variables Add Sample Weights, Wealth Index and GPS Data Run Tables
Reading the Data Into SPSS • To read one of the exported data files into SPSS: • 1. Start SPSS • 2. Open the syntax file associated with the data file • 3. Execute the syntax file • run --> all • 4. Save the file as XX.SAV • where XX is HH, HL, WM or CH.
Saving the Data File • It is helpful to have the syntax file automatically save the data file that it creates • To do so, add the following line to the end of the syntax file: save outfile = 'hh.sav'.