Part 3 - Binary Outcome Variables
Part 3 - Binary Outcome Variables
difference in proportions
between groups
In this Section
• Focus on binary outcome variable
• Find differences between the groups
(is the proportion of the disease higher in
one group than in another??)
– Relative risk
– Odds ratio
– χ2-test
– Logistic regression
Organize categorical data
2 x 2 table
Disease Disease
Total
Yes/+ No/
Exposure
a b (a+b)
Yes/+
Exposure
c d (c+d)
No/
(a+b+c+d)
Total (a+c) (b+d)
=N
Example
Diabetes Diabetes
Totalt
+
Smoke + a=14 b=976 990
Smoke c=19 d=777 796
Totalt 33 1753 1786
Risk
• The Risk is the
probability of an event
• For comparison,
the relative risk
(317/1491) / (31/295) =
2,02
RR and OR
• RR og OR are useful tools to assess the effect
of a binary exposure on a binary outcome
– RR is easier to understand
– OR sometimes is more useful
• RR makes no sense in case-control studies, OR does
• OR is used in logistic regression i logistisk regresjon
– OR is always more extreme than RR
• OR>RR>1
• OR<RR<1
• OR=RR=1
• If the outcome is rare, then OR≈RR
χ -test
2
Interpreting output:
• First table:
– Observed counts.
χ -test
2
Interpreting output:
• First table:
– Observed counts.
– Expected counts
(if there was no difference
in the BMI categories).
χ -test
2
Interpreting output:
• First table:
– Observed counts.
– Expected counts
(if there was no difference
in the BMI categories).
– The proportion
with diabetes in
each category.
χ -test
2
Interpreting output:
• First table:
– Observed counts.
– Expected counts
(if there was no difference
in the BMI categories).
– The proportion
with diabetes in
each category.
• The second table gives
the result of the χ2-test.
χ -test
2
Interpreting output:
• First table:
– Observed counts.
– Expected counts
(if there was no difference
in the BMI categories).
– The proportion
with diabetes in
each category.
• The second table gives
the result of the χ2-test.
- BMI does not have an
effect on Diabetes
χ -test
2
Instead of
Logistic regression
• Similar to linear regression, but with binary outcome.
– We can adjust for categorical variables (2+ categories).
– We can adjust for continuous variables.
But:
• We calculate the logarithm of an odds ratio, rather
than a continuous variable.
Instead of
–.
–.
Exercise 4c: Solution
Logistic regression model for «mi»,
with «bmi» as independent variable.
• «Analyze>Regression>
Binary logistic»
• The original variable as
«Dependent».
–.
–.
Exercise 4c: Solution
Logistic regression model for «mi»,
with «bmi» as independent variable.
• «Analyze>Regression>
Binary logistic»
• The original variable as
«Dependent».
• Add «bmi» in «Covariates».
–.
–.
Exercise 4c: Solution
Logistic regression model for «mi»,
with «bmi» as independent variable.
• «Analyze>Regression>
Binary logistic»
• The original variable as
«Dependent».
• Add «bmi» in «Covariates».
• Click «Options».
–
–.
–.
Exercise 4c: Solution
Logistic regression model for «mi»,
with «bmi» as independent variable.
• «Analyze>Regression>
Binary logistic»
• The original variable as
«Dependent».
• Add «bmi» in «Covariates».
• Click «Options».
– Check for «CI for exp(B): 95%».
–.
–.
Exercise 4c: Solution
Logistic regression model for «mi»,
with «bmi» as independent variable.
• «Analyze>Regression>
Binary logistic»
• The original variable as
«Dependent».
• Add «bmi» in «Covariates».
• Click «Options».
– Check for «CI for exp(B): 95%».
– «Include constant in model» should
be selected.
–.
Exercise 4c: Solution
Logistic regression model for «mi»,
with «bmi» as independent variable.
• «Analyze>Regression>
Binary logistic»
• The original variable as
«Dependent».
• Add «bmi» in «Covariates».
• Click «Options».
– Check for «CI for exp(B): 95%».
– «Include constant in model» should
be selected.
– Click «Continue».
Exercise 4c: Solution
Logistic regression model for «mi»,
with «bmi» as independent variable.
• «Analyze>Regression>
Binary logistic»
• The original variable as
«Dependent».
• Add «bmi» in «Covariates».
• Click «Options».
– Check for «CI for exp(B): 95%».
– «Include constant in model» should be
selected.
– Click «Continue».
• Click «OK» in the original box.
Exercise 4c: Solution
Interpreting output:
• OR of 1.05 (95% CI) associated with one unit
increase in BMI.
Exercise 4c: Solution
Interpreting output:
• OR of 1.05 (95% CI) associated with one unit
increase in BMI.
• OR associated with an increase in BMI of 10:
exp(10*0.051) = Exp(0.51) = 1.67
Summary
• Compare differences of proportions of two groups.
RR or OR.
Easier way: use logistic regression in SPSS, even if
you have only one independent variable with two levels
Compare the difference in proportions of more than two
groups without quantifying the difference.
χ2-test.
Compare the difference in proportions of more than two
groups, with the wish to quantify the difference.
Logistic regression.
• Adjust for other variables.
Logistic regression.