crrscKM {adjSURVCI}R Documentation

Stratified Proportional Subdistribution Hazards Model For Clustered Competing Risks Data With Covariate-Independent Censoring

Description

Stratified proportional subdistribution hazards model for clustered competing risks data. The survival probability of the censoring distribution is obtained using the Kaplan-Meier estimates. The estimates of the cumulative baseline hazard along with their standard errors are provided at the pre-specified time points. Furthermore, the adjusted cumulative incidence rates along with their standard errors are calculated at pre-specified time points. The standard errors of the the difference in adjusted cumulative incidence rates between the groups are also provided. Finally, the estimated adjusted cumulative incidence rates given vector Z0 along with their standard errors are provided at pre-specified time points. Tied data are handled by adding a tiny random shift from a normal distribution with mean 0 and standard deviation 1e-09.

Usage

crrscKM(
  times,
  causes,
  covariates,
  treatment = NULL,
  clusters = 1:length(times),
  cencode = 0,
  failcode = 1,
  stratified.model = TRUE,
  est.t = FALSE,
  pre.t = sort(times[causes == failcode]),
  Z0 = NULL
)

Arguments

times

Failure/censored times.

causes

Failure code for each failure type (1 or 2) and 0 for censoring.

covariates

Matrix of covariates. Dummy variables must be created for categorical covariates.

treatment

Treatment variable.

clusters

Cluster variable. Independent data is assumed if this is not provided.

cencode

Code for censoring. By default it is 0.

failcode

Code for the failure type of interest. By default it is 1.

stratified.model

TRUE or FALSE. By default, it is TRUE for stratified model. The stratification variable is treatment. If this is FALSE and est.t=TRUE, then the treatment variable still needs to be provided and will be used as a covariate.

est.t

TRUE or FALSE. By default this is FALSE. If it is TRUE then estimates of cumulative baseline hazard, adjusted cumulative incidence and predicted cumulative incidence are provided along with their standard errors at pre-specified time points.

pre.t

Pre-specified time points. By default these are all main event times.

Z0

Covariate vector for prediction. By default this vector is a zero vector.

Value

Returns a list with the following components. If est.t=FALSE then only upto $nstrata are provided.

$coef

Parameter estimates

$p.value

p-value of regression coefficients

$var

Covariance matrix of parameter estimates

$infor

Information matrix

$loglikelihood

Maximum log-likelihood value

$n

Total number of observations used

$nevents

Total number of events and censored observations

$nclusters

Total number of clusters

$nstrata

Total number of treatment groups

$CumBaseHaz.t

Cumulative basline hazard estimates and their standard errors

$Fpredict.t

Predicted cumulative incidence and their standard errors

$AdjustedF.t

Adjusted cumulative incidence and their standard errors

$Adjusted.se.diff

Standard error of the difference of adjusted cumulative incidence between the treatment groups

Examples

#Simulated data
alpha = 0.5
d = simulate_CR_data(n=4,m=50,alpha=alpha,beta1=c(0.7,-0.7,-0.5)*1/alpha,
beta2=c(0.5,-0.5,1),betaC=c(0,0,0)*1/alpha,lambdaC=0.59)

#Stratified Model with est.t=TRUE
model1 <- crrscKM(times=d[,1],causes=d[,2],covariates=d[,4:5],
treatment=d[,3],clusters=d[,6],stratified.model=TRUE,est.t=TRUE,
pre.t=sort(d$time[d$cause==1]),Z0=c(0.5,0.5))

#Unstratified Model with est.t=TRUE
model2 <- crrscKM(times=d[,1],causes=d[,2],covariates=d[,4:5],
treatment=d[,3],clusters=d[,6],stratified.model=FALSE,est.t=TRUE,
pre.t=sort(d$time[d$cause==1]),Z0=c(0.5,0.5))

#Stratified Model with est.t=FALSE
model3 <- crrscKM(times=d[,1],causes=d[,2],covariates=d[,4:5],
treatment=d[,3],clusters=d[,6],stratified.model=TRUE,est.t=FALSE,
pre.t=sort(d$time[d$cause==1]),Z0=c(0.5,0.5))

#Unstratified Model with est.t=FALSE.
#Create dummy variables first
dummy <- model.matrix(~ factor(d[,3]))[,-1]
model4 <- crrscKM(times=d[,1],causes=d[,2],covariates=cbind(d[,4:5],dummy),
clusters=d[,6],stratified.model=FALSE,est.t=FALSE,
pre.t=sort(d$time[d$cause==1]),Z0=c(0.5,0.5))

#Only continuous covariates are available.
model5 <- crrscKM(times=d[,1],causes=d[,2],covariates=d[,4:5],
clusters=d[,6],stratified.model=FALSE,est.t=FALSE,
pre.t=sort(d$time[d$cause==1]),Z0=c(0.5,0.5))

[Package adjSURVCI version 1.0 Index]