5 How well the new teaching method works
From the data, we are 95% confident that the new teaching method is (1.73, 157) times effective than the old method.
> library(faraway)
> data(spector)
> help (spector)
A data frame with 32 observations on the following 4 variables.
grade 1 = exam grades improved, 0 = not improved
psi 1 = student exposed to PSI (a new teach method), 0 = not
exposed
tuce a measure of ability when entering the class
gpa grade point average
> head(spector)
grade psi tuce gpa
1 0 0 20 2.66
2 0 0 22 2.89
3 0 0 24 3.28
4 0 0 12 2.92
5 1 0 21 4.00
6 0 0 17 2.86
library(survival)
> cmod<-clogit(grade~tuce+gpa+strata(psi),spector)
> summary(cmod)
Call:
coxph(formula = Surv(rep(1, 32), grade) ~ tuce + gpa + strata(psi),
data = spector, method = "exact")
n= 32
coef exp(coef) se(coef) z p
tuce 0.0883 1.09 0.136 0.651 0.51
gpa 2.5850 13.26 1.189 2.174 0.03
exp(coef) exp(-coef) lower .95 upper .95
tuce 1.09 0.9155 0.837 1.42
gpa 13.26 0.0754 1.290 136.37
Rsquare= 0.242 (max possible= 0.601 )
Likelihood ratio test= 8.85 on 2 df, p=0.012
Wald test = 6 on 2 df, p=0.0499
Score (logrank) test = 8.31 on 2 df, p=0.0157
Drop tuce as the p-value is large (0.51)
> cmod2<-clogit(grade~gpa+strata(psi),spector)
> summary(cmod2)
Call:
coxph(formula = Surv(rep(1, 32), grade) ~ gpa + strata(psi),
data = spector, method = "exact")
n= 32
coef exp(coef) se(coef) z p
gpa 2.80 16.5 1.15 2.44 0.015
exp(coef) exp(-coef) lower .95 upper .95
gpa 16.5 0.0606 1.73 157
Rsquare= 0.231 (max possible= 0.601 )
Likelihood ratio test= 8.4 on 1 df, p=0.00375
Wald test = 5.94 on 1 df, p=0.0148
Score (logrank) test = 7.9 on 1 df, p=0.00493
From the data, we are 95% confident that the new teaching method is (1.73, 157) times effective than the old method.
halfnorm(residuals(cmod2))