
Last chance! 50% off unlimited learning
Sale ends in
Makes wald test, either by contrast matrix or testing components to 0. Can also specify the regression coefficients and the variance matrix. Also makes confidence intervals of the defined contrasts. Reads coefficientes and variances from timereg and coxph objects.
wald.test(
object = NULL,
coef = NULL,
Sigma = NULL,
vcov = NULL,
contrast,
coef.null = NULL,
null = NULL,
print.coef = TRUE,
alpha = 0.05
)
timereg object
estimates from some model
variance of estimates
same as Sigma but more standard in other functions
contrast matrix for testing
which indeces to test to 0
mean of null, 0 by default
print the coefficients of the linear combinations.
significance level for CI for linear combinations of coefficients.
Thomas Scheike
data(sTRACE)
# Fits Cox model
out<-cox.aalen(Surv(time,status==9)~prop(age)+prop(sex)+
prop(vf)+prop(chf)+prop(diabetes),data=sTRACE,n.sim=0)
wald.test(out,coef.null=c(1,2,3))
### test age=sex vf=chf
wald.test(out,contrast=rbind(c(1,-1,0,0,0),c(0,0,1,-1,0)))
### now same with direct specifation of estimates and variance
wald.test(coef=out$gamma,Sigma=out$var.gamma,coef.null=c(1,2,3))
wald.test(coef=out$gamma,Sigma=out$robvar.gamma,coef.null=c(1,2,3))
### test age=sex vf=chf
wald.test(coef=out$gamma,Sigma=out$var.gamma,
contrast=rbind(c(1,-1,0,0,0),c(0,0,1,-1,0)))
Run the code above in your browser using DataLab