MICS Data Processing Workshop Adding the Wealth Index and GPS Data
Mar 27, 2015
MICS Data Processing Workshop
Adding the Wealth Index and GPS Data
Secondary Data Processing Flow
Export Data from CSPRO
Import Data into SPSS
Recode Variables
Add the Wealth Index and GPS Data
Run Tables
Sampling
The probability of selecting a household for MICS interviews was not equal across all of Popstan
In North region– 28 households were selected per 10,000
In West Region– 5 households were selected per 10,000
Overall– 10 households were selected per 10,000
Sample Weights
Sample weights are used to adjust the sample to produce accurate estimates for the whole country
Sample weights are the inverse of the relative probabilities of selection
For example, the weights for North and West region– North region 10/28 = 0.36– West region 10/5 = 2
Weights should always be used when tabulating
Sample Weights Objects
WEIGHTS.XLS– spreadsheet that calculates weights
WEIGHTS_TABLE.SPS– SPSS program that provides input data for spreadsheet
WEIGHTS.SPS– SPSS program that defines structure of spreadsheet’s
output WEIGHTS_MERGE.SPS
– SPSS program that merges weights onto the MICS data files
Steps in Adding Weights
1. Update weights.xls to have one row per strata/cluster
2. Add sampling information to weights.xls3. Adapt strata definitions in weights_table.sps4. Execute weights_table.sps program5. Copy resulting table’s contents into “Calculations”
sheet of weights.xls6. Save “Output” sheet of weights.xls as weights.csv in
directory c:\mics\weights7. Execute weights_merge.sps program
Step 1: Updating weights.xls
Spreadsheet has one row per cluster Adjust the number of rows in “Calculations” to
reflect the number of clusters in your survey– Do so by copying and pasting internal rows
Check that the totals cells have the correct ranges
Adjust the number of rows in “Output” Check that data in “Output” is correct
Step 2: Adding Sampling Info
Open weights.xls Complete the “stratum sampling
fraction” column Complete the “cluster sampling fraction”
column– Enter 1 if your weights don’t vary by cluster
within a stratum– Otherwise enter the cluster sampling fraction
Step 3: Defining Strata
Your survey has sampling strata. Examples:– all combinations of area (HH6) and region (HH7)– region
Lines 3-10 of weights_table.sps define the standard survey’s strata
Updates these statements to reflect the definition of strata in your country
Step 4: Executing weights_table.sps
Open weights_table.sps in SPSS Select Run--->all Check output for error messages Examine output table
Step 5: Copying Output
Double-click inside the table to open it Select the household results Paste them in the “Calculations” sheet of
weights.xls Repeat for the women and children
results Save weights.xls
Step 6: Saving the Output Sheet
Click on the “output” tab in the weights.xls spreadsheet
Select File ---> Save As Navigate to the directory c:\mics\weights Change the “save as type:” to “CSV (Comma
delimited)(*.csv)”– file name should automatically change to
weights.csv Click the save button
Step 7: Merging Weights into SPSS
Open weights_merge.sps in SPSS Select Run ---> all Check output for error messages Open each data file—HH, HL, WM and CH
— and check that weights were correctly added
Useful Merging Commands
get file = ‘filename.sav’.
sort cases by varlist.
save outfile = ‘filename.sav’
[/keep varlist]
[/drop varlist]
[/rename = (BI1 = BR1) (BI2 = BR2)].
erase file = ‘filename.sav’.
MATCH FILES Command
match files/file = *
/file = ‘filename.sav’ /by varlist.
match files/file = *
/table = ‘filename.sav’ /by varlist.
WEIGHTS_MERGE.SPS
Source Files: c:\mics\spss\weights.sav
Destination Files: hh.sav, hl.sav, wm.sav, ch.sav
Match By: HH1
Variables Added: xxweight wherexx is HH, WM or CH
The Wealth Index
The MICS wealth index is an attempt to measure the socio-economic status of households
The analysis section of this process will be done at the 3rd workshop
The goal today is to discuss the programs and how they work
Wealth Index Programs
There are two program related to the wealth index
WEALTH.SPS– This program calculates the wealth index
WEALTH_MERGE.SPS– This program adds the wealth index to the
SPSS data files
WEALTH.SPS
Calculates a wealth index using factor analysis
Inputs:– dichotomous variables related to
household/individual assets Outputs:
– wlthscor - a wealth index score for each household
– wlthind5 - a wealth quintile for each household
A Recoding Example
Code below creates variable with value 1 if household owns a car, value 0 otherwise
compute car = 0.
if (hc10e = 1) car = 1.
variable label car 'Household member owns: car/truck'.
value label car 0 'No' 1 'Yes'.
The Rest of the Program
The factor statement– creates wealth index score
The compute statement– generates household member weights
The rank statement– creates wealth quintiles
The save outfile statement– saves wealth variables in wealth.sav file
WEALTH_MERGE.SPS
Source Files: c:\mics\spss\wealth.sav
Destination Files: hh.sav, hl.sav, wm.sav, ch.sav
Match By: HH1, HH2
Variables Added: wlthscor, wlthind5
GPS Readings
Some countries will take GPS readings during their MICS survey
These readings allow researchers to merge diverse data sets using a cluster’s location
Data sets that can be linked to the MICS data– Climate data– Agricultural data
The GPS Form
GEOGRAPHIC POSITIONING SYSTEM FORM GP
GP1. Cluster number:___ ___ ___
GP2. Area:Urban........................................... 1Rural ............................................ 2
GP3. Region:Region 1 ...................................... 1Region 2 ...................................... 2Region 3 ...................................... 3Region 4 ...................................... 4
GP4. Operator name and number:
Name ___ ___
GP5. Day/Month/Year of measurement: ___ ___ / ___ ___ / ___ ___ ___ ___
GP6. Waypoint name:___ ___ ___ ___ ___ ___
N/S/E/W Degrees Decimal degrees
GP7. Latitude: N S ___ ___ . ___ ___ ___ ___ ___
GP8. Longitude: E W ___ ___ ___ . ___ ___ ___ ___ ___
GPS Programs
GPS.DIC– CSPRO dictionary
GPSENTRY.ENT– CSPRO data entry application
GPS.SPS– SPSS version of GPS.DIC
GPS_MERGE.SPS– reads in GPS data and merges it onto SPSS data
files
GPS_MERGE.SPS
Source Files: c:\mics\spss\gps.dat
Destination Files: hh.sav, hl.sav, wm.sav, ch.sav
Match By: HH1
Variables Added: all variables on GPS form