Description Usage Arguments Value Author(s) See Also Examples
View source: R/cgr_helper_mat.R
This function calculates the value of the CGR-CUSUM using a matrix formulation of the problem
1 | cgr_helper_mat(data, ctimes, coxphmod, cbaseh, displaypb = FALSE)
|
data |
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
|
cbaseh |
a function which returns the non risk-adjusted cumulative
baseline hazard H_0(t). If |
displaypb |
boolean Display a progress bar? |
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 θ_t
$S_nu time from which individuals contribute to the chart S_ν
Daniel Gomon
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## 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()
cgrv1 <- cgr_helper_mat(data = tdat, ctimes = unique(tdat$entrytime + tdat$survtime),
coxphmod = tcoxmod, cbaseh = tcbaseh, displaypb = TRUE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.