Download Adding Subtotals to a Table

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Foundations of statistics wikipedia , lookup

History of statistics wikipedia , lookup

Categorical variable wikipedia , lookup

Transcript
1
SPSS Tables: Intermediate
Subtotals
First open the manners.sav file and create the basic table shown below.












Go to Analyze  Tables  Custom Tables
Drag and drop the variable degree into the Rows dimension.
Drag and drop the variable swear into the Columns dimension.
Right click on degree in the table layout preview.
Select Categories and Totals from the pop-up menu.
Check the Show Total box on the right.
Change the label to TOTAL (all capitals) and click Apply.
Right click on degree in the table layout preview.
Click on the Summary Statistics icon in the lower left.
Select Row N% from the Statistics box.
Click the right arrow to move it into the Display box.
Click Apply to Selection and then click Okay.
For each item I name, please tell me if that's something you've done in
the last few months, or not. This is confidential and for statistical
purposes only: Used a swear-word in public.
Yes, something done in the last
No, not done in the last few
few months
months
Count
Highest degree
Less than high school
Row N %
Row N %
44
43.6%
57
56.4%
High school
126
41.4%
178
58.6%
Some college
115
44.2%
145
55.8%
College degree
117
36.1%
207
63.9%
TOTAL
402
40.6%
587
59.4%
Adding Subtotals to a Table:
Suppose we want to create two subcategories: “NO COLLEGE” and “COLLEGE.”




Count
Use the Dialog Recall tool.
Right click on degree in the table layout preview.
Select Categories and Totals from the pop-up menu.
Select category 2 in the Value(s ) list in the Display box.
Created by Sue McMillen for SPSS Tables: Intermediate
2






Click the Add Subtotals button.
Type the label NO COLLEGE and click Continue.
Select category 4 in the Value(s ) list in the Display box.
Click the Add Subtotals button.
Type the label COLLEGE and click Continue.
Click Apply and then click Okay.
For each item I name, please tell me if that's something you've done in
the last few months, or not. This is confidential and for statistical
purposes only: Used a swear-word in public.
Yes, something done in the last
No, not done in the last few
few months
months
Count
Highest degree
Row N %
Less than high school
Count
Row N %
44
43.6%
57
56.4%
High school
126
41.4%
178
58.6%
NO COLLEGE
170
42.0%
235
58.0%
Some college
115
44.2%
145
55.8%
College degree
117
36.1%
207
63.9%
COLLEGE
232
39.7%
352
60.3%
TOTAL
402
40.6%
587
59.4%
Excluding a Category from a Subtotal:
Suppose we want to exclude the “Less than high school” category from the “NO COLLEGE” subtotal.





Use the Dialog Recall tool.
Right click on degree in the table layout preview.
Select Categories and Totals from the pop-up menu.
Select category 1 in the Value(s ) list and move it to the Exclude box.
Click Apply and then click Okay.
Compare the resulting table on the next page with the table above.
For each item I name, please tell me if that's something you've done in
the last few months, or not. This is confidential and for statistical
purposes only: Used a swear-word in public.
Yes, something done in the last
No, not done in the last few
few months
months
Count
Created by Sue McMillen for SPSS Tables: Intermediate
Row N %
Count
Row N %
3
Highest degree
High school
126
41.4%
178
58.6%
NO COLLEGE
126
41.4%
178
58.6%
Some college
115
44.2%
145
55.8%
College degree
117
36.1%
207
63.9%
COLLEGE
232
39.7%
352
60.3%
TOTAL
358
40.3%
530
59.7%
Hiding Categories in a Subtotal:
You may want to show only the subtotals you created.










Use the Dialog Recall tool.
Right click on degree in the table layout preview.
Select Categories and Totals from the pop-up menu.
Select the COLLEGE category in the Display box.
Click the Edit button.
Check the Hide box and click Continue.
Select the No COLLEGE category in the Display box.
Click the Edit button.
Check the Hide box and click Continue.
Click Apply and then click Okay.
For each item I name, please tell me if that's something you've done in
the last few months, or not. This is confidential and for statistical
purposes only: Used a swear-word in public.
Yes, something done in the last
No, not done in the last few
few months
months
Count
Highest degree
Row N %
Count
Row N %
NO COLLEGE
126
41.4%
178
58.6%
COLLEGE
232
39.7%
352
60.3%
TOTAL
358
40.3%
530
59.7%
Created by Sue McMillen for SPSS Tables: Intermediate
4
Creating a Table with Shared Categories:
Your data may contain numerous items with the same possible responses, such as Poor, Fair, Good, and
Excellent. You may wish to stack these variables in a table and have the common responses displayed as
labels in the other dimension of the table.






Open the file gssft.sav
Go to Analyze  Tables  Custom Tables
Drag the variable happy into the rows bar of the canvas pane.
Stack the variable hapmar at the bottom of the table.
Go to the Category Position drop down menu in the lower right and select Row Labels in
Columns.
Click Okay.
VERY HAPPY
PRETTY
NOT TOO
HAPPY
HAPPY
GENERAL HAPPINESS
Count
484
891
104
HAPPINESS OF
Count
446
240
20
MARRIAGE
Tables with Scale Variables:
We will use the three scale variables in the manners.sav file: age, ageyngst, and numchild.




Go to Analyze  Tables  Custom Tables
Stack the variables age, numchild, and ageyngst in the Columns dimension.
Go to the Position drop down menu at the bottom and select Rows.
Click Okay.
Total number of
Age
Mean
46
children in
age of youngest
household
child
2
7
Created by Sue McMillen for SPSS Tables: Intermediate
5
Adding Other Statistics:





Use the Dialog Recall tool.
Right click on age in the table layout preview.
Select Summary Statistics from the pop-up menu.
Move Standard Deviation, Range, and Median into the Display list.
Click Apply to All and then Okay.
Total number of
Age
children in
age of youngest
household
child
Mean
46
2
7
Median
44
2
7
Range
74
9
17
Standard Deviation
17
1
5
Adding Other Statistics to a Single Variable:







Use the Dialog Recall tool.
Right click on ageyngst in the table layout preview.
Select Summary Statistics from the pop-up menu.
Move Valid N and Missing into the Display list.
Click Apply to Selection.
Go to the Position drop down menu at the bottom and select Rows.
Click Okay.
Total number of
Age
children in
age of youngest
household
child
Mean
46
2
7
Median
44
2
7
Range
74
9
17
Standard Deviation
17
1
5
Valid N
392
Missing
618
Test Statistics and Tables
Open the file gssft.sav
 Go to Analyze  Tables  Custom Tables
Created by Sue McMillen for SPSS Tables: Intermediate
6







Drag the variable hapmar into the rows bar of the canvas pane.
Drag the variable sex into the columns bar.
Right click on hapmar in the table layout preview and select Summary Statistics.
Move Row N% to the Display list.
Click Apply to Selection.
Go to the Position drop down menu at the bottom and select Rows.
Click Okay.
Respondent's Sex
Male
HAPPINESS OF
VERY HAPPY
Count
MARRIAGE
Row N %
PRETTY HAPPY
NOT TOO HAPPY
259
187
58.1%
41.9%
141
99
58.8%
41.3%
9
11
45.0%
55.0%
Count
Row N %
Count
Row N %
Female
Gender and marital happiness may be independent but we should do a Chi Square test.
 Use the Dialog Recall tool.
 Click the Test Statistics tab.
 Check the Tests of independence (Chi-square) box.
 Click Okay.
Pearson Chi-Square Tests
Respondent's
Sex
HAPPINESS OF
Chi-square
MARRIAGE
df
Sig.
1.442
2
.486
Results are based on nonempty rows and columns in each
innermost subtable.




Use the Dialog Recall tool.
Stack the variable happy below the variable hapmar.
Stack the variable postlife to the right of the variable sex.
Click Okay.
Created by Sue McMillen for SPSS Tables: Intermediate
7
Comparing Column Means
Suppose we want to test for age differences in how people voted in 1996. The Column Means tests
check for a relationship between a scale variable in the row dimension and a categorical variable in the
columns dimension.




Use the Dialog Recall tool and Reset.
Drag the variable age into the rows bar of the canvas pane.
Drag the variable vote96 into the columns bar.
Click Okay.
DID R VOTE IN 1996 ELECTION
REFUSED TO
VOTED
DID NOT VOTE
INELIGIBLE
ANSWR
Mean
Mean
Mean
Mean
Age of respondent




43
38
27
36
Use the Dialog Recall tool.
Click the Test Statistics tab.
Check the Compare column means (t-test) box.
Click Okay.
Comparisons of Column Meansa
DID R VOTE IN 1996 ELECTION
REFUSED TO
Age of respondent
VOTED
DID NOT VOTE
INELIGIBLE
ANSWR
(A)
(B)
(C)
(D)
BC
C
Results are based on two-sided tests assuming equal variances with significance level
0.05. For each significant pair, the key of the smaller category appears under the
category with larger mean.
a. Tests are adjusted for all pairwise comparisons within a row of each innermost
subtable using the Bonferroni correction.
The table above means that there is a significant difference between the mean age in column (A) and
the mean age in columns (B) and (C). There is also a significant difference between the mean in column
(B) and the mean in column (C). However the mean age for column (D) does not differ significantly from
any of the other column means.
See the graph on the next page for a visual representation of this.
Created by Sue McMillen for SPSS Tables: Intermediate
8
Comparing Column Proportions
Suppose we want to test for age differences in how people voted in 1996. The Column
Proportions tests check for a relationship between a categorical variable in the row dimension
and a categorical variable in the columns dimension.





Use the Dialog Recall tool and Reset.
Drag the variable degree into the rows bar of the canvas pane.
Drag the variable postlife into the columns bar.
Right click on degree in the table layout preview and select Summary Statistics.
Move Column N% into the Display list and move Count out of the Display list.

Click Apply to Selection.



Click the Test Statistics tab.
Check the Compare column proportions (z-test) box.
Click Okay.
Created by Sue McMillen for SPSS Tables: Intermediate
9
BELIEF IN LIFE AFTER DEATH
Highest degree
YES
NO
Column N %
Column N %
Less than HS
6.0%
16.0%
High school
56.8%
49.0%
Junior college
10.0%
6.3%
Bachelor
17.5%
19.9%
Graduate
9.8%
8.7%
Comparisons of Column Proportionsa
BELIEF IN LIFE AFTER DEATH
Highest degree
YES
NO
(A)
(B)
Less than HS
High school
A
B
Junior college
Bachelor
Graduate
Results are based on two-sided tests with significance level 0.05. For
each significant pair, the key of the category with the smaller column
proportion appears under the category with the larger column proportion.
a. Tests are adjusted for all pairwise comparisons within a row of each
innermost subtable using the Bonferroni correction.
The resulting table shows that there are no significant differences in belief in life after death:
 for people with junior college degrees;
 for people with bachelor degrees; or
 for people with graduate degrees.
However, respondents who do not believe in life after death have a significantly higher proportion of
people with less than a high school diploma.
Similarly, respondents who believe in life after death have a significantly higher proportion of people
with high school diplomas as their highest degree.
Created by Sue McMillen for SPSS Tables: Intermediate