1 / 16

MICS Data Processing Workshop

MICS Data Processing Workshop. Recoding in 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. SPSS Working Directory. Right-click on SPSS icon Select Properties

birch
Download Presentation

MICS Data Processing Workshop

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MICS Data Processing Workshop Recoding in SPSS

  2. Secondary Data Processing Flow Export Data from CSPRO Import Data into SPSS Recode Variables Add Sample Weights, Wealth Index and GPS Data Run Tables

  3. SPSS Working Directory • Right-click on SPSS icon • Select Properties • Click on Start-in box • Type in C:\RECODING

  4. Analysis Files • 4 types of analysis files\cases • Households • Household members • Women • Children

  5. Program Names • MAKEWM • Creates women’s analysis file • MAKECH • Creates children’s analysis file

  6. Program Functions • Programs add needed variables • 2 sources of new variables • Existing variables that are recoded • Age  age in 5-year groups • Combinations of existing variables • Level and grade of education  years of education

  7. Recoding Variables • Some variables recoded in MAKE**.SPS • Important variables (e.g., age) • Frequently used variables • Some variables are recoded in tab programs • Variables used in only a few tables • Unusual recoding of a variable

  8. Opening and Saving Files • To open a data file get file = ‘filename.sav’. • To save a data file save outfile = ‘filename.sav’.

  9. The recode Command • To recode a variable recode HL5 (lo thru 70 = copy) (71 thru 96 = 70) (98,99 = 99) into memage. • Useful keywords • lo and hi • copy • sysmis • else

  10. The compute command • Creates a new variable • compute newvar = 1. • The compute command has built-in functions • compute newvar = trunc(oldvar). • compute newvar = rnd(oldvar).

  11. Defining Variable and Value Labels • To define a variable label variable label memage "Age". • To define a value label set value label memage 70 ”70+" 99 ”Missing/DK“. • Defines value labels for unusual values • Values 0-70 will be labeled using their actual value

  12. The if Command compute fuelelec = 0. if (hc6 = 1) fuelelec = 1. variable label fuelelec 'Household fuel type: electricity'. value label fuelelec 0 'No' 1 'Yes'.

  13. The do if Command *total children ever born. do if (CM1 = 1). compute ceb = CM9. else. compute ceb = 0. end if.

  14. Selecting Cases to Process • The select command select if (HL5 >= 5 and HL5 <= 14). • Deletes unselected cases from memory • The filter command filter by CM9. filter off. • Selects cases for whom filter variable > 0 • Unselected cases are ignored by subsequent commands

  15. Other Useful Commands • To set a variable’s format format memage(f5.0). • To define missing values missing values wdob (9999). • To count occurrences of a value count ways = v1 v2 v3 (1).

  16. Using the Paste Option to Write Code • Set up the command using SPSS’s menu system • Click on the “Paste” button • SPSS will “paste” the code necessary to execute the command in the active syntax window • This is a great way to learn SPSS’s language

More Related