Learn R Programming

mets (version 1.2.4)

gofM.phreg: GOF for Cox covariates in PH regression

Description

Cumulative residuals after model matrix for Cox PH regression p-values based on Lin, Wei, Ying resampling.

Usage

gofM.phreg(formula, data, offset = NULL, weights = NULL,
  modelmatrix = NULL, n.sim = 1000, silent = 1, ...)

Arguments

formula

formula for cox regression

data

data for model

offset

offset

weights

weights

modelmatrix

matrix for cumulating residuals

n.sim

number of simulations for score processes

silent

to keep it absolutely silent, otherwise timing estimate will be prduced for longer jobs.

...

Additional arguments to lower level funtions

Examples

Run this code
# NOT RUN {
data(TRACE)

dcut(TRACE)  <- ~. 
mm <- model.matrix(~-1+factor(wmicat.4),data=TRACE)
m1 <- gofM.phreg(Surv(time,status==9)~vf+chf+wmi,data=TRACE,modelmatrix=mm) 
summary(m1)
par(mfrow=c(2,2))
plot(m1)

m1 <- gofM.phreg(Surv(time,status==9)~strata(vf)+chf+wmi,data=TRACE,modelmatrix=mm) 
summary(m1)

## cumulative sums in covariates, via design matrix mm 
mm <- cumContr(TRACE$wmi,breaks=10,equi=TRUE)
m1 <- gofM.phreg(Surv(time,status==9)~strata(vf)+chf+wmi,data=TRACE,
		  modelmatrix=mm,silent=0)
summary(m1)

## cumulative sums in covariates, via design matrix mm 
m1 <- gofZ.phreg(Surv(time,status==9)~strata(vf)+chf+wmi,data=TRACE,vars="wmi")
summary(m1)

# }

Run the code above in your browser using DataLab