1 / 22

MICS Data Processing Workshop

MICS Data Processing Workshop. CSPRO Applications. Creating a Data Entry Application. We’ll now create a data entry application The application will make use of the test dictionary and form Before creating the application, I’ll briefly discuss order of operations in CSPRO data entry path

ciqala
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 CSPRO Applications

  2. Creating a Data Entry Application • We’ll now create a data entry application • The application will make use of the test dictionary and form • Before creating the application, I’ll briefly discuss • order of operations in CSPRO • data entry path • most common data entry commands

  3. CSPRO Procedure Types • Global procedure (proc global) • logic executed when application begins/ends • Form file procedure (proc form_file_name) • logic executed before/after each case • Level procedure (proc level_name) • logic executed before/after level • group procedure (proc group_name) • logic executed before/after a form or roster • variable procedure (proc variable_name) • logic executed before/after variable’s field entered

  4. Preproc and Postproc • Procedures are broken into two parts • Preproc • logic executed before item • for example, skip a variable • Postproc • logic executed after item • for example, check if data entered is consistent • for example, skip to a variable • If no explicit statement, logic is in the postproc by default

  5. Order of Operations • Global proc • Form file preproc • Level 1 preproc • Form 1.1 preproc • Field 1.1.1 preproc • Field 1.1.1 postproc • ...other form 1 fields • Form 1.1 postproc • ...other level 1 forms • Level 2 preproc • Form 2.1 preproc • Field2.1.1 preproc • Field 2.1.1 postproc • Form 2.1 postproc • ...other level 2 forms • Level 2 postproc • Level 1 postproc • Form file postproc

  6. The Data Entry Path • The data entry path contains all of the questions that a respondent should be asked • It is determined by • the type of the questionnaire • the responses to questions in conjunction with • questionnaire skips • questionnaire filters

  7. Controlling the Data Entry Path • CSPRO allows one to control completely the data entry path • The first step is to • open DE application • go to options --> data entry • select system controlled • (while you are there, make all alphanumeric variables upper case)

  8. Questionnaire Skips • CSPRO has 2 ways of implementing skips • The skip to command • if the variable being skipped to is in a single record • To skip to a variable or group use skip to variable_name; skip to group_name; • The skip to next command • if the var. being skipped to is in a multiple record

  9. Reentering • To force the data entry operator to reenter a field (e.g., if the data entered are inconsistent) use reenter;

  10. if command • Use to check for a condition: if HH9 <> 1 then skip to HH16; endif; if not HH6 in 1,2 then reenter; endif;

  11. Ending a Level • You must manually end a level if • the last variable in the data path is not the last variable on the questionnaire • you have entered the last woman or under-five questionnaire • This is accomplished using the endlevel command

  12. The ENDLEVEL Command • The effect of the endlevel command depends upon its context • In field/roster/form proc, passes control to the level postproc • In level preproc or postproc, passes control to postproc of next highest level • In postproc of level 1, pass control to the form file’s postproc

  13. Ending a Group • A group is a record or roster • A group is ended by the endgroup command • The effect of the command depends upon context: • In an item procedure, passes control to the current group’s postproc • In the preproc of the group, skips the entire group and passes control to the group’s postproc

  14. Working Variables • Working variables must be declared in the global procedure • Numeric working variables can be declared together • numeric var1 var2; • Alphanumeric working variables are declared separately • alpha(length) avar1; • alpha(length) avar2;

  15. Setting Parameters • Global parameters should be declared in the preproc of the forms procedure • e.g., minimum age at first birth • Assign a value to a working variable created for the purpose • Comment your parameter using braces • For example • minab = 144; {minimum age at first birth in months}

  16. Recoding Variables • To recode variables, use the recode command • The following logic recodes women’s age into groups recode WM9 => agegrps; 15-19 => 1; 20-24 => 2; => 3; endrecode;

  17. Generating Error Messages • If the cluster number is invalid, the following code will display an error message errmsg(0010);

  18. Providing an Error Message • Error messages must have user-defined text to be effective • For the preceding example, one would add a line 0010 cluster number invalid • To view the error message file • to do so, right click on the message tab while editing a procedure’s logic

  19. Error Message Parameters • The values of any variables listed after the error message number will be passed to the error message • Parameters are displayed in the error message using • %d for numeric values • %s for alphanumeric values

  20. Creating the Application • Select file --> new • Select object type data entry application • Use file name: test • Use folder: c:\mics\cspro\test • Click next • Click yes when prompted to use the test form • Click finish

  21. Modifying the Application • Add logic to • check the household number is consistent • display message and data entry if not • implement the region skip • check the date of interview is consistent • display message and require reentry if not • Compile and then save your application

  22. Testing the Application • Click once on execute button on toolbar (traffic light) • Use nodata.dat datafile • Enter a case

More Related