Beruflich Dokumente
Kultur Dokumente
g ( ) = log
1
e
( x) =
+ x
1+ e
= 0 P(Presence) is the same at each level of x
> 0 P(Presence) increases as x increases
< 0 P(Presence) decreases as x increases
T .S . : X
2
obs
R .R . : X
2
obs
^
= ^
^
2 , 1
P val : P (
2
obs
Dose
0
2.5
5
10
# Patients
67
75
130
145
# Relieved
2
7
29
40
% Relieved
3.0
9.3
22.3
27.6
DOSE
Constant
B
.165
-2.490
S.E.
.037
.285
Wald
19.819
76.456
df
1
1
Sig.
.000
.000
Exp(B)
1.180
.083
2.490 + 0.165 x
e
( x) =
2.490 + 0.165 x
1+ e
^
H0 : = 0 H A : 0
2
2
T .S . : X obs
0.165
=
= 19.819
0.037
2
RR : X obs
.205,1 = 3.84
P val : .000
Odds Ratio
Interpretation of Regression Coefficient ():
In linear regression, the slope coefficient is the change
in the mean response as x increases by 1 unit
In logistic regression, we can show that:
odds ( x + 1)
= e
odds ( x)
( x)
odds ( x) =
1 ( x)
^
^
^
^
^
^
1.96 , + 1.96
1.96
^
Step 2: Raise e = 2.718 to the lower and upper bounds of the CI:
e 1.96 , e +1.96
^ ^
^ ^
= 0.165
= 0.037
^
(e
0.0925
ORi = e i
Many models have nominal/ordinal predictors, and
widely make use of dummy variables
2
obs
= (2 log( L0 )) (2 log( L1 ))
2
R.R. X obs
2 ,k
2
P = P ( 2 X obs
)
b
0.83
1.53
2.19
2.66
0.47
0.41
1.10
0.59
1.22
2.01
0.92
0.64
sb
0.42
0.40
0.40
0.41
0.19
0.21
0.29
0.41
0.45
0.56
0.26
0.28
Loglinear Models
Example: 3 variables (X,Y,Z) each with 2 levels
Can be set up in a 2x2x2 contingency table
Hierarchy of Models:
All variables are conditionally independent
Two of the pairs of variables are conditionally
independent
One of the pairs are conditionally independent
No pairs are conditionally independent, but each
association is constant across levels of third variable
(no interaction or homogeneous association)
All pairs are associated, and associations differ
among levels of third variable
Loglinear Models
To determine associations, must have a measure: the
odds ratio (OR)
Odds Ratios take on the value 1 if there is no
association
Loglinear models make use of regressions with
coefficients being exponents. Thus, tests of whether
odds ratios are 1, is equivalently to testing whether
regression coefficients are 0 (as in logistic regression)
For a given partial table, OR=e, software packages
estimate and test whether =0
PRSNALTY
Upper Classman
Total
PRSNALTY
Total
Modern
Traditional
Modern
Traditional
ROLEBHVR
Modern
Traditional
33
25
21
53
54
78
19
13
10
35
29
48
Total
58
74
132
32
45
77
Personality=M
Personality=T
Class=Lower
Role=M
34.1
19.9
Class=Lower
Role=T
23.9
54.1
34.1(54.1)
Class = Lower : OR =
= 3.88
23.9(19.9)
17.9(33.9)
Class = Upper : OR =
= 3.88
14.1(11.1)
Class=Upper
Role=M
17.9
11.1
Class=Upper
Role=T
14.1
33.9
Role=M
Class=Lower
34.1
19.9
Role=M
Class=Upper
17.9
11.1
Role=T
Class=Lower
23.9
54.1
Role=T
Class=Upper
14.1
33.9
34.1(11.1)
= 1.06
17.9(19.9)
23.9(33.9)
Role = T : OR =
= 1.06
14.1(54.1)
Role = M : OR =
Role=M
Role=T
Personality=M
Class=Lower
34.1
23.9
Personality=M
Class=Upper
17.9
14.1
Personality=T
Class=Lower
19.9
54.1
34.1(14.1)
= 1.12
17.9(23.9)
19.9(33.9)
Personality = T : OR =
= 1.12
11.1(54.1)
Personality = M : OR =
Personality=T
Class=Upper
11.1
33.9
SPSS Output
Statistical software packages fit regression type models, where
the regression coefficients for each model term are the log of the
odds ratio for that term, so that the estimated odds ratio is e
raised to the power of the regression coefficient.
Parameter Estimates
Parameter
Constant
Class
Personality
Role
C*P
C*R
R*P
Estimate
3.5234
.4674
-.8774
-1.1166
.0605
.1166
1.3554
SE
.1651
.2050
.2726
.2873
.3064
.3107
.2987
Z-value
Asymptotic 95% CI
Lower
Upper
21.35
2.28
-3.22
-3.89
.20
.38
4.54
e.1166 = 1.12
3.20
.07
-1.41
-1.68
-.54
-.49
.77
3.85
.87
-.34
-.55
.66
.73
1.94
Interpreting Coefficients
The regression coefficients for each variable
corresponds to the lowest level (in alphanumeric
ordering of symbols). Computer output will print a
mapping of coefficients to variable levels.
Cell (C,P,R)
L,M ,M
L,M ,T
L,T,M
L,T,T
U,M,M
U,M,T
U,T,M
U,T,T
Class
0.4674
0.4674
0.4674
0.4674
0
0
0
0
Prsnlty
-0.8774
-0.8774
0
0
-0.8774
-0.8774
0
0
Role
-1.1166
0
-1.1166
0
-1.1166
0
-1.1166
0
C*P
0.0605
0.0605
0
0
0
0
0
0
C*R
0.1166
0
0.1166
0
0
0
0
0
P*R
1.3554
0
0
0
1.3554
0
0
0
Expected Count
34.1
23.9
19.9
54.1
17.9
14.1
11.1
33.9
(
f
f
)
e
Pearson Chi - square : 2 = o
fe
Likelihood - Ratio : G = 2
2
fo
f o log
fe
Factor
Value
PRSNALTY
Modern
ROLEBHVR
Modern
CLASS1
Lower Classman
CLASS1
Upper Classman
ROLEBHVR
Traditional
CLASS1
Lower Classman
CLASS1
Upper Classman
PRSNALTY
Traditional
ROLEBHVR
Modern
CLASS1
Lower Classman
CLASS1
Upper Classman
ROLEBHVR
Traditional
CLASS1
Lower Classman
CLASS1
Upper Classman
Goodness-of-fit Statistics
Chi-Square
Likelihood Ratio
.4695
Pearson
.4664
Expected
Count
33.00 ( 15.79)
19.00 ( 9.09)
34.10 ( 16.32)
17.90 ( 8.57)
25.00 ( 11.96)
13.00 ( 6.22)
23.90 ( 11.44)
14.10 ( 6.75)
21.00 ( 10.05)
10.00 ( 4.78)
19.90 (
11.10 (
53.00 ( 25.36)
35.00 ( 16.75)
54.10 ( 25.88)
33.90 ( 16.22)
DF
1
1
Sig.
.4932
.4946
9.52)
5.31)
G2
22.21
0.7199
21.99
22.04
22.93
0.6024
0.5047
0.4644
2
22.46
0.7232
22.24
22.34
22.13
0.6106
0.5085
0.4695
df
4
3
3
3
2
2
2
1
P-value (G2)
.0002
.8685
.00007
.00006
.00002
.7399
.7770
.4946
P-value (2)
.0002
.8677
.00006
.00006
.00002
.7369
.7755
.4932
Adjusted Residuals
Standardized differences between actual
and expected counts (fo-fe, divided by its
standard error).
Large adjusted residuals (bigger than 3 in
absolute value, is a conservative rule of
thumb) are cells that show lack of fit of
current model
Software packages will print these for logit
and loglinear models
Value
PRSNALTY
ROLEBHVR
CLASS1
CLASS1
ROLEBHVR
CLASS1
CLASS1
Modern
Modern
Lower Classman
Upper Classman
Traditional
Lower Classman
Upper Classman
PRSNALTY
ROLEBHVR
CLASS1
CLASS1
ROLEBHVR
CLASS1
CLASS1
Traditional
Modern
Lower Classman
Upper Classman
Traditional
Lower Classman
Upper Classman
Resid.
10.43
5.83
Adj.
Resid.
3.04**
1.99
-9.27
-6.99
-2.46
-2.11
-8.85
-7.41
-2.42
-2.32
7.69
8.57
1.93
2.41
P (Y j ) = P (Y = 1) + L + P (Y = j )
j = 1, K , c
j = 1, K , c 1
P (Y c) = 1
P(Y j )
logit[P(Y j )] = log
= j + X
P(Y > j )
j = 1, K , c 1
W h ite
101
91
170
N o n w h ite
106
127
190
SPSS Output
Note that SPSS fits the model in the
following form:
P (Y j )
logit[P(Y j )] = log
= j X
P (Y > j )
j = 1, K , c 1
Parameter Estimates
Threshold
Location
[ATTITUDE = 1]
[ATTITUDE = 2]
[RACE=0]
[RACE=1]
Estimate
Std. Error
-1.027
.102
.165
.094
-.001
.133
a
0
.
Wald
101.993
3.070
.000
.
df
1
1
1
0
Sig.
.000
.080
.993
.
Note that the race variable is not significant (or even close).
Fitted Equation
The fitted equation for each group/category:
P(Y 1 | White)
Negative/White : logit
= 1.027 (0.001) = 1.026
P (Y > 2 | Nonwhite)
For each group, the fitted probability of falling in that set of categories
is eL/(1+eL) where L is the logit value (0.264,0.264,0.541,0.541)
Threshold
Location
[ATTITUDE = 1]
[ATTITUDE = 2]
[RACE=0]
[RACE=1]
Estimate
Std. Error
-1.027
.102
.165
.094
-.001
.133
a
0
.
Wald
101.993
3.070
.000
.
df
1
1
1
0
Sig.
.000
.080
.993
.
Ordinal Predictors
Creating dummy variables for ordinal
categories treats them as if nominal
To make an ordinal variable, create a new
variable X that models the levels of the
ordinal variable
Setting depends on assignment of levels
(simplest form is to let X=1,...,c for the
categories which treats levels as being
equally spaced)