A study investigated whether a handheld device that sends a magnetic pulse into a person’s head might be an effective treatment for migraine headaches.
Researchers recruited 200 subjects who suffered from migraines
randomly assigned them to receive either the TMS (transcranial magnetic stimulation) treatment or a placebo treatment
Subjects were instructed to apply the device at the onset of migraine symptoms and then assess how they felt two hours later. (either Pain-free or Not pain-free)
Odds ratios
What is the explanatory variable?
A study investigated whether a handheld device that sends a magnetic pulse into a person’s head might be an effective treatment for migraine headaches.
Researchers recruited 200 subjects who suffered from migraines
randomly assigned them to receive either the TMS (transcranial magnetic stimulation) treatment or a placebo treatment
Subjects were instructed to apply the device at the onset of migraine symptoms and then assess how they felt two hours later (either Pain-free or Not pain-free)
Odds ratios
What type of variable is this?
A study investigated whether a handheld device that sends a magnetic pulse into a person’s head might be an effective treatment for migraine headaches.
Researchers recruited 200 subjects who suffered from migraines
randomly assigned them to receive either the TMS (transcranial magnetic stimulation) treatment or a placebo treatment
Subjects were instructed to apply the device at the onset of migraine symptoms and then assess how they felt two hours later (either Pain-free or Not pain-free)
Odds ratios
What is the outcome variable?
A study investigated whether a handheld device that sends a magnetic pulse into a person’s head might be an effective treatment for migraine headaches.
Researchers recruited 200 subjects who suffered from migraines
randomly assigned them to receive either the TMS (transcranial magnetic stimulation) treatment or a placebo treatment
Subjects were instructed to apply the device at the onset of migraine symptoms and then assess how they felt two hours later (either Pain-free or Not pain-free)
Odds ratios
What type of variable is this?
A study investigated whether a handheld device that sends a magnetic pulse into a person’s head might be an effective treatment for migraine headaches.
Researchers recruited 200 subjects who suffered from migraines
randomly assigned them to receive either the TMS (transcranial magnetic stimulation) treatment or a placebo treatment
Subjects were instructed to apply the device at the onset of migraine symptoms and then assess how they felt two hours later (either Pain-free or Not pain-free)
Odds ratios
__
TMS
Placebo
Total
Pain-free two hours later
39
22
61
Not pain-free two hours later
61
78
139
Total
100
100
200
We can compare the results using odds
What are the odds of being pain-free for the placebo group?
(22/100)/(78/100)=22/78=0.282
What are the odds of being pain-free for the treatment group?
39/61=0.639
Comparing the odds what can we conclude?
TMS increases the likelihood of success
Odds ratios
__
TMS
Placebo
Total
Pain-free two hours later
39
22
61
Not pain-free two hours later
61
78
139
Total
100
100
200
We can summarize this relationship with an odds ratio: the ratio of the two odds
OR=39/6122/78=0.6390.282=2.27
“the odds of being pain free were 2.27 times higher with TMS than with the placebo”
Odds ratios
What if we wanted to calculate this in terms of Not pain-free (with pain-free) as the referent?
__
TMS
Placebo
Total
Pain-free two hours later
39
22
61
Not pain-free two hours later
61
78
139
Total
100
100
200
OR=61/3978/22=1.5643.545=0.441
the odds for still being in pain for the TMS group are 0.441 times the odds of being in pain for the placebo group
Odds ratios
What changed here?
__
TMS
Placebo
Total
Pain-free two hours later
39
22
61
Not pain-free two hours later
61
78
139
Total
100
100
200
OR=78/2261/39=3.5451.564=2.27
the odds for still being in pain for the placebo group are 2.27 times the odds of being in pain for the TMS group
Odds ratios
In general, it’s more natural to interpret odds ratios > 1, you can flip the referent to do so
__
TMS
Placebo
Total
Pain-free two hours later
39
22
61
Not pain-free two hours later
61
78
139
Total
100
100
200
OR=78/2261/39=3.5451.564=2.27
the odds for still being in pain for the placebo group are 2.27 times the odds of being in pain for the TMS group
Odds ratios
Let’s look at some Titanic data. We are interested in whether being female is related to whether they survived.
__
Female
Male
Total
Survived
308
142
450
Died
154
709
863
Total
462
851
1313
Odds ratios
What are the odds of surviving for females versus males?
Let’s look at some Titanic data. We are interested in whether being female is related to whether they survived.
____
Female
Male
Total
Survived
308
142
450
Died
154
709
863
Total
462
851
1313
OR=308/154142/709=20.2=9.99
Odds ratios
How do you interpret this?
___
Female
Male
Total
Survived
308
142
450
Died
154
709
863
Total
462
851
1313
OR=308/154142/709=20.2=9.99
the odds of surviving for the female passengers was 9.99 times the odds of surviving for the male passengers
Odds ratios
What if we wanted to fit a model? What would the equation be?
__
Female
Male
Total
Survived
308
142
450
Died
154
709
863
Total
462
851
1313
log(odds of survival)=ˆβ0+ˆβ1Female
Odds ratios
log(odds of survival)=ˆβ0+ˆβ1Male
glm(Survived ~ Sex, data = Titanic, family = binomial)
Call: glm(formula = Survived ~ Sex, family = binomial, data = Titanic)
Coefficients:
(Intercept) Sexmale
0.693 -2.301
Degrees of Freedom: 1312 Total (i.e. Null); 1311 Residual
Null Deviance: 1690
Residual Deviance: 1360 AIC: 1360