wald.test: Makes wald test

Description Usage Arguments Author(s) Examples

View source: R/base.r

Description

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.

Usage

1
2
wald.test(object = NULL, coef = NULL, Sigma = NULL, contrast,
  coef.null = NULL, null = NULL, print.coef = TRUE, alpha = 0.05)

Arguments

object

timereg object

coef

estimates from some model

Sigma

variance of estimates

contrast

contrast matrix for testing

coef.null

which indeces to test to 0

null

mean of null, 0 by default

print.coef

print the coefficients of the linear combinations.

alpha

significance level for CI for linear combinations of coefficients.

Author(s)

Thomas Scheike

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
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)))

timereg documentation built on May 29, 2017, 2 p.m.

Search within the timereg package
Search all R packages, documentation and source code