Professional Documents
Culture Documents
SPSS Procedures For Linear Regression
SPSS Procedures For Linear Regression
Karl B Christensen
http://publicifsv.sund.ku.dk/~kach/SPSS
Scatter plots
Correlation
Simple linear regression
Residual plots
Histogram, Probability plot, Box plot
210
180
bp
150
120
90
obese
225
200
175
bp
150
125
R2 Linear = 0,106
100
1 1 2 2 3
obese
Linear Regression
225
200
175
bp
150
125
R2 Linear = 0,106
100
1 1 2 2 3
obese
LLR Smoother
225
200
175
bp
150
125
100
1 1 2 2 3
obese
Calculated as
Pn
Sxy (xi − x̄)(yi − ȳ )
r = rxy =p = pPn i=1 Pn
2 2
Sxx Syy i=1 (xi − x̄) i=1 (yi − ȳ )
http://publicifsv.sund.ku.dk/~kach/SPSS/F5_gif2.gif
tick marks
Pearson
Spearman
Kendalls tau b
CORRELATIONS
/ VARIABLES = obese bp
/ PRINT = TWOTAIL SIG
/ MISSING = PAIRWISE .
NONPAR CORR
/ VARIABLES = obese bp
/ PRINT = BOTH TWOTAIL SIG
/ MISSING = PAIRWISE .
obese bp
obese Pearson Correlation 1 ,326
Sig. (2-tailed) ,001
N 102 102
bp Pearson Correlation ,326 1
Sig. (2-tailed) ,001
N 102 102
Correlations
obese bp
Kendall's tau_b obese Correlation Coefficient 1,000 ,213
Sig. (2-tailed) . ,002
N 102 102
bp Correlation Coefficient ,213 1,000
Sig. (2-tailed) ,002 .
N 102 102
Spearman's rho obese Correlation Coefficient 1,000 ,304
Sig. (2-tailed) . ,002
N 102 102
bp Correlation Coefficient ,304 1,000
Sig. (2-tailed) ,002 .
N 102 102
(xi , yi ), i = 1, . . . , n
LLR Smoother
Linear Regression
225
200
175
bp
150
125
R2 Linear = 0,106
100
1 1 2 2 3
obese
Menu
Analyze/Regression/Linear
REGRESSION
/ MISSING LISTWISE
/ STATISTICS COEFF OUTS CI (95)
/ CRITERIA = PIN (.05) POUT (.10)
/ NOORIGIN
/ DEPENDENT bp
/ METHOD = ENTER obese .
Standardized
Unstandardized Coefficients Coefficients 95,0% Confidence Interval for B
Model B Std. Error Beta t Sig. Lower Bound Upper Bound
1 (Constant) 96,818 8,920 10,855 ,000 79,122 114,514
obese 23,001 6,667 ,326 3,450 ,001 9,774 36,229
a. Dependent Variable: bp
Estimated relation:
bp = 96.81793 + 23.00135×obese
output
ANOVAa
Sum of
Model Squares df Mean Square F Sig.
1 Regression 3552,419 1 3552,419 11,903 ,001b
Residual 29845,541 100 298,455
Total 33397,961 101
a. Dependent Variable: bp
b. Predictors: (Constant), obese
Residuals
ε̂i = yi − yˆi = yi − (α̂ + β̂xi )
should be plotted against:
1 the explanatory variable xi – to check linearity
2 the fitted values ŷi – to check variance homogeneity (and
normality)
3 ’normal scores’ i.e. probability plot – to check normality
First two should give impression random scatter, while the
probability plot ought to show a straight line.
ε̂i = yi − yˆi .
Standardized residuals.
Choose
Analyze/Regression/Linear
LLR Smoother
4,00000
Standardized Residual
2,00000
,00000
-2,00000
1 1 2 2 3
obese
4,00000
Standardized Residual
2,00000
,00000
-2,00000
1 1 2 2 3
obese
no evidence of non-linearity
4,00000
Standardized Residual
2,00000
,00000
-2,00000
110,00000 120,00000 130,00000 140,00000 150,00000 160,00000
LLR Smoother
4,00000
Standardized Residual
2,00000
,00000
-2,00000
1 1 2 2 3
obese
30 Mean = -2,50E-16
Std. Dev. = ,99504
N = 102
20
Frequency
10
0
-2,00000 ,00000 2,00000 4,00000
Standardized Residual
2
Expected Normal Value
-1
-2
-3
-3 -2 -1 0 1 2 3 4 5
Observed Value
Karl B Christensenhttp://publicifsv.sund.ku.dk/~kach/SPSS 5. SPSS procedures for linear regression
Histogram and probability plot for the residuals
y 7→ log(y )
/ PLOT = BOXPLOT
/ STATISTICS = NONE
/ NOTOTAL .
2,5
49
100
60
2,0
obese
1,5
1,0
,5
1 2
sexnr
1 Download the bp.sav data set from the home page and get it
into SPSS.
2 Use graphical methods to answer the questions
Is there an association between obese and sexnr ?
Is there an association between bp and sexnr ?
Is there an association between obese and bp ?
3 Click and point to get a scatter plot. Choose
Set Markers By:
or
GRAPH
/ SCATTERPLOT ( BIVAR )= obese WITH bp BY sexnr
/ MISSING = LISTWISE .