cgr_helper_mat_3 {cgrcusum} R Documentation

## Continuous time Generalized Rapid response CUSUM (CGR-CUSUM) helper - matrix formulation of the problem - version 3

### Description

This function calculates the value of the CGR-CUSUM using a matrix formulation of the problem - reduce calculations by specifying control limit.

### Usage

cgr_helper_mat_3(data, ctimes, coxphmod, cbaseh, h, displaypb = FALSE)


 data data.frame containing the following named columns: entrytime numeric - time of entry into study, otime numeric - time from entry until event, censorid integer - (optional) censoring indicator (0 = right censored, 1 = observed), and optionally additional covariates used for risk-adjustment. ctimes (optional) vector of construction times at which the value of the chart should be determined. When not specified, the chart is constructed at all failure times. coxphmod (optional) a cox proportional hazards regression model as produced by the function coxph(). Standard practice: coxph(Surv(survtime, censorid) ~ covariates, data = data). Alternatively, a list with: $formula (~ covariates)$coefficients (named vector specifying risk adjustment coefficients for covariates - names must be the same as in $formula and colnames of data). cbaseh a function which returns the non risk-adjusted cumulative baseline hazard H_0(t). If cbaseh is missing but coxphmod has been specified as a survival object, this baseline hazard rate will be determined using the provided coxphmod. h (optional) value of the control limit. The chart will only be constructed until the value of the control limit has been reached or surpassed. displaypb boolean Display a progress bar? ### Value A matrix with 4 named columns: •$time time at which the value of the CGR-CUSUM was determined

• $value value at corresponding time of the CGR-CUSUM •$exp_theta_t value at corresponding time of the MLE \hat{\theta}_t

• $S_nu time from which individuals contribute to the chart S_\nu ### Author(s) Daniel Gomon ### See Also cgrcusum ### Examples ## Not run: require(survival) tdat <- subset(surgerydat, Hosp_num == 1) tdat$otime <- tdat$entrytime + tdat$survtime
tcbaseh <- function(t) chaz_exp(t, lambda = 0.01)
varsanalysis <- c("age", "sex", "BMI")
exprfit <- as.formula(paste("Surv(survtime, censorid) ~" ,paste(varsanalysis, collapse='+')))
tcoxmod <- coxph(exprfit, data= surgerydat)
#Alternatively, cbaseh can be left empty when specifying coxphmod through coxph()
cgr3 <- cgr_helper_mat_3(data = tdat, ctimes = unique(tdat$entrytime + tdat$survtime),
coxphmod = tcoxmod, cbaseh = tcbaseh, displaypb = TRUE)

## End(Not run)


[Package cgrcusum version 0.1.0 Index]