Learning Goal: I'm working on a psychology writing question and need support to help me learn.
Calculating chi-square in SPSS
First we need to enter our data into SPSS, and then we can analyze the data.
This is the same table from Lab 3. Please copy your values exactly from that table into
this one so you do not have to flip back and forth.
***If you worked with another student on collecting the data, work with that same
student to enter and analyze the data.
Texting
No Yes
SafeTraffic
Crossing
Behavior Risky
In order for SPSS to understand this table, we need to make two variables:
● We are going to make a variable “Text”
⇒ It will have two potential responses: 0=No, 1=Yes
● We are going to make a variable “TCBeh”
⇒ It will have two potential responses: 0=Safe, 1=Risky
● Each observation (participant/person you observed) will have their own row of
data, with a value for Text and a value for TCBeh.
Open SPSS
Setting up the datafile:
● Click on the Variable View tab at the bottom left side.
⇒ In the top box (row #1), type text
⇒ In the second row, type tcbeh
● Look for the Values column
● For the text variable, click on the Values column and then click on the right side
of that box (it should be gray)—this will open another box called Value Labels
● In the Value box, put 0
● In the Label box, type no
● Click add.
● In the Value box, put 1
● In the Label box, type yes
● Click add. Click ok.
● For the tcbeh variable, click on the Values column and then click on the right
side of that box (it should be gray)—this will open another box called Value
Labels
● In the Value box, put 0
● In the Label box, type safe
● Click add.
● In the Value box, put 1
● In the Label box, type risky
● Click add. Click ok.
Entering the data:
● Click on the Data View tab at the bottom left side. (Now we are ready to enter
our data)
● We have to enter a series of 0s and 1s in both the text and tcbeh columns that
represent the data we have collected.
● For example, if you observed 5 drivers who were texting and made a safe
crossing behavior (there would be a 5 in your chart in the top right box). This
would look like:
Text TCBeh
1 0
1 0
1 0
1 0
1 0
● For example, if you observed 7 drivers who were not texting and made a risky
crossing behavior (there would be a 7 in your chart in the bottom left box). This
would look like:
Text TCBeh
0 1
0 1
0 1
0 1
0 1
0 1
0 1
● Your total number of “cases” (i.e., the number along the left side of the data chart
should be the same as the total number of people you observed (total).
● Please be careful when entering this data!!!
● If you have questions, ask your TA!!!
● Please double-check that your data is in correctly (observations match the total
number of cases that you observed; there are only 1s and 0s in your file, etc)!
Analyzing the data:● Click on the Analyze menu, down to Descriptive Statistics, over to Crosstabs
● Click on the text variable and shift it with the arrow over to Column(s)
● Click on the tcbeh variable and shift it with the arrow over to Row(s)
● Click on the box at the bottom left that says Display clustered bar charts (this
will give us a “picture” of what our data look like)
● Click on the Statistics box at the top right
● Click on the Chi-square box (this is the test statistics we need for our hypothesis
test)
● Click continue
● Click on the Cells box under also at the top right
● Under Percentages, click on the row and column boxes (this will give us
percentages with which to compare our single boxes)
● Click continue
● Click ok
Reading the SPSS output:(This is only sample data, do not use these numbers!!!)
Case Processing Summary
Cases
Valid Missing Total
N Percent N Percent N Percent
tcbeh * text 30 100.0% 0 .0% 30 100.0%
Chi-Square Tests
Value df Asymp. Sig. (2-
sided)
Exact Sig. (2-
sided)
Exact Sig. (1-
sided)
Pearson Chi-Square 4.043a 1 .044
Continuity Correctionb 2.638 1 .104
Likelihood Ratio 4.059 1 .044
Fisher's Exact Test .063 .052
Linear-by-Linear Association 3.908 1 .048
N of Valid Cases 30
a. 1 cells (25.0%) have expected count less than 5. The minimum expected count is 4.40.
b. Computed only for a 2x2 table
This tells us if there
is any missing
data-there should
be none!!!
This tells us the
results of our
Chi-square with
the degrees of
freedom and the
p-value.
tcbeh * text Crosstabulation
Text
no yes Total
Count 4 14 18
% within tcbeh 22.2% 77.8% 100.0%
risky
% within text 36.4% 73.7% 60.0%
Count 7 5 12
% within tcbeh 58.3% 41.7% 100.0%
Safe
% within text 63.6% 26.3% 40.0%
Count 11 19 30
% within tcbeh 36.7% 63.3% 100.0%
tcbeh
Total
% within text 100.0% 100.0% 100.0%
*The bolded numbers are the observed counts-how many of each group you actually
saw when you collected your data.
*%within tcbeh are the percentages of each box (or row) divided by that tcbeh category
(e.g., 4/18 = 22.2% of the total risky crossing behaviors were not texting whereas 14/18
= 77.8% of the total risky crossing behaviors were texting).
*%within text are the percentages of each box (or column) divided by that text category
(e.g., 4/11 = 36.4% of the total people not texting had risky crossing behaviors whereas
7/11 = 63.6% of the total people not texting had safe crossing behaviors).
APA format for reporting statistics:
For Chi-square, you need to report the test statistic (χ2), the degrees of freedom (df) in
parentheses, and the p value or significance level.
● The format is χ2 (df) = ___, p = ___.
● Using our table above (on p. 12 of this lab manual)
● χ2 (1) = 4.04, p = .044.
● χ2 (1) = 2.259, p = .133.
We want to make a general statement about the relationship between our two variables
of interest (texting and traffic crossing behaviors):
EXAMPLE: There was a significant relationship between texting and risky crossing
behaviors, χ2 (1) = 4.04, p = .044.
For significant results, we want to follow this up with specific information about that
general relationship along with a figure that illustrates that relationship. Also, we cannot
infer causation from this observational study, so we do not want to use causal language.
For the purposes of our hypothesis, we might be interested in the texters: how many of
them displayed risky crossing behaviors compared to how many of them displayed safe
crossing behaviors. Therefore, we can report the percentages of crossing behaviors
based on texting:
Of the risky
crossings
(18), 4 of
them (22.2%)
were not
texting.Of the people
who were not
texting (11), 4
of them
(36.4%) made
a risky
crossing
behavior.
EXAMPLE: Of the people who were texting (n = 19), 73.7% of them were risky crossers
compared to only 26.3% who were safe crossers (see Figure 1).
For the purposes of our hypothesis, we might be interested in the risky crossers: how
many of them were texting compared to how many of them were not texting. Therefore,
we can report the percentages of texters based on cross behaviors:
EXAMPLE: Of the people who displayed risky crossing behaviors (n = 18), 77.8% of
them were texting compared to only 22.2% who were not texting (see Figure 1).
Figure 1. Frequency of traffic crossing behaviors by texting.
For nonsignificant results, you do not need follow-up information or a figure (leave
these out). NOTE: We do not say that the results were insignificant.
EXAMPLE: There was not a significant relationship between cell phones and crossing
behavior, χ2 (1) = 0.25, p = .944. (I’m using made-up numbers here)
EXAMPLE: Crossing behavior was independent of cell phone use, χ2 (1) = 0.25, p = .944.
Lab Report:
● Using your outline, restate your hypothesis and report the statistical test of that
hypothesis.
● Use a heading for the Results section (remember your name and TA name, see
p.1).
● Carefully and correctly report the test statistic.
● You can find the lower-case Greek letter Chi by clicking on the Insert menu
above, down to Symbol and looking for χ.
● You can type the number “2” after the Chi symbol and highlight that number, and
shift it up by clicking on the Format menu above, down to Font, and clicking on
the Superscript box.
● Make a clear statement that your results DO or DO NOT support your
hypothesis. NOTE: Make sure to pay attention to the results. It could be that you
have statistically significant results but they go in the opposite direction of what
you hypothesized (cell phones were related to safer crossing, not risky).
● If you have statistically significant results, follow this up with descriptive
information about the difference between groups (obtained from the crosstab
graph in your output, p. 12 in the example above).
● Make reference to these differences graphically, buy referring to the bar chart
that SPSS creates for your Chi-square.
● Copy and paste the graph on its own page and write a figure caption (check
pp.62-63 in Writing with Style for helpful hints)
● Make sure to refer to the Figure in your text (see Writing with Style guide)
● If you do not have statistically significant results, do not follow this up. Do not
make comments about the groups. Do not make a Figure.
● Save often and check to make sure you have followed all of the computer lab
and formatting rules!
● Double-check the Useful Rules (pp. 63-65 of Writing with Style) for results
section helpful hints
● Make sure to also turn in a copy of your SPSS output with your results section