lectures (topic-2, lec-4)

Upload: mipimipi03

Post on 08-Apr-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/7/2019 Lectures (Topic-2, Lec-4)

    1/5

    Training Course on SPSS for Professionals, Researchers an

    Students

    Lecture 04: Data Manipulation II

    Data Manipulation II includes:

    A. Splitting File

    B. Case Selection

    C. Selecting a Random Sample

    D. Weight Cases

    To learn the above manipulation techniques, let us enter the following data into SPSS and save it in

    computer.

    Subject Sex Age Religion EducationIncome per

    day

    1 1 25 1 15 100

    2 1 32 2 15 200

    3 1 30 3 16 150

    4 2 24 1 13 125

    5 2 20 2 12 1206 2 27 3 19 125

    7 1 25 1 12 175

    8 1 33 2 13 200

    9 2 39 3 15 120

    10 2 40 1 17 125

    11 1 32 2 11 135

    12 2 27 3 10 130

    13 1 37 3 14 100

    14 1 19 2 12 150

    15 2 25 1 15 120

    Sex : 1 = Male, 2 = Female

    Religion : 1 = Muslim, 2 = Hindu, 3 = Christian

    A. Splitting File

    You may encounter some situations where you need to analyze data based on the categories of one

    or more categorical variables. For example, you might seek to know the picture of income or

    education among the sexes either for comparison purposes or for organizing the output by groups.

    14th Batch (March April, 2011)Page 1 of 5

  • 8/7/2019 Lectures (Topic-2, Lec-4)

    2/5

    Training Course on SPSS for Professionals, Researchers an

    Students

    To do this you have the SPSS tool Split File.

    Split File splits the data file into separate groups for analysis based on the values of one or more

    grouping variables. If you select multiple grouping variables, cases are grouped by each variable

    within categories of the prior variable on the Groups based on list. For example, if you select Sex as

    the first grouping variable and Religion as the second grouping variable, cases will be grouped by

    Religion classification within each Sex category.

    Note that you can specify up to eight grouping variables and cases should be sorted by values of the

    grouping variables.

    1st Approach: Group Comparison

    Suppose you want to compare income of the sexes. Then it would be convenient if the results are

    shown in a single table for both sexes separately. So to get output in that format you should do

    splitting the data file. And you can split your data file just following the instructions given below:

    Click on Data (Menu Bar) and then Split File

    Select Compare Groups

    Now select the variable Sex and send it to the box Groups Based on:

    ClickOK

    Now if you carry out any analysis on this data file you will get the results in your desired format.

    Again you may seek to compare income among people of different religions and sexes at a time.

    Repeat the above steps. Here with Sex variable select the variable Religion and send it to the box

    Groups Based on, click OK.

    2nd Approach: Organizing Output by Groups

    Suppose you want the results are displayed separately in different table for each split-file group.

    For example, you might desire to summarize the information on education variable for people of

    varied religions separately in different tables. To do this, follow the instructions given below:

    Click on Data (Menu Bar) and then Split File

    Select Organize output by groups

    Now select the variable Religion and send it to the box Groups Based on:

    ClickOK.

    14th Batch (March April, 2011)Page 2 of 5

  • 8/7/2019 Lectures (Topic-2, Lec-4)

    3/5

    Training Course on SPSS for Professionals, Researchers an

    Students

    Similarly try for other variables (say Sex).

    You can use the Toolbar item to Split a data file. Just click on the Split File tool. And the Split File

    box will appear. Now you can do all the steps as before.

    B. Case Selection

    Sometimes you may have special interest on particular cases only. To cope with this situation,

    SPSS will have for you the Select Cases option. For instance, suppose you want to analyze data

    considering only male respondents/cases. Then you have to select only male cases. To do it, use the

    following instructions:

    Click on Data (Menu Bar)

    Select Cases

    Select If Condition is Satisfied

    Click on If

    Select the variable sex and send it to the expression box.

    Click on = sign on the calculator pad, click on 1 and then Continue

    Select Unselected Cases are Filtered

    Click on OK.

    Again suppose you want to study only Hindu and Christian people. Then select these cases

    following the instruction given below:

    Click on Data, Select Cases, Select If condition is satisfied

    Click on If, send the variable Religion to the expression box

    Click on sign and 2 in the calculator pad

    Click on OK.

    Again you might want to study only Muslim females. You can select the desired cases simply by

    taking Sex and Religion variables in the expression box of Select cases: If and writing them as

    follows:

    sex = 2 & religion = 1

    Now click on Continue and then OK.

    14th Batch (March April, 2011)Page 3 of 5

  • 8/7/2019 Lectures (Topic-2, Lec-4)

    4/5

    Training Course on SPSS for Professionals, Researchers an

    Students

    C. Selecting a Random Sample

    You can also take random sample of cases. The sample size may be an approximate percentage of

    all cases or you can exactly mention the sample size. Suppose you will select a random sample of

    size 40% of all cases in your data file. To do this, follow the instructions below:

    Click on Data (Menu Bar)

    Select Random Sample of Cases

    Click on Sample

    Select Approximately and write 40% in the boxClick on Continue and then OK.

    Again suppose you will select a random sample of size 7 from all cases in your data file. To do this,

    follow the instructions below:

    Click on Data (Menu Bar)

    Select Random sample of Cases

    Click on Sample

    Select Exactly and write 7 in the 1st box and 15 in the 2nd box

    Click on Continue and then OK.

    You can also take a sample just mentioning the range of cases. For example, you may need to study

    some consecutive cases from anywhere of the data file (say, cases from 5 to 12). To do this, follow

    the instructions given below:

    Click on Data (Menu Bar)

    Select Based on time or case range

    Click on Range, write 5 in the First Case box and write 12 in the Last Case box

    Click on Continue and then OK.

    D. Weight Cases

    Weight Cases gives cases different weights for statistical analysis. The values of the weighting

    variable should indicate the number of observations represented by single cases in your data file.

    Note that Cases with zero, negative, or missing values for the weighting variable are excluded from

    14th Batch (March April, 2011)Page 4 of 5

  • 8/7/2019 Lectures (Topic-2, Lec-4)

    5/5