Documente Academic
Documente Profesional
Documente Cultură
a Selection of SPSS
Functions
IBM SPSS Statistics 19
Using documents prepared by Drs. Sheldon Lee, Marcus Saegrove, Jennifer Sadowski and Michael Alfieri
TABLE OF CONTENTS
How to enter data into SPSS data editor: General instructions .................................................................................................................. 3
How to create figures in SPSS: General instructions ................................................................................................................................. 4
Creating Bar Graphs .................................................................................................................................................................................. 5
Creating Pie Charts .................................................................................................................................................................................... 7
Creating Histograms .................................................................................................................................................................................. 7
Computing the Mean, Median, and Standard Deviation .......................................................................................................................... 10
Creating Box Plots ................................................................................................................................................................................... 11
To make a Normal Quantile Plot ......................................................................................................................................................... 11
Make a Scatter Plot .................................................................................................................................................................................. 12
“Standard” Pearson correlation a.k.a Pearson product-moment correlation: ........................................................................................... 12
Linear Regression .................................................................................................................................................................................... 12
Find the regression equation ................................................................................................................................................................ 13
Make a Scatter Plot with regression line in SPSS .................................................................................................................................... 13
Residual Plot in SPSS .............................................................................................................................................................................. 13
Spearman rank-order correlation ............................................................................................................................................................. 14
Logistic regression ................................................................................................................................................................................... 14
Paired T-test ............................................................................................................................................................................................. 15
Independent T-test ................................................................................................................................................................................... 15
Mann Whitney U a.k.a Wilcoxon-Mann-Whitney ................................................................................................................................... 16
ANOVA / General Linear Model............................................................................................................................................................ 16
Post-Hoc tests – ANOVA .................................................................................................................................................................... 17
Kruskal-Wallis test .................................................................................................................................................................................. 17
Chi-square test of association (Contingency Tables) ............................................................................................................................... 18
Goodness of Fit Test ................................................................................................................................................................................ 18
2
How to enter data into SPSS data editor: General instructions
Data View. This view displays the actual data values or defined value labels (resembles an excel spreadsheet)
Variable View. This view displays variable definition information, including defined variable and value labels,
data type (for example, string, date, or numeric), measurement level (nominal, ordinal, or scale), and user-
defined missing values.
3
In both views, you can add, change, and delete information that is contained in the data file. You can switch
between them at the tabs located at the bottom left hand of the page.
Variable View contains descriptions of the attributes of each variable in the data file. In Variable View: rows
are variables and columns are variable attributes. Type in the name of your variable (no spaces), choose the
type of data (by clicking the grey box in the cell), a label for your variable (spaces are allowed – this will be the
label that shows up on figures/graphs). If desired, in the “values” box code for your values by clicking on the
grey box in the cell, and then coding “0=male, 1=female”. When you then return to data view, your codes will
translate to your values (do this under “view” and “values labels”).
Once your variables are set up in variable view, return to “data view” and enter your data. Remember to save
both your data file and your data output separately (they are different file types).
General instructions: To create a graph/figure on SPSS, go to “Graphs”, then “Legacy Dialogs” and choose the
appropriate option. Typical options are: “Bar” and “Scatter/dot”. There are many options for graphs and/or
details (e.g., error bars, best fit lines, etc) – consult the “Help” function on SPSS for additional detailed
instructions.
4
Creating Bar Graphs
For categorical data, we may use bar graphs or pie charts to visualize the data. In the data below, the three
columns are the favorite colors, favorite football teams, and pulse rates for students in a class. These are
categorical data, so we may use a bar graph or pie chart to display the data.
5
This is the resulting graph, which can be cut and pasted
into other documents.
6
Creating Pie Charts
Graphs Legacy Dialogs Pie and click on
Define. Drag a categorical variable into the
“Define Slices by” box. (NOTE: Here the
results will be shown as a % rather than an N
value.)
Creating Histograms
For one set of data:
7
From the column listings, drag the appropriate
variable to “Variable.”
8
This shot shows
that a simple
histogram was
chosen, and the
data for “Volume
Diet Cola” was
placed into the
x-axis.
The “Element
Properties”
window
automatically
appears.
9
Histograms, continued:
10
Click the Statistics tab and choose what you want to
calculate. (If you want to add Percentile(s), type in the
value and click “Add”.) Click “continue” to return to
the Frequencies window, and click OK to compute.
output: Age
N Valid 54
Missing 0
Mean 43.52
Median 34.00
Percentiles 25 17.00
35 21.00
50 34.00
75 58.00
11
Make a Scatter Plot
Graphs → LegacyDialogs → Scatter/Dot
Select “Simple Scatter”, click “Define”
Drag the appropriate columns to the X-axis and Y-axis.
Linear Regression
Determines relationship between two variables and implies that a prediction of one value is being
attempted from another (i.e., cause and effect).
Data are Continuous
NOTE: x = ‘cause’, ‘predictor’, or ‘independent’ variable that is set or chosen by the experimenter
y = ‘effect’, ‘dependent’ which is never set by the experimenter
Example: “The uptake of drug X is significantly affected by pH level: uptake increases at higher
pH levels (linear regression: p<0.001)”
12
Find the regression equation
(continued from steps above)
Optional: Click “Save”. To save the predicted values, check “Unstandardized” under “predicted
Values”. To save the residuals, check “Unstandardized” under “Residuals”.
Click OK
The bottom table in the Output window contains the coefficients.
If the value is sufficiently close to 1, you may use the regression equation to do predictions. For example, for
somebody who has had 6.5 beers, the approximated blood alcohol level would be
13
Spearman rank-order correlation
Tests whether there is an association between two variables
Data are discrete, non-parametric
Example: “There is not a significant association between male and female body size in pairs of
penguins (Spearman correlation: rs=0.771, n=20, p=0.072)”
NOTE Spearman rank-order is the non-parametric equivalent of the Pearson correlation (pg 83)
Logistic regression
Regression, as above, implies cause and effect when ‘y’, ‘dependent variable’ (“effect”) is classified into groups
NOTE: Dependent (effect, y, never set by experimenter): only classified into groups
Independent (cause, x, is set or chosen by experimenter): can be continuous OR can be in groups
Example: “Shade level has a significant effect on the presence of the plant virus (logistic
regression: p=0.006)”
14
Tests of Differences (for each know when to use, what type of data, how to write results):
Paired T-test
Data are continuous, paired, in 2 groups, parametric
Example: “Plants in treatment A were significantly taller ( ̅ = 5.6 cm) after 7 days than plants in
treatment B ( ̅ = 4.5 cm) (t-test: p= value of p, Figure 1).”
Independent T-test
Data are continuous, unpaired, in 2 groups, parametric
Example: “Plants in treatment A were significantly taller ( ̅ = 5.6 cm) after 7 days than plants in
treatment B ( ̅ = 4.5 cm) (t-test: p= value of p, Figure 1).”
15
Mann Whitney U a.k.a Wilcoxon-Mann-Whitney
Data are discrete, unpaired, in 2 groups, non-parametric
Example: “There were significantly more plants in treatment A than in treatment B (Mann-
Whitney U test: p= 0.025)”
16
GLM How to run test:
Analyze
General Linear Model
Univariate…
move dependent variable into appropriate box
move fixed factor into the appropriate box
Ok
Kruskal-Wallis test
Data are discrete, unpaired, in more than 2 groups, non-parametric
Example: “There is a significant difference in grain size of the three cultivars (Kruskal Wallis:
p=0.013).
Enter categories (by number) in one column, and frequency in adjacent column.
DataWeight Cases; click “Weight Cases by” and insert frequency column in “Frequency Variable:
AnalyzeNonparametric TestsLegacy DialogChi Square Test
Click category column into “Test Variable List”
Click appropriate case in “Expected Values”; add proportions in “Values” (if appropriate)
Click OK
Chi-Square value, d.f. and P-value appear in output.
18