


























































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



























































Nature Population/ Observation/ Relationships/ Analysis/
“To all the ladies present and some of those absent”
- Jerzy Neyman
What behaviors influence the chances of developing a sexually transmitted
disease? Comparing demographics, health education, access to health care,
which of these variables are significantly associated with failure to obtain an HIV
test? Among the several indicators of risk, including age, co-morbidities, severity
of disease, which are significantly associated with surgical mortality among
patients undergoing transplant surgery? In all of these examples, the outcome
observed for each individual can take on only one of two possible values:
positive or negative test, alive or dead, remission or non-remission, and so on.
Collectively, the data to be analyzed are proportions.
Proportions have some important features that distinguish them from data
measured on a continuum. Proportions (1) are bounded from below by the value
of zero (or zero percent) and bounded from above by one (or 100 percent); (2) as
the proportion gets close to either boundary, the variance of the proportion gets
smaller and smaller; thus, we cannot assume a constant variance ; and (3)
proportions are not distributed normal. Normal theory regression models are
not appropriate for the analysis of proportions.
In unit 4, Categorical Data Analysis, emphasis was placed on contingency table
approaches for the analysis of such data and it was highlighted that these methods
should always be performed for at least two reasons: (1) they give a good feel for
the data; and (2) they are free of the assumptions required for regression
modeling.
Unit 7 is an introduction to logistic regression approaches for the analysis of
proportions where it is of interest to explore the roles of possibly several
influences on the observed proportions.
Nature Population/ Observation/ Relationships/ Analysis/
Learning Objectives …………………………….…………………………….
From Linear Regression to Logistic Regression …................................…..
Use of VDT’s and Spontaneous Abortion …..............................................
Definition of the Logistic Regression Model .…................................…….
Estimating Odds Ratios …………………................................……………
Estimating Probabilities …………….........................……………..………
The Deviance Statistic …………….........................……….……………..
a. The Likelihood Ratio Test …….........................……………………….
b. Model Development …………................................………………….
Illustration – Depression Among Free-Living Adults ………..………
Regression Diagnostics ……………...........................………....…………
a. Assessment of Linearity ………………………………….……………
b. Hosmer-Lemeshow Goodness of Fit Test ……..................................….
c. The Linktest ………………………………………………..………….
d. The Classification Table ………………..................................………..
e. The ROC Curve ……………………….................................………….
f. Pregibon Delta Beta Statistic ………….................................…………
Overview of Maximum Likelihood Estimation ………..............................… 62
Nature Population/ Observation/ Relationships/ Analysis/
In unit 5 ( Regression and Correlation ), we considered single and multiple predictor regression models for a
single outcome random variable Y assumed continuous and distributed normal.
In unit 7 ( Logistic regression ), we consider single and multiple regression models for a single outcome
random variable Y assumed discrete, binary, and distributed bernoulli.
1
2
p
1
1
p
p
1
1
p
p
Least squares (= maximum
likelihood)
Maximum Likelihood
Residual sum of squares Deviance statistic
Partial F Test Likelihood Ratio Test
1 p
Y|X ...X 0 1 1 p p
1 p 1 p
Y|X ...X Y|X ...X
0 1 1 p p
0 1 1 p p
0 1 1 p p
Y|X
1
...X
p
0
1
1
p
p
1 p
1 p
1 p 1 p
Y|X ...X
Y|X ...X
Y|X ...X Y|X ...X
0 1 1 p p
Nature Population/ Observation/ Relationships/ Analysis/
Consider the following published example of logistic regression.
Source: Schnorr et al (1991) Video Display Terminals and the Risk of Spontaneous Abortion. New England
Journal of Medicine 324 : 727-33.
Background:
Adverse pregnancy outcomes were correlated with use of video display terminals (VDT’s) beginning in 1980.
Subsequent studies were inconsistent in their findings.
Previous exposure assessments were self-report or derived from job title descriptions.
Electromagnetic fields were not previously measured.
Research Question:
What is the nature and significance of the association, as measured by the odds ratio, between exposure to
electromagnetic fields emitted by VDTs and occurrence of spontaneous abortion, after controlling for
Design: Retrospective cohort investigation of two groups of full-time female telephone operators.
Nature Population/ Observation/ Relationships/ Analysis/
We suspect that multiple factors, especially use of video display terminals, contribute to an individual’s odds
of spontaneous abortion.
The outcome or dependent variable is Y=sab. Its value is y and
= 1 if spontaneous abortion occurred
0 otherwise
The predictors that might influence the odds of SAB are several:
1
= avgvdt
2
= numcigs
X 3 = priorsab
4
= smokstat
5
= prthyr, and
6
= vdtexpos
We are especially interested in
6
= vdtexpos (coded = 1 for exposed and = 0 for NON exposed) and
1
= avgvdt
Among the N=882 in our sample, we have potentially N=882 unique probabilities of spontaneous abortion.
p 1
, p 2
, …, p N
For the i
th
person
p i
= Function ( X 1i
2i
3i
4i
5i
6i
Pr [ Y i
= 1] = p i
Pr [ Y i
= 0] = (1 - p i
Nature Population/ Observation/ Relationships/ Analysis/
i
Recall. Each profile of values, X = [ X 1
=x 1
X 2
=x 2
, …. X 6
=x 6
], defines a sub-population with their own distribution of outcomes Y. For example
the women with X 3
=1 are the women with a history of prior spontaneous abortion, and are distinct from the women with X 3
=0 (who have no such
prior history). And so on; we can talk about distinct sub-populations based on the entire profile of values on X 1
, X 2
, … X 6
.
Review of normal theory linear regression analysis:
1
2
3
4
5
6
] (read: “Y given [X 1
2
3
4
5
6
]” is assumed to be distributed
normal (Gaussian)
with mean = μ Y|x
and variance=.
The mean of Y at [X 1
2
3
4
5
6
] is modeled linearly in x = [X 1
2
3
4
5
6
Thus mean of Y | [X 1
2
3
4
5
6
1
2
3
4
5
6
) ] = μ Y|x
In normal theory linear regression:
x
0
1
1
2
2
3
3
4
4
5
5
6
6
In a logistic model regression analysis, the framework is a little different:
Y is assumed to be distributed Bernoulli
with mean=p x
and variance= p x
(1-p x
x
linearly in x = [X 1
…
6
x
linearly in x = [X 1
…
6
x
0
1
1
2
2
3
3
5
5
6
6
2
Y X |
s
ln
π
x
1 − π
x
Nature Population/ Observation/ Relationships/ Analysis/
follows a distribution that is Bernoulli with parameter E[Y | X ] =.
2
…
N
are independent.
=x i
…
i
=x i
, are treated as fixed.
logit[ E(Y)| X 1
=x 1
2
=x 2
6
=x 6
= logit [ p x
= b 0
1
2
3
4
5
6
No multicollinearity
No outliers
Independence
p
x i
Nature Population/ Observation/ Relationships/ Analysis/
For now, assume that we have a fitted model. We’ll get to the details of estimation later.
Once a logistic regression model has been fit, the prediction equation can be used to estimate odds ratio (OR)
measures of association.
Example 1 : What is the estimated crude relative odds (OR) of spontaneous abortion (SAB) associated with
any exposure (1 = exposed, 0 = not exposed) to a video display terminal (VDTEXPOS)?
Step 1:
To obtain crude odds ratios, either a 2x2 table can be used or a one predictor logistic regression model can be
fit. Here, it is given by
0
1
Stata
. * The following assumes you have downloaded and opened vdt.dta. . logit sab vdtexpos
Logistic regression Number of obs = 882
LR chi2(1) = 0.
= Likelihood Ratio Statistic
for current model (“full”) v
intercept only model (“reduced”)
Analogous to Overall F
Prob > chi2 = 0. 6443
Log likelihood = - 379.08045 Pseudo R2 = 0.0 003
(-2) ln L = 758.
Wald Z Wald Z p-value (2 sided) using Normal(0,1)
depressed | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
vtexpos | - .0876939. 1903232 - 0. 46 0.645 -. 4607204. 2853327
_cons | - 1.666325. 1204129 - 13. 84 0.0 00 - 1. 90233 - 1. 43032
z = Wald Z = [ Coef ] / [ Std. Err. ]
= [ beta – 0 ] / [ SE(beta) ] ~ Normal(0,1) when ß 1
= 0
Yielding the following prediction equation
=
ˆ
β
1
=
ˆ
β
0
Nature Population/ Observation/ Relationships/ Analysis/
Stata Illustration – Obtaining estimated odds ratios after logistic regression
Method 1. Command logit with option or
. logit sab vdtexpos, or
Method 2. Command logistic
. logistic sab vdtexpos
Nature Population/ Observation/ Relationships/ Analysis/
Here is the wonderful algebra, in all its glory:
comparison versus reference
comparison
reference
comparison versus reference
comparison
reference
Example 2 - What is the estimated relative odds (OR) of spontaneous abortion (SAB) for a person who is not
exposed to a VDT, smokes 10 cigarettes per day, has no history of prior SAB, and no thyroid condition
relative to a person who has an average of 20 hours exposure to a VDT, is a nonsmoker, has a history of prior
SAB and does have a thyroid condition?
Here the model fit is the 4 predictor model:
logit { probability [sab=1] }
= b 0
avgvdt + b 2
numcigs + b 3
priorsab + b 4
prthyr
Estimation now yields (output not shown).
fitted logit { prob[sab=1] }
= - 1.95958 + 0.00508(avgvdt) + 0.04267(numcigs) + 0.38500(priorsab)
Calculate the two predicted logits and compute their difference.
Nature Population/ Observation/ Relationships/ Analysis/
The Odds Ratio estimate ( ) of association with outcome
accompanying a unit change in the predictor X is a
function of the estimated regression parameter
= exp { }
Tip – OR 10 unit change in X
= exp [ 10β ]*
ˆ
OR
ˆ
β
UNIT change in X
ˆ
OR
ˆ
β
ˆ
RR
UNIT change in X
ˆ
RR
ˆ
β
Nature Population/ Observation/ Relationships/ Analysis/
Again, let’s assume that we have a fitted model. We’ll get to the details of estimation later.
Once a logistic regression model has been fit, the prediction equation can also be used to estimate probabilities
of event occurrence. The prediction equation can be used to estimate probabilities of event of disease if the
study design is a cohort; it is used to estimate probabilities of history of exposure if the study design is case-
control.
Reminder …– it is not possible to estimate probability of disease from analyses of case-control studies.
Recall that for Y distributed Bernoulli
E [ Y ] = π = Probability of event occurrence
Example 1 - Under the assumption of a cohort study design, what is estimated probability of spontaneous
abortion (sab) for a person with any exposure to a video display terminal? Consider the single predictor
model containing the predictor vdtexpos)
Recall that we obtained the following equation for the fitted logit for the one predictor model containing
Predicted logit { prob[SAB=1| vdtexpos] }
Utilizing the algebra on page 9 , we have:
Set VDTEXPOS=1, b 0
= - 1.66633, b 1
=-0.08769 and solve
0 1
0 1 0 1
VDTEXPOS=
0 1 0 1
p = =
= =
Nature Population/ Observation/ Relationships/ Analysis/
current
saturated
current
Notes -
(1) By itself, the deviance statistic does not have a well defined distribution
(2) However, differences of deviance statistics that compare hierarchical models do have well defined
distributions, namely chi square distributions.
(1) Roughly, the deviance statistic D is a measure of what remains unexplained.
Hint – The analogue in normal theory regression is the residual sum of squares (SSQ error)
(2) A deviance statistic value close to zero says that a lot is explained and, importantly,
that little remains unexplained. à The current model with its few predictors performs
similarly to the saturated model that permits a separate predictor for each person.
(3) WARNING! The deviance statistic D is NOT a measure of goodness-of-fit. Recall
that we said the same thing about the overall F-statistic in normal theory regression.
(4) The deviance statistic D is the basis of the likelihood ratio test.
(5) The likelihood ratio test is used for the comparison of hierarchical models.
ln
current
saturated
Nature Population/ Observation/ Relationships/ Analysis/
REDUCED
- Deviance FULL
REDUCED
- (-2) ln(L) SATURATED
FULL
- (-2) ln(L) SATURATED
REDUCED
FULL
DF=k
Tip – In practice, we obtain LR using the 2
nd
formula; it says: LR = [ (-2) ln (L) REDUCED
] - [ (-2) ln (L) FULL
]
1 2 p 0
p+1 p+2 p+k p+1 p+1 p+k p+
1 1 p p
1 2 p 0 1 1 p p k
O p+1 p+2 p+k
A