Create a Child Level File


Return to Nutritional Data Page 5

 

Creating three child level files

1. FILE/OPEN.... select the household file, EX100.SAV.

2. Select the first block of variables wanted in the child level file, V001 to V012, by first marking them using one of following two methods:

a) use left mouse button and drag along the blue area containing the variable names, in this case from V001 through V012. From the EDIT command on toolbar, choose COPY.

b) use right mouse button and drag along blue area with variable names, then from pop-up menu, choose COPY.

NOTE: In SPSS only one block of variables can be selected at any one time. For example, you mark variables 1 through 5, then you want variables 20 through 25 - if you mark the second group, the first group will be lost. Therefore, in this example, variable selection has to be done in stages.

3. To PASTE the first set of selected variables into a new file, select FILE/NEW/DATA.

4. Mark the columns needed in the new file by the same method described above in step 2. Unlike in the original datafile, after selecting variables, only the first row will appear to be marked. You can mark more columns than needed if not sure how many variables there are, but do not mark fewer. If you mark more, the spare columns must be deleted at the end of the session. In this example, a total of 31 variables will be added to the file so you can mark just 31 columns, or more than that.

5. When columns are marked, go to the first column and select EDIT/PASTE. The variables should be copied from the household file, along with all variable names and cases.

6. Save the file by selecting SAVE AS... and give a filename, in this example we will call the first file CHILD1.SAV.

7. Reselect the household file by choosing FILE and OPEN. Using the procedure in step 2, mark the next block of variables, HW1$1 through HW19$1. These are data on the first child in the household. Select EDIT/COPY.

8. Reselect the CHILD1.SAV file, and mark the last 19 (or more) columns. Select EDIT/PASTE.

9. Mark and delete any columns at the end of the variable list which were previously marked, but not used (if any). These columns will have a VAR0000x name at the top, but no data.

10. Mark and delete any cases which do not have any children (i.e. HW1$1 through HW19$1 are all missing). Mark cases the same way you mark columns.

11. For purposes of merging later, some variables names must be changed because all names have to be the same if you are adding cases to a file with the same structure. (Note that this is not the case of you are merging new variables into an existing file). To change the variable names, first go to the blue area of the name you want to change HW1$1, use the left mouse button, select DEFINE VARIABLE..., and type the new name HW1, then enter. Change all HW1$1 through HW19$1 by deleting the part of the name "$1". Variables V001 - V012 do not have to be changed because these will be the same in all files created.

12. SAVE the file when done. CHILD1.SAV contains all information on the first child in the household.

13. Repeat all of the above steps to create a child level file for the second child in the household.

In step 6, save this file as CHILD2.SAV. In step 7, instead of selecting HW1$1 — HW19$1, select HW1$2 — HW19$2. These 19 variables contain the information for the second child in the household. Rename the variables exactly as described in step 11, but delete the part of the name ending in "$2".

14. Repeat again all steps to create a file containing the third child’s data. Save it as CHILD3.SAV. Select HW1$3 to HW19$3.

 Return to Top of Page