14.6: Using SPSS
- Page ID
- 50188
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)
( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\id}{\mathrm{id}}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\kernel}{\mathrm{null}\,}\)
\( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\)
\( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\)
\( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)
\( \newcommand{\vectorA}[1]{\vec{#1}} % arrow\)
\( \newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow\)
\( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vectorC}[1]{\textbf{#1}} \)
\( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)
\( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)
\( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)Let’s return to our example about Statistonia College from the beginning of our chapter. For that example, we supposed that among the population of college students, 25% were business majors, 25% were psychology majors, 20% were nursing majors, and 30% were statistics majors. Suppose that you wanted to test whether the proportion of students in each of these majors at a small college in Statistonia were similar to that of college students, overall, in SPSS. In order to test a hypothesis using SPSS, we need the raw data rather than the summarized counts like we saw in Data Set 14.1. Thus, we will use Data Set 14.3 to test the current hypothesis using SPSS. Data Set 14.3 shows the qualitative data for majors for a sample of 30 in the left column. To help us summarize the hypothesized counts, the expected proportions for each category are shown in the right column but are not data.
Majors Data | Expected Proportions |
---|---|
Business | 25% |
Business | |
Business | |
Business | |
Business | |
Business | |
Psychology | 25% |
Psychology | |
Psychology | |
Psychology | |
Psychology | |
Psychology | |
Psychology | |
Psychology | |
Psychology | |
Psychology | |
Psychology | |
Nursing | 20% |
Nursing | |
Nursing | |
Nursing | |
Nursing | |
Nursing | |
Nursing | |
Statistics | 30% |
Statistics | |
Statistics | |
Statistics | |
Statistics | |
Statistics |
Data need to be organized and entered into SPSS in ways that serve the analysis to be conducted. Thus, this section focuses on how to enter and analyze data for a chi-squared goodness of fit using SPSS. SPSS version 29 was used for this book; if you are using a different version, you may see some variation from what is shown here.
Entering Data
Open the SPSS software, click “New Dataset,” then click “Open” (or “OK” depending on which is shown in the version of the software you are using). This will create a new blank spreadsheet into which you can enter data. Click on the Variable View tab on the bottom of the spreadsheet. This tab of the spreadsheet has several columns to organize information about the variables. The first column is titled “Name.” Start here and follow these steps:
- Click the first cell of that column and enter the name of your test variable using no spaces, special characters, or symbols. For Data Set 14.3 the variable name is Major. Hit enter and SPSS will automatically fill in the other cells of that row with some default assumptions about the data.
- Click the first cell of the column titled “Type” and then click the three dots that appear in the right side of the cell. Ideally, we would select “string” which allows us to use words to name each group. However, SPSS works best if we recode each group name as number (i.e. 1 = Business, 2 = Psychology, 3 = Nursing, and 4 = Statistics). We will use this coding to enter our data. For type, specify that the data for that variable will appear as numbers by selecting “Numeric.” We will need to use numbers to represent each major.
- Click the first cell of the column titled “Label.” This is where you can specify what you want the variable to be called in output, including in tables and graphs. You can use spaces or phrases here, as desired.
- Click on the first cell of the column titled “Measure.” A pulldown menu with three options will allow you to specify the scale of measurement for the variable. Select the “Nominal” option because the variables for a chi-squared are qualitative.
Now you are ready to enter your data. Click on the Data View tab toward the bottom of the spreadsheet. This tab of the spreadsheet has columns into which you can enter the data. Click the cell of the first column and follow these steps:
- Enter the data for the test variable moving down the rows under the first column. If your data are already on your computer in a spreadsheet format such as excel, you can copy-paste the data in for the variable.
- Then hit save to ensure your data set will be available for you in the future.
Here is how the first 20 data points for Data Set 14.3 looks after data are entered into SPSS using the group names:
SPSS Version 29 is fussy and only seems to work if you code the names with numeric values. Thus, if you get an error warning when trying to run your analysis, recode your majors as 1, 2, 3, and 4 in the data view tab and clarify what they stand for using the values cell of the variables tab as shown below:


Once all the variables have been specified and the data have been entered, you can begin analyzing the data using SPSS.
Conducting a Chi-Squared Goodness of Fit Test in SPSS
The steps to running this form of chi-squared in SPSS are:
- Click Analyze -> Nonparametric Tests -> Legacy Dialogs -> Chi-squared from the pull down menus.
- Drag the name of the test variable from the list on the left into the box on the right of the command window. For Data Set 14.3, this means we are moving Major to the test box as shown below.
When using SPSS Version 29, it may call your nominal variable ordinal at this step. This will not impact the analysis.
In this command window, we must set our expected values. We are testing whether the count of students who identified their majors as Business, Psychology, Nursing, and Statistics are similar to dissimilar to the proportions of 25%, 25%, 20%, and 30%, respectively. Thus, we need to enter those values as shown in the command window below:
- Click “OK” to run the analyses.
- The output (which means the page of calculated results) will appear in a new window of SPSS known as an output viewer. The results will appear in two tables as shown below:
Major | |||
---|---|---|---|
Observed N |
Expected N | Residual | |
Business |
6 |
7.5 |
-1.5 |
Psychology |
11 |
7.5 |
3.5 |
Nursing |
7 |
6.0 |
1.0 |
Statistics |
6 |
9.0 |
-3.0 |
Total |
30 |
Major | |
---|---|
Chi-Square |
3.100a |
\(df\) |
3 |
Asymp. Sig. |
.376 |
a. 0 cells (0.0%) have expected frequencies less than 5. The minimum expected cell frequency is 6.0. |
The first table summarizes the observed and expected counts for each category (i.e. for each major in this example). Notice that the expected percents have been transformed into their proportional expected counts. The second table provides the results of the inferential test using the observed and expected counts from the first table. The chi-squared formula result appears on the top row; the result is \(\chi^2\) = 3.10 when rounded to the hundredths place. The degrees of freedom appear in the second row. There were 4 categories whose counts were being compared and, thus, the \(df\) = 3. Finally, the p-value (which represents the risk of a Type I Error) appears in the third row as the “Asymp. Sig.”. This is the same as what SPSS has called “sig.” in our earlier chapters. When the p-value is less than .05, the result is significant and when it is greater than .05 the result is not significant. We see that the p-value for the present analysis was .376 and, thus, that the result is not significant.
An assumption of a chi-squared test is that no category has an expected frequency lower than 5. SPSS automatically checks this assumption and alerts the user when it has been met or violated. We can see that SPSS has confirmed that this assumption was met for the present data in a note it has included under the second table of results.
The results from this test are as follows: A chi-squared goodness of fit test was used to test whether the counts of students in each major at Statistonia College were similar to those of students in the population, overall. Specifically, students overall majored in Business (25.0%), Psychology (25.0%), Nursing (20.0%), and Statistics (30.0%). The counts of students at Statistonia College who were majoring in Business (\(n\) = 6), Psychology (\(n\) = 11), Nursing (\(n\) = 7), and Statistics (\(n\) = 6) were not significantly different than the proportions in the population, \(\chi^2 (3, N = 30) = 3.10\), \(p\) >.05. Thus, the counts of each major at the college were proportionally similar to those in the population of students.
Reading Review 14.5
- Where do you specify the expected proportions when setting up a chi-squared goodness of fit analysis is SPSS?
- What information is provided in each of the two tables of SPSS output for chi-square?
- Which assumption of chi-squared is automatically checked and reported by SPSS?
- What does a non-significant result indicate when using a chi-squared goodness of fit test?