Professional Documents
Culture Documents
Here the type of data can be specified and/or changed, when typing in your own data, or when recoding an existing data set.
2.
10
b.
Scroll down to the Descriptive Statistics submenu and select the Frequencies option. A window opens up. The window is shown below:
c. d.
Select the variable Seatbelt and move it into the Variable(s): box, as shown above. Click OK. The SPSS Output
Frequencies
Statistics Seatbelt N Valid Missing
3042 0
Seatbelt Frequency 1686 578 414 249 115 3042 Percent 55.4 19.0 13.6 8.2 3.8 100.0 Valid Percent 55.4 19.0 13.6 8.2 3.8 100.0 Cumulative Percent 55.4 74.4 88.0 96.2 100.0
Valid
11
3.
Steps to create a frequency table with 2 categorical variables: a. To obtain a frequency table of the number of students who answered the seatbelt question with each of the 5 possible answers, separated by gender, we use the Analyze menu. b. Scroll down to the Descriptive Statistics submenu and select the Crosstabs option. A window opens up. The window is shown below:
c. d. e.
Select the variable Gender and move it into the Row(s): box. Select the variable Seatbelt and move it into the Column(s): box. Click on the Cells button at the bottom of the window. A second window opens up. The window is shown below:
12
f. g.
Select the Row option under the Percentages heading, as shown above. Click Continue. Click OK.
Crosstabs
Gender * Seatbelt Crosstabulation Seatbelt Some times 167 11.4% 247 15.7% 414 13.6%
Gender
Female Male
Total
Example 2.3 Humans Are Not Good Randomizers As part of the survey described in Section 2.2, the students were asked to Randomly pick a number between 1 and 10. The data is recorded in the file pennstate1.sav. 1. Steps to prepare the data: a. Open the data set pennstate1.sav. Steps to create a Pie Chart of one categorical variable: a. To create a pie chart, we use the Graphs menu. b. Scroll down to the Pie option. A window opens up. The window is shown below:
2.
c. d.
Select the Summaries for groups of cases option (the default). Click Define.
13
e.
f. g. h.
Select the variable randnumb and move it into the Define Slices by: box. In the Slices Represent box, select % of cases. Click OK.
14
3 4 5 6 7 8 9 10
11.05%
29.47%
9.47%
12.11%
Note: To obtain the percentages for each slice, use the following steps: I. Double click on the graph. The Chart Editor opens up. II. Click on the Elements menu and scroll down to the Show Data Labels option. III. Close the Chart Editor. 3. Steps to create a Bar Graph of one categorical variable: a. To create a bar graph, we use the Graphs menu. b. Scroll down to the Bar option. A window opens up. The window is shown below:
15
c. d.
Select the Simple option at the top and the Summaries for groups of cases option at the bottom of the window (both the default). Click Define. A window opens up. The window is shown below:
e. f. g.
Select the variable randnumb and move it into the Category Axis: box. If you wish to display percentages, rather than counts, on the y-axis, select the % of cases option under the Bars Represent heading. Click OK.
16
Graph
60
50
40
Count
30
20
10
0 1 2 3 4 5 6 7 8 9 10
randnumb
Example 2.4 Lighting the Way to Nearsightedness A survey of 479 children found that those who had slept with a nightlight or in a fully lit room before the age of 2 had a higher incidence of nearsightedness later in childhood. The raw data consisted of two categorical variables, each with three categories. The data can be found in Example 2.2 of the book. The data is not recorded in an existing file, so the data set needs to be created. 1. Steps to prepare the data: a. Open a new data file. b. Enter the 9 frequencies (155, 153, 34, 15, 72, 36, 2, 7, 5) in the first column. c. In the second column, indicate how the children slept: 1 = darkness, 2 = nightlight, 3 = full light (if the order indicated above is used, type 1, 2, 3, 1, 2, 3, 1, 2, 3). d. In the third column, indicate the incidence of nearsightedness: 1 = none, 2 = some, 3 = high (if the order indicated above is used, type 1, 1, 1, 2, 2, 2, 3, 3, 3). e. Use the Variable View tab at the bottom of the SPSS Data Editor window to name each of the three variables (e.g. count, sleep, eyesite). f. Save the file. Steps to prepare the data for a clustered bar graph: a. The count variable needs to be designated as a weighting variable. For this we use the Data menu.
2.
17
b.
Scroll down to the Weight Cases option. A window opens up. The window is shown below:
c. d. e. 3.
Select the Weight cases by option. Select the variable count and move it into the Frequency Variable: box. Click OK.
Steps to create a Bar Graph of two categorical variables: a. To create a bar graph, we use the Graphs menu. b. Scroll down to the Bar option. A window opens up. The window is shown below:
c.
Select the Clustered option at the top and the Summaries for groups of cases option at the bottom of the window.
18
d.
e. f. g. h.
Select the variable eyesite and move it into the Category Axis: box. Select the variable sleep and move it into the Define Clusters by: box. Under the Bars Represent heading, select the % of cases option. Click OK.
Note: SPSS creates clustered bar graphs in a slightly different way as presented in the book. To obtain the distribution of Myopia level after sleeping in darkness, combine the three blue bars. To obtain the distribution of Myopia level after sleeping with a night light, combine the three green bars. To obtain the distribution of Myopia level after sleeping in full light, combine the three tan bars.
19
Graph
100.0%
sleep
Darkness Night light Full light
80.0%
Percent
60.0%
40.0%
20.0%
eyesite
Cases weighted by count
2.
20
b.
Scroll down to the Descriptive Statistics submenu and select the Explore option. A window opens up. The window is shown below:
c. d. e.
Select the variable rtspan and move it into the Dependent List: box. Select the Statistics option under the Display heading on the bottom left of the window. Click on the Statistics button. A second window opens up. The window is shown below:
f. g.
Select both the Descriptives and the Percentiles options, as shown above. Click Continue. Click OK.
21
Explore
Descriptives rtspan sex Female Mean Median Variance Std. Deviation Minimum Maximum Range Interquartile Range Mean Median Variance Std. Deviation Minimum Maximum Range Interquartile Range Statistic 20.0170 20.0000 3.110 1.76357 12.50 23.25 10.75 2.00 22.5575 22.5000 2.125 1.45759 18.00 26.00 8.00 2.00 Std. Error .17377
Male
.15627
rtspan rtspan
10 18.00 21.00
90 22.00 24.50
The five-number summary may be obtained by combining the minimum and maximum in the first output-box with the 25th, 50th, and 75th percentiles in the second output-box. In this example the five-number summaries are: Males Females Min = 18.0 Min = 12.5 Q1 = 21.5 Q1 = 19.0 Median = 22.5 Median = 20.0 Q3 = 23.5 Q3 = 21.0 Max = 26.0 Max = 23.25
22