Type: | Package |
Title: | Semiparametric Competing Risks Regression under Interval Censoring |
Version: | 3.0.4 |
Author: | Giorgos Bakoyannis <gbakogia@iu.edu>, Jun Park <jun.park@alumni.iu.edu> |
Maintainer: | Jun Park <jun.park@alumni.iu.edu> |
Description: | Semiparametric regression models on the cumulative incidence function for interval-censored competing risks data as described in Bakoyannis, Yu, & Yiannoutsos (2017) /doi{10.1002/sim.7350} and the models with missing event types as described in Park, Bakoyannis, Zhang, & Yiannoutsos (2021) \doi{10.1093/biostatistics/kxaa052}. The proportional subdistribution hazards model (Fine-Gray model), the proportional odds model, and other models that belong to the class of semiparametric generalized odds rate transformation models. |
Date: | 2022-05-09 |
Imports: | alabama, doParallel, foreach, MASS, parallel, splines2, stats, utils |
Suggests: | R.rsp |
Depends: | R (≥ 3.5.0) |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 7.1.2 |
VignetteBuilder: | R.rsp |
NeedsCompilation: | no |
Packaged: | 2022-05-09 18:05:22 UTC; Jun |
Repository: | CRAN |
Date/Publication: | 2022-05-10 08:00:02 UTC |
Creating data frame
Description
The function Surv2
generates the survival object to be treated as the response from ciregic
.
Usage
Surv2(v, u, w = NULL, sub = NULL, event)
Arguments
v |
the last observation time prior to the failure; |
u |
the first observation time after the failure; |
w |
a left truncation time or delayed entry time. The default setting is |
sub |
an indicator variable in the data set. It is an optional argument for interval-censored competing risks data and missing cause of failure, and the default is |
event |
an indicator of cause of failure. If an observation is righ-censored, |
Details
The function Surv2
provides a response data frame which is used in the function ciregic
and ciregic_lt
. For interval-censored competing risks data, the function Surv2
must use three parameters (v, u, c
). For left-truncated and interval censored competing risks data, the function Surv2
must use four parameters (v, u, w, c
). If data are partially left-truncated, but all interval-censored, w = 0
for only interval-censored competing risks data.
Value
data frame
Author(s)
Jun Park, jun.park@alumni.iu.edu
Giorgos Bakoyannis, gbakogia@iu.edu
Examples
attach(simdata)
Surv2(v = v, u = u, event = c)
attach(simdata_lt)
Surv2(v = v, u = u, w = w, event = c)
Derivative of B-spline
Description
Generates the derivative of the B-splines basis matrix.
Usage
bs.derivs(
x,
derivs = 0,
df = NULL,
knots = NULL,
degree = 3,
intercept = FALSE,
Boundary.knots = range(x)
)
Arguments
x |
object of B-splines |
derivs |
a number of derivatives |
df |
degrees of freedom of B-splines |
knots |
a vector of internal knots |
degree |
degrees of B-splines |
intercept |
a logical vector |
Boundary.knots |
a vector of boundary knots |
Details
The function bs.derivs
performs derivatives of B-splines
Value
The function bs.derivs
returns a component:
resmat |
derivatives of B-spline |
Author(s)
Jun Park, jp84@alumni.iu.edu
Giorgos Bakoyannis, gbakogia@iu.edu
B-spline Sieve Maximum Likelihood Estimation
Description
Routine that performs B-spline sieve maximum likelihood estimation with linear and nonlinear inequality/equality constraints
Usage
bssmle(formula, data, alpha, k = 1)
Arguments
formula |
a formula object relating survival object |
data |
a data frame that includes the variables named in the formula argument |
alpha |
|
k |
a parameter that controls the number of knots in the B-spline with |
Details
The function bssmle
performs B-spline sieve maximum likelihood estimation.
Value
The function bssmle
returns a list of components:
beta |
a vector of the estimated coefficients for the B-splines |
varnames |
a vector containing variable names |
alpha |
a vector of the link function parameters |
loglikelihood |
a loglikelihood of the fitted model |
convergence |
an indicator of convegence |
tms |
a vector of the minimum and maximum observation times |
Z |
a set of covariates |
Tv |
a vector of |
Tu |
a vector of |
Bv |
a list containing the B-splines basis functions evaluated at |
Bu |
a list containing the B-splines basis functions evaluated at |
dBv |
a list containing the first derivative of the B-splines basis functions evaluated at |
dBu |
a list containing the first derivative of the B-splines basis functions evaluated at |
dmat |
a matrix of event indicator functions |
Author(s)
Giorgos Bakoyannis, gbakogia@iu.edu
Jun Park, jun.park@alumni.iu.edu
B-spline Sieve Maximum Likelihood Estimation for Interval-Censored Competing Risks Data and Missing Cause of Failure
Description
Routine that performs B-spline sieve maximum likelihood estimation with linear and nonlinear inequality and equality constraints
Usage
bssmle_aipw(formula, aux, data, alpha, k)
Arguments
formula |
a formula object relating survival object |
aux |
auxiliary variables that may be associated with the missingness and the outcome of interest |
data |
a data frame that includes the variables named in the formula argument |
alpha |
|
k |
a parameter that controls the number of knots in the B-spline with |
Details
The function bssmle_aipw
performs B-spline sieve maximum likelihood estimation.
Value
The function bssmle_aipw
returns a list of components:
beta |
a vector of the estimated coefficients for the B-splines |
varnames |
a vector containing variable names |
varnames.aux |
a vector containing auxiliary variable names |
alpha |
a vector of the link function parameters |
loglikelihood |
a loglikelihood of the fitted model |
convergence |
an indicator of convegence |
tms |
a vector of the minimum and maximum observation times |
Bv |
a list containing the B-splines basis functions evaluated at |
Author(s)
Jun Park, jun.park@alumni.iu.edu
Giorgos Bakoyannis, gbakogia@iu.edu
Least-Squares Estimator of the Information Matrix
Description
Performs the least-squares methods to estimate the information matrix for the estimated regression coefficients
Usage
bssmle_lse(obj)
Arguments
obj |
a list of objectives from |
Details
The function bssmle_lse
estimates the information matrix for the estimated regression coefficients from the function bssmle
using the lease-squares method.
Value
The function bssmle_lse
returns a list of components:
Sigma |
the estimated variance-covariance matrix for the estimated regression coefficients |
Author(s)
Jun Park, jun.park@alumni.iu.edu
Giorgos Bakoyannis, gbakogia@iu.edu
References
Zhang, Y., Hua, L., and Huang, J. (2010), A spline-based semiparametric maximum likelihood estimation method for the Cox model with interval-censoed data. Scandinavian Journal of Statistics, 37:338-354.
Least-Squares Estimator of the Information Matrix
Description
Performs the least-squares methods to estimate the information matrix for the estimated regression coefficients
Usage
bssmle_lse_lt(obj)
Arguments
obj |
a list of objectives from |
Details
The function bssmle_lse_lt
estimates the information matrix for the estimated regression coefficients from the function bssmle_lt
using the lease-squares method.
Value
The function bssmle_lse_lt
returns a list of components:
Sigma |
the estimated information matrix for the estimated regression coefficients |
Author(s)
Jun Park, jun.park@alumni.iu.edu
Giorgos Bakoyannis, gbakogia@iu.edu
References
Zhang, Y., Hua, L., and Huang, J. (2010), A spline-based semiparametric maximum likelihood estimation method for the Cox model with interval-censoed data. Scandinavian Journal of Statistics, 37:338-354.
B-spline Sieve Maximum Likelihood Estimation for Left-Truncated and Interval-Censored Competing Risks Data
Description
Routine that performs B-spline sieve maximum likelihood estimation with linear and nonlinear inequality/equality constraints
Usage
bssmle_lt(formula, data, alpha, k = 1)
Arguments
formula |
a formula object relating survival object |
data |
a data frame that includes the variables named in the formula argument |
alpha |
|
k |
a parameter that controls the number of knots in the B-spline with |
Details
The function bssmle_lt
performs B-spline sieve maximum likelihood estimation for left-truncated and interval-censored competing risks data.
Value
The function bssmle_lt
returns a list of components:
beta |
a vector of the estimated coefficients |
varnames |
a vector containing variable names |
alpha |
a vector of the link function parameters |
loglikelihood |
a loglikelihood of the fitted model |
convergence |
an indicator of convegence |
tms |
a vector of the minimum and maximum observation times |
Z |
a design matrix |
Tw |
a vector of |
Tv |
a vector of |
Tu |
a vector of |
Bw |
a list containing the B-splines basis functions evaluated at |
Bv |
a list containing the B-splines basis functions evaluated at |
Bu |
a list containing the B-splines basis functions evaluated at |
dBw |
a list containing the first derivative of the B-splines basis functions evaluated at |
dBv |
a list containing the first derivative of the B-splines basis functions evaluated at |
dBu |
a list containing the first derivative of the B-splines basis functions evaluated at |
dmat |
a matrix of event indicator functions |
Author(s)
Jun Park, jun.park@alumni.iu.edu
Giorgos Bakoyannis, gbakogia@iu.edu
Bootstrap varince-covariance estimation
Description
Bootstrap varince estimation for the estimated regression coefficients
Usage
bssmle_se(formula, data, alpha, k = 1, do.par, nboot, objfun)
Arguments
formula |
a formula object relating survival object |
data |
a data frame that includes the variables named in the formula argument |
alpha |
|
k |
a parameter that controls the number of knots in the B-spline with |
do.par |
using parallel computing for bootstrap calculation. If |
nboot |
a number of bootstrap samples for estimating variances and covariances of the estimated regression coefficients. If |
objfun |
an option to select estimating function |
Details
The function bssmle_se
estimates bootstrap standard errors for the estimated regression coefficients from the function bssmle
, bssmle_lt
, ro bssmle_ltir
.
Value
The function bssmle_se
returns a list of components:
notconverged |
a list of number of bootstrap samples that did not converge |
numboot |
a number of bootstrap converged |
Sigma |
an estimated bootstrap variance-covariance matrix of the estimated regression coefficients |
Author(s)
Giorgos Bakoyannis, gbakogia@iu.edu
Jun Park, jun.park@alumni.iu.edu
Bootstrap varince-covariance estimation for interval-censored competing risks data and missing cause of failure
Description
Bootstrap varince estimation for the estimated regression coefficients
Usage
bssmle_se_aipw(formula, aux, data, alpha, k, do.par, nboot, w.cores = NULL)
Arguments
formula |
a formula object relating survival object |
aux |
auxiliary variables that may be associated with the missingness and the outcome of interest |
data |
a data frame that includes the variables named in the formula argument |
alpha |
|
k |
a parameter that controls the number of knots in the B-spline with |
do.par |
using parallel computing for bootstrap calculation. If |
nboot |
a number of bootstrap samples for estimating variances and covariances of the estimated regression coefficients. If |
w.cores |
a number of cores that are assigned (the default is |
Details
The function bssmle_aipw_se
estimates bootstrap standard errors for the estimated regression coefficients from the function bssmle
.
Value
The function bssmle_aipw_se
returns a list of components:
notconverged |
a list of number of bootstrap samples that did not converge |
numboot |
a number of bootstrap converged |
Sigma |
an estimated bootstrap variance-covariance matrix of the estimated regression coefficients |
Author(s)
Jun Park, jun.park@alumni.iu.edu
Giorgos Bakoyannis, gbakogia@iu.edu
Competing Risks Regression with Interval-Censored Data
Description
The function ciregic
performs semiparametric regression on cumulative incidence function with interval-censored competing risks data. It fits the proportional subdistribution hazards model (Fine-Gray model), the proportional odds model, and other models that belong to the class of semiparametric generalized odds rate transformation models. The standard errors for the estimated regression coefficients are estimated by a choice of options: 1) the bootstrapping method or 2) the least-squares method.
Usage
ciregic(formula, data, alpha, k = 1, do.par, nboot, ...)
Arguments
formula |
a formula object relating the survival object |
data |
a data frame that includes the variables named in the formula argument |
alpha |
|
k |
a parameter that controls the number of knots in the B-spline with |
do.par |
an option to use parallel computing for bootstrap. If |
nboot |
a number of bootstrap samples for estimating variances and covariances of the estimated regression coefficients. If |
... |
further arguments |
Details
The formula for the model has the form of response ~ predictors
. The response in the formula is a Surv2(v, u, event)
object where v
is the last observation time prior to the failure, u
is the first observation time after the failure, and event
is the event or censoring indicator. event
should include 0, 1 or 2, denoting right-censoring, failure from cause 1 and failure from cause 2, respectively. If event=0
(i.e. right-censored observation) then u
is not included in any calculation as it corresponds to \infty
. The user can provide any value in u
for the right-censored cases, even NA
. The function ciregic
fits models that belong to the class of generalized odds rate transformation models which includes the proportional subdistribution hazards or the Fine-Gray model and the proportional odds model. The parameter \alpha=(\alpha1, \alpha2)
defines the link function/model to be fitted for cause of failure 1 and 2, respectively. A value of 0
corresponds to the Fine-Gray model and a value of 1
corresponds to the proportional odds model. For example, if \alpha=(0,1)
then the function ciregic
fits the Fine-Gray model for cause 1 and the proportional odds model for cause 2.
Value
The function ciregic
provides an object of class ciregic
with components:
varnames |
a vector containing variable names |
coefficients |
a vector of the regression coefficient estimates |
gamma |
a vector of the estimated coefficients for the B-splines |
vcov |
a variance-covariance matrix of the estimated regression coefficients |
alpha |
a vector of the link function parameters |
loglikelihood |
a loglikelihood of the fitted model |
convergence |
an indicator of convegence |
tms |
a vector of the minimum and maximum observation times |
Bv |
a list containing the B-splines basis functions evaluated at |
numboot |
a number of converged bootstrap |
notconverged |
a list of number of bootstrap samples that did not converge |
call |
a matched call |
Author(s)
Giorgos Bakoyannis, gbakogia@iu.edu
Jun Park, jun.park@alumni.iu.edu
References
Bakoyannis, G., Yu, M., and Yiannoutsos C. T. (2017). Semiparametric regression on cumulative incidence function with interval-censored competing risks data. Statistics in Medicine, 36:3683-3707.
Fine, J. P. and Gray, R. J. (1999). A proportional hazards model for the subdistribution of a competing risk. Journal of the American Statistical Association, 94:496-509.
See Also
summary.ciregic
for the summarized results and predict.ciregic
for value of the predicted cumulative incidence functions. coef
and vcov
are the generic functions. dataprep
for reshaping data from a long format to a suitable format to be used in the function ciregic
.
Examples
## Not run:
## Set seed in order to have reproducibility of the bootstrap standard error estimate
set.seed(1234)
## Reshaping data from a long format to a suitable format
newdata <- dataprep(data = longdata, ID = id, time = t,
event = c, Z = c(z1, z2))
## Estimation of regression parameters only. No bootstrap variance estimation.
## with 'newdata'
fit <- ciregic(formula = Surv2(v = v, u = u, event = c) ~ z1 + z2, data = newdata,
alpha = c(1, 1), nboot = 0, do.par = FALSE)
fit
## Bootstrap variance estimation based on 50 replications
fit <- ciregic(formula = Surv2(v = v, u = u, event = c) ~ z1 + z2, data = newdata,
alpha = c(1, 1), nboot = 50, do.par = FALSE)
## End(Not run)
## Note that the user can use parallel computing to decrease
## the computation time of the bootstrap variance-covariance
## estimation (e.g. nboot = 50)
## Summarize semiparametric regression model
summary(fit)
## Predict and draw plot the cumulative incidence function evaluated at z1 = 1 and z2 = 0.5
t <- seq(from = 0, to = 2.8, by = 2.8 / 99)
pred <- predict(object = fit, covp = c(1, 0.5), times = t)
pred
plot(pred$t, pred$cif1, type = "l", ylim = c(0, 1))
points(pred$t, pred$cif2, type = "l", col = 2)
Competing Risks Regression with Interval-Censored Data and Missing Cause of Failure
Description
The function ciregic_aipw
performs semiparametric regression on cumulative incidence function with interval-censored competing risks data in the presence of missing cause of failure. It fits the proportional subdistribution hazards model (Fine-Gray model), the proportional odds model, and other models that belong to the class of semiparametric generalized odds rate transformation models. The estimates have double robustness property, which means that the estimators are consistent even if either the model for the probability of missingness or the model for the probability of the cause of failure is misspecified under the missing at random assumption.
Usage
ciregic_aipw(
formula,
aux = NULL,
data,
alpha,
k = 1,
do.par,
nboot,
w.cores = NULL,
...
)
Arguments
formula |
a formula object relating the survival object |
aux |
auxiliary variable(s) that may be associated with the missingness and the outcome of interest |
data |
a data frame that includes the variables named in the formula argument |
alpha |
|
k |
a parameter that controls the number of knots in the B-spline with |
do.par |
an option to use parallel computing for bootstrap. If |
nboot |
a number of bootstrap samples for estimating variances and covariances of the estimated regression coefficients. If |
w.cores |
a number of cores that are assigned (the default is |
... |
further arguments |
Details
The formula for the model has the form of response ~ predictors
. The response in the formula is a Surv2(v, u, event)
object where v
is the last observation time prior to the event, u
is the first observation time after the event, and event
is the event or censoring indicator. event
should include 0, 1 or 2, denoting right-censoring, event type 1 and 2, respectively. If event=0
(i.e. right-censored observation) then u
is not included in any calculation as it corresponds to \infty
. The user can provide any value in u
for the right-censored cases, even NA
. The function ciregic_aipw
fits models that belong to the class of generalized odds rate transformation models which includes the proportional subdistribution hazards or the Fine-Gray model and the proportional odds model. The parameter \alpha=(\alpha1, \alpha2)
defines the link function/model to be fitted for event 1 and 2, respectively. A value of 0
corresponds to the Fine-Gray model and a value of 1
corresponds to the proportional odds model. For example, if \alpha=(0,1)
then the function ciregic_aipw
fits the Fine-Gray model for the event type 1 and the proportional odds model for the event type 2.
Value
The function ciregic_aipw
provides an object of class ciregic_aipw
with components:
varnames |
a vector containing variable names |
varnames.aux |
a vector containing auxiliary variable names |
coefficients |
a vector of the regression coefficient estimates |
gamma |
a vector of the estimated coefficients for the B-splines |
vcov |
a variance-covariance matrix of the estimated regression coefficients |
alpha |
a vector of the link function parameters |
loglikelihood |
a loglikelihood of the fitted model |
convergence |
an indicator of convegence |
tms |
a vector of the minimum and maximum observation times |
Bv |
a list containing the B-splines basis functions evaluated at |
numboot |
a number of converged bootstrap |
notconverged |
a list of number of bootstrap samples that did not converge |
call |
a matched call |
Author(s)
Jun Park, jun.park@alumni.iu.edu
Giorgos Bakoyannis, gbakogia@iu.edu
References
Bakoyannis, G., Yu, M., and Yiannoutsos C. T. (2017). Semiparametric regression on cumulative incidence function with interval-censored competing risks data. Statistics in Medicine, 36:3683-3707.
Fine, J. P. and Gray, R. J. (1999). A proportional hazards model for the subdistribution of a competing risk. Journal of the American Statistical Association, 94:496-509.
See Also
summary.ciregic_aipw
for the summarized results and predict.ciregic_aipw
for value of the predicted cumulative incidence functions. coef
and vcov
are the generic functions. dataprep function for reshaping data from a long format to a suitable format to be used in the function ciregic_aipw
.
Examples
## Not run:
## Set seed in order to have reproducibility of the bootstrap standard error estimate
set.seed(1234)
## Estimation of regression parameters only. No bootstrap variance estimation.
## with 'simdata_aipw'
data(simdata_aipw)
fit_aipw <- ciregic_aipw(formula = Surv2(v = v, u = u, event = c) ~ z1 + z2, aux = a,
data = simdata_aipw, alpha = c(1, 1), nboot = 0,
do.par = FALSE)
fit_aipw
## Bootstrap variance estimation based on 50 replications
fit_aipw <- ciregic_aipw(formula = Surv2(v = v, u = u, event = c) ~ z1 + z2, aux = a,
data = simdata_aipw, alpha = c(1, 1), k = 1, nboot = 50,
do.par = FALSE)
## End(Not run)
## Note that the user can use parallel computing to decrease
## the computation time of the bootstrap variance-covariance
## estimation (e.g. nboot = 50)
## Summarize semiparametric regression model
summary(fit_aipw)
## Predict and draw plot the cumulative incidence function evaluated at z1 = 1 and z2 = 0.5
t <- seq(from = 0, to = 2.8, by = 2.8 / 99)
pred <- predict(object = fit_aipw, covp = c(1, 0.5), times = t)
pred
plot(pred$t, pred$cif1, type = "l", ylim = c(0, 1))
points(pred$t, pred$cif2, type = "l", col = 2)
Competing Risks Regression with Left-truncated and Interval-Censored Data
Description
The function ciregic_lt
performs semiparametric regression on cumulative incidence function with left-truncated and interval-censored competing risks data. It fits the proportional subdistribution hazards model (Fine-Gray model), the proportional odds model, and other models that belong to the class of semiparametric generalized odds rate transformation models. The least-square method is implemented to estimate the standard error of the regression coefficients.
Usage
ciregic_lt(formula, data, alpha, k = 1, do.par, nboot, ...)
Arguments
formula |
a formula object relating the survival object |
data |
a data frame that includes the variables named in the formula argument |
alpha |
|
k |
a parameter that controls the number of knots in the B-spline with |
do.par |
an option to use parallel computing for bootstrap. If |
nboot |
a number of bootstrap samples for estimating variances and covariances of the estimated regression coefficients. If |
... |
further arguments |
Details
The function ciregic_lt
is capable of analyzing left-truncated and interval-censored competing risks data. A triplet of time points (w, v, u)
is required if an observation is left-truncated and interval-censored. A part of left-truncation is also allowed by defining w = 0
for interval-censored only observation. The formula for the model has the form of response ~ predictors
. The response in the formula is a Surv2(v, u, w, event)
object where w
is a left-truncation time, v
is the last observation time prior to the failure, u
is the first observation time after the failure, and event
is the event or censoring indicator. event
should include 0, 1 or 2, denoting right-censoring, failure from cause 1 and failure from cause 2, respectively. If event=0
(i.e. right-censored observation) then u
is not included in any calculation as it corresponds to \infty
. The user can provide any value in u
for the right-censored cases, even NA
. The function ciregic_lt
fits models that belong to the class of generalized odds rate transformation models which includes the proportional subdistribution hazards or the Fine-Gray model and the proportional odds model. The parameter \alpha=(\alpha1, \alpha2)
defines the link function/model to be fitted for cause of failure 1 and 2, respectively. A value of 0
corresponds to the Fine-Gray model and a value of 1
corresponds to the proportional odds model. For example, if \alpha=(0,1)
then the function ciregic_lt
fits the Fine-Gray model for cause 1 and the proportional odds model for cause 2.
Value
The function ciregic_lt
provides an object of class ciregic_lt
with components:
varnames |
a vector containing variable names |
coefficients |
a vector of the regression coefficient estimates |
gamma |
a vector of the estimated coefficients for the B-splines |
vcov |
a variance-covariance matrix of the estimated regression coefficients |
alpha |
a vector of the link function parameters |
loglikelihood |
a loglikelihood of the fitted model |
convergence |
an indicator of convegence |
tms |
a vector of the minimum and maximum observation times |
Bv |
a list containing the B-splines basis functions evaluated at |
numboot |
a number of converged bootstrap |
notconverged |
a list of number of bootstrap samples that did not converge |
call |
a matched call |
Author(s)
Jun Park, jun.park@alumni.iu.edu
Giorgos Bakoyannis, gbakogia@iu.edu
References
Bakoyannis, G., Yu, M., and Yiannoutsos C. T. (2017). Semiparametric regression on cumulative incidence function with interval-censored competing risks data. Statistics in Medicine, 36:3683-3707.
Fine, J. P. and Gray, R. J. (1999). A proportional hazards model for the subdistribution of a competing risk. Journal of the American Statistical Association, 94:496-509.
See Also
summary.ciregic_lt
for the summarized results and predict.ciregic_lt
for value of the predicted cumulative incidence functions. coef
and vcov
are the generic functions. dataprep
for reshaping data from a long format to a suitable format to be used in the function ciregic_lt
.
Examples
## Not run:
## Set seed in order to have reproducibility of the bootstrap standard error estimate
set.seed(1234)
## Reshaping data from a long format to a suitable format
newdata <- dataprep_lt(data = longdata_lt, ID = id, time = t, W = w,
event = c, Z = c(z1, z2))
## Estimation of regression parameters only. No bootstrap variance estimation.
## with 'newdata'
fit_lt <- ciregic_lt(formula = Surv2(v = v, u = u, w = w, event = c) ~ z1 + z2, data = newdata,
alpha = c(1, 1), nboot = 0, do.par = FALSE)
fit_lt
## Bootstrap variance estimation based on 50 replications
fit_lt <- ciregic_lt(formula = Surv2(v = v, u = u, w = w, event = c) ~ z1 + z2, data = newdata,
alpha = c(1, 1), nboot = 50, do.par = FALSE)
## End(Not run)
## Note that the user can use parallel computing to decrease
## the computation time of the bootstrap variance-covariance
## estimation (e.g. nboot = 50)
## Summarize semiparametric regression model
summary(fit_lt)
## Predict and draw plot the cumulative incidence function evaluated at z1 = 1 and z2 = 0.5
mint <- fit_lt$tms[1]
maxt <- fit_lt$tms[2]
pred <- predict(object = fit_lt, covp = c(1, 0.5),
times = seq(mint, maxt, by = (maxt - mint) / 99))
pred
plot(pred$t, pred$cif1, type = "l", ylim = c(0, 1))
points(pred$t, pred$cif2, type = "l", col = 2)
Data manipulation
Description
The function dataprep
reshapes data from a long format to a ready-to-use format to be used directly in the function ciregic
.
Usage
dataprep(data, ID, time, event, Z)
Arguments
data |
a data frame that includes the variables named in the |
ID |
a variable indicating individuals' ID |
time |
a variable indicating observed time points |
event |
a vector of event indicator. If an observation is righ-censored, |
Z |
a vector of variables indicating name of covariates |
Details
The function dataprep
provides a ready-to-use data format that can be directly used in the function ciregic
. The returned data frame consists of id
, v
, u
, c
, and covariates as columns. The v
and u
indicate time window with the last observation time before the event and the first observation after the event. The c
represents a type of event, for example, c = 1
for the first cause of failure, c = 2
for the second cause of failure, and c = 0
for the right-censored. For individuals having one time record with the event, the lower bound v
will be replaced by zero, for example (0, v]
. For individuals having one time record without the event, the upper bound u
will be replaced by Inf
, for example (v, Inf]
.
Value
a data frame
Author(s)
Jun Park, jun.park@alumni.iu.edu
Giorgos Bakoyannis, gbakogia@iu.edu
Examples
library(intccr)
dataprep(data = longdata, ID = id, time = t, event = c, Z = c(z1, z2))
Data preparation
Description
The function dataprep_lt
reshapes data from a long format to a ready-to-use format to be used directly in the function ciregic_lt
.
Usage
dataprep_lt(data, ID, W, time, event, Z)
Arguments
data |
a data frame that includes the variables named in the |
ID |
a variable indicating individuals' ID |
W |
a vector of left-truncated time points |
time |
a variable indicating observed time points |
event |
a vector of event indicator. If an observation is righ-censored, |
Z |
a vector of variables indicating name of covariates |
Details
The function dataprep_lt
provides a ready-to-use data format that can be directly used in the function ciregic_lt
. The returned data frame consists of id
, v
, u
, c
, and covariates as columns. The v
and u
indicate time window with the last observation time before the event and the first observation after the event. The c
represents a type of event, for example, c = 1
for the first cause of failure, c = 2
for the second cause of failure, and c = 0
for the right-censored. For individuals having one time record with the event, the lower bound v
will be replaced by zero, for example (0, v]
. For individuals having one time record without the event, the upper bound u
will be replaced by Inf
, for example (v, Inf]
.
Value
a data frame
Author(s)
Jun Park, jun.park@alumni.iu.edu
Giorgos Bakoyannis, gbakogia@iu.edu
Derivative of B-spline
Description
Generates the derivative of the B-splines basis matrix.
Usage
dbs(
x,
derivs = 1L,
df = NULL,
knots = NULL,
degree = 3L,
intercept = FALSE,
Boundary.knots = range(x, na.rm = TRUE)
)
Arguments
x |
object of B-splines |
derivs |
a number of derivatives |
df |
degrees of freedom of B-splines |
knots |
a vector of internal knots |
degree |
degrees of B-splines |
intercept |
a logical vector |
Boundary.knots |
a vector of boundary knots |
Details
The function dbs
performs derivatives of B-splines
Value
The function dbs
returns a component:
dMat |
B-spline matrix |
Author(s)
Jun Park, jun.park@alumni.iu.edu
Giorgos Bakoyannis, gbakogia@iu.edu
Output of ciregic
Description
Object contains the output of the function ciregic
. Standard errors were estimated by the least-squares method.
Usage
fit
Format
A list of components.
Examples
fit
Output of ciregic_aipw
Description
A list of outputs containing the last time prior to the event, the first time after the event, cause of failure with 50\%
of missingness, and covariates.
Usage
fit_aipw
Format
A list of 14:
- call
a matched call
- varnames
a vector containing variable names
- varnames.aux
a vector containing auxiliary variable names
- coefficients
a vector of the regression coefficient estimates
- gamma
a vector of the estimated coefficients for the B-splines
- vcov
a variance-covariance matrix of the estimated regression coefficients
- alpha
a vector of the link function parameters
- k
a parameter that controls the number of knots in the B-spline
- loglikelihood
a loglikelihood of the fitted model
- convergence
an indicator of convegence
- tms
a vector of the minimum and maximum observation times
- Bv
a list containing the B-splines basis functions evaluated at
v
- notconverged
a list of number of bootstrap samples not converged
Examples
fit_aipw
Output of ciregic_lt
Description
Object contains the output of the function ciregic_lt
. Standard errors were estimated by the least-squares method.
Usage
fit_lt
Format
A list of components.
Examples
fit_lt
Simulated interval-censored competing risks data - long format
Description
The data containing the subject id, series of time points, cause of failure, and covariates with 200 observations.
Usage
longdata
Format
A data frame with 868 rows and 5 variables.
Examples
library(intccr)
data(longdata)
Simulated left-truncated and interval-censored competing risks data - long format
Description
Data containing observation time points, a left-truncation time, cause of failure, and baseline covariates with 275 observations.
Usage
longdata_lt
Format
A data frame with 275 unique individuals and 6 variables.
Examples
library(intccr)
data(longdata_lt)
Initial values for the sieve maximum likelihood estimation
Description
The function naive_b
provides a vector of initial values for the B-spline sieve maximum likelihood estimation.
Usage
naive_b(data, w = NULL, v, u, c, q, k = 1)
Arguments
data |
a data frame that includes the variables named in each argument |
w |
a left-truncation time (default is |
v |
the last observation time prior to the failure |
u |
the first observation time after the failure |
c |
an indicator of cause of failure, for example, if an observation is righ-censored, |
q |
a number of parameters in design matrix |
k |
a parameter that controls the number of knots in the B-spline with |
Details
The function naive_b
provides initial values for the optimization procedure.
Value
Initial values of B-spline estimation
b |
a vector of the initial values to be used in the optimization process |
Author(s)
Giorgos Bakoyannis, gbakogia@iu.edu
Jun Park, jun.park@alumni.iu.edu
Examples
attach(simdata)
intccr:::naive_b(data = simdata, v = v, u = u, c = c, q = 2)
Covariate-Specific Cumulative Incidence Prediction
Description
predict
method for class ciregic
. It provides the predicted cumulative incidence function for a given covariate pattern and timepoint(s).
Usage
## S3 method for class 'ciregic'
predict(object, covp, times, ...)
Arguments
object |
an object of class |
covp |
a desired values for covariates |
times |
time points that user wants to predict value of cumulative incidence function |
... |
further arguments |
Details
predict.ciregic
returns the predicted cumulative incidence function for a given covariate pattern and timepoint(s).
Value
The function predict.ciregic
returns a list of predicted values of the model from object
.
t |
time points |
cif1 |
the predicted value of cumulative incidence function for the event type 1 |
cif2 |
the predicted value of cumulative incidence function for the event type 2 |
See Also
The fitted semiparametric regression on cumulative incidence function with interval-censored competing risks data ciregic
and summary of the fitted semiparametric regression model summary.ciregic
Examples
## Continuing the ciregic(...) example
pfit <- predict(object = fit, covp = c(1, 0.5), times = c(0.1, 0.15, 0.5, 0.7))
pfit
mint <- fit$tms[1]
maxt <- fit$tms[2]
pfit1 <- predict(object = fit, covp = c(1, 0.5),
times = seq(mint, maxt, by = (maxt-mint)/99))
plot(pfit1$t, pfit1$cif1, ylim = c(0, 1), type = "l")
lines(pfit1$t, pfit1$cif2, ylim = c(0, 1), lty = 2, col = 2)
Covariate-Specific Cumulative Incidence Prediction
Description
predict
method for class ciregic_aipw
. It provides the predicted cumulative incidence function for a given covariate pattern and timepoint(s).
Usage
## S3 method for class 'ciregic_aipw'
predict(object, covp, times, ...)
Arguments
object |
an object of class |
covp |
a desired values for covariates |
times |
time points that user wants to predict value of cumulative incidence function |
... |
further arguments |
Details
predict.ciregic_aipw
returns the predicted cumulative incidence function for a given covariate pattern and timepoint(s).
Value
The function predict.ciregic_aipw
returns a list of predicted values of the model from object
.
t |
time points |
cif1 |
the predicted value of cumulative incidence function for the event type 1 |
cif2 |
the predicted value of cumulative incidence function for the event type 2 |
See Also
The fitted semiparametric regression on cumulative incidence function with interval-censored competing risks data ciregic_aipw
and summary of the fitted semiparametric regression model summary.ciregic_aipw
Examples
## Continuing the ciregic_aipw(...) example
pfit <- predict(object = fit_aipw, covp = c(1, 0.5), times = c(0.1, 0.15, 0.5, 0.7))
pfit
mint <- fit_aipw$tms[1]
maxt <- fit_aipw$tms[2]
pfit1 <- predict(object = fit_aipw, covp = c(1, 0.5),
times = seq(mint, maxt, by = (maxt - mint) / 99))
plot(pfit1$t, pfit1$cif1, ylim = c(0, 1), type = "l")
lines(pfit1$t, pfit1$cif2, ylim = c(0, 1), lty = 2, col = 2)
Covariate-Specific Cumulative Incidence Prediction
Description
predict
method for class ciregic_lt
. It provides the predicted cumulative incidence function for a given covariate pattern and timepoint(s).
Usage
## S3 method for class 'ciregic_lt'
predict(object, covp, times, ...)
Arguments
object |
an object of class |
covp |
a desired values for covariates |
times |
time points that user wants to predict value of cumulative incidence function |
... |
further arguments |
Details
predict.ciregic_lt
returns the predicted cumulative incidence function for a given covariate pattern and timepoint(s).
Value
The function predict.ciregic_lt
returns a list of predicted values of the model from object
.
t |
time points |
cif1 |
the predicted value of cumulative incidence function for the event type 1 |
cif2 |
the predicted value of cumulative incidence function for the event type 2 |
See Also
The fitted semiparametric regression on cumulative incidence function with interval-censored competing risks data ciregic_lt
and summary of the fitted semiparametric regression model summary.ciregic_lt
Examples
## Continuing the ciregic_lt(...) example
pfit <- predict(object = fit_lt, covp = c(1, 0.5), times = c(0.1, 0.15, 0.5, 0.7))
pfit
mint <- fit_lt$tms[1]
maxt <- fit_lt$tms[2]
pfit1 <- predict(object = fit_lt, covp = c(1, 0.5),
times = seq(mint, maxt, by = (maxt - mint) / 99))
plot(pfit1$t, pfit1$cif1, ylim = c(0, 1), type = "l")
lines(pfit1$t, pfit1$cif2, ylim = c(0, 1), lty = 2, col = 2)
Prediction of derivative of B-spline
Description
Evaluates the derivative of the B-splines basis matrix at given values.
Usage
## S3 method for class 'dbs'
predict(object, newx)
Arguments
object |
returned object of B-splines |
newx |
a vector of points |
Details
The function predict
is a generic function of bs.derivs
Value
The function predict
returns a predicted B-splies.
Author(s)
Giorgos Bakoyannis, gbakogia@iu.edu
Jun Park, jp84@alumni.iu.edu
Artificial HIV dataset
Description
Artificial dataset that was simulated to resemble the HIV study on loss to HIV care and death in sub-Saharan Africa, that was presented in Bakoyannis, Yu, & Yiannoutsos (2017). It contains subject id, observation times, cause of failure, and covariates.
Usage
pseudo.HIV.long
Format
A data frame with 22710 rows and 6 variables.
References
Bakoyannis, G., Yu, M., and Yiannoutsos C. T. (2017). Semiparametric regression on cumulative incidence function with interval-censored competing risks data. Statistics in Medicine, 36:3683-3707.
Examples
head(pseudo.HIV.long, n = 20)
Simulated interval-censored competing risks data with 2 covariates - wide format
Description
The data containing the idividual identification number, the last time point prior to the event, the first time point after the event, cause of failure, and covariates with 200 observations.
Usage
simdata
Format
A data frame with 200 rows and 6 variables.
- id
subject id
- v
the last observation time prior to the event
- u
the first observation time after the event
- c
cause of failure with missing
- z1
binary variable
- z2
continuous variable
Examples
library(intccr)
data(simdata)
Simulated interval censored data with 2 covariates in the presence of 50\%
of missing cause of failure - wide format
Description
The dataset containing the individual identification number, the last time prior to the event, the first time after the event, cause of failure with 50\%
of missingness, and covariates.
Usage
simdata_aipw
Format
A data frame with 200 rows and 7 variables:
- id
subject id
- v
the last observation time prior to the event
- u
the first observation time after the event
- c
cause of failure with missing
- z1
binary variable
- z2
continuous variable
- a
auxiliary variable
Examples
library(intccr)
data(simdata_aipw)
Simulated left-truncated and interval-censored competing risks data with 2 covariates - wide format
Description
The data containing the individual identification number, the left-truncated time, the last and first observation time prior to the event and after the event, cause of failure, and baseline covariates with 275 observations.
Usage
simdata_lt
Format
A data frame with 275 unique individuals and 7 variables.
- id
subject id
- w
the left truncation time
- v
the last observation time prior to the event
- u
the first observation time after the event
- c
cause of failure with missing
- z1
binary variable
- z2
continuous variable
Examples
library(intccr)
data(simdata_lt)
Summary of ciregic
Description
summary
method for class ciregic
Usage
## S3 method for class 'ciregic'
summary(object, ...)
Arguments
object |
an object of class |
... |
further arguments |
Details
The function summary.ciregic
returns the coefficients, bootstrap standard errors, and etc. Additionally, 'significance star' is included.
Value
The function summary.ciregic
returns a list of summary statistics of the model from object
.
varnames |
a vector containing variable names |
coefficients |
a vector of the regression coefficient estimates |
se |
a bootstrap standard error of the coefficients |
z |
z value of the estimated coefficients |
p |
p value of the estimated coefficients |
call |
a matched call |
See Also
The fitted semiparametric regression on cumulative incidence function with interval-censored competing risks data ciregic
and values of the predicted cumulative incidence functions predict.ciregic
Examples
## Continuing the ciregic(...) example
sfit <- summary(fit)
sfit
Summary of ciregic_aipw
Description
summary
method for class ciregic_aipw
Usage
## S3 method for class 'ciregic_aipw'
summary(object, ...)
Arguments
object |
an object of class |
... |
further arguments |
Details
The function summary.ciregic_aipw
returns the coefficients, bootstrap standard errors, and etc. Additionally, 'significance star' is included.
Value
The function summary.ciregic_aipw
returns a list of summary statistics of the model from object
.
varnames |
a vector containing variable names |
coefficients |
a vector of the regression coefficient estimates |
se |
a bootstrap standard error of the coefficients |
z |
z value of the estimated coefficients |
p |
p value of the estimated coefficients |
call |
a matched call |
See Also
The fitted semiparametric regression on cumulative incidence function with interval-censored competing risks data ciregic_aipw
and values of the predicted cumulative incidence functions predict.ciregic_aipw
Examples
## Continuing the ciregic_aipw(...) example
sfit <- summary(fit_aipw)
sfit
Summary of ciregic_lt
Description
summary
method for class ciregic_lt
Usage
## S3 method for class 'ciregic_lt'
summary(object, ...)
Arguments
object |
an object of class |
... |
further arguments |
Details
The function summary.ciregic_lt
returns the coefficients, bootstrap standard errors, and etc. Additionally, 'significance star' is included.
Value
The function summary.ciregic_lt
returns a list of summary statistics of the model from object
.
varnames |
a vector containing variable names |
coefficients |
a vector of the regression coefficient estimates |
se |
a bootstrap standard error of the coefficients |
z |
z value of the estimated coefficients |
p |
p value of the estimated coefficients |
call |
a matched call |
See Also
The fitted semiparametric regression on cumulative incidence function with interval-censored competing risks data ciregic_lt
and values of the predicted cumulative incidence functions predict.ciregic_lt
Examples
## Continuing the ciregic_lt(...) example
sfit_lt <- summary(fit_lt)
sfit_lt
Variance-covariance matrix of ciregic
Description
vcov
method for class ciregic
Usage
## S3 method for class 'ciregic'
vcov(object, ...)
Arguments
object |
an object of class |
... |
further arguments |
Details
The function vcov
returns the variance-covariance matrix of the fitted semiparametric regression model.
Value
The estimated bootstrap variance-covariance matrix
See Also
The fitted semiparametric regression on cumulative incidence function with interval-censored competing risks data ciregic
, summary of the fitted semiparametric regression model summary.ciregic
, and values of predicted cumulative incidence functions predict.ciregic
Examples
## Continuing the ciregic(...) example
vcov(fit)
Variance-covariance matrix of ciregic_aipw
Description
vcov
method for class ciregic_aipw
Usage
## S3 method for class 'ciregic_aipw'
vcov(object, ...)
Arguments
object |
an object of class |
... |
further arguments |
Details
The function vcov
returns the variance-covariance matrix of the fitted semiparametric regression model.
Value
The estimated bootstrap variance-covariance matrix
See Also
The fitted semiparametric regression on cumulative incidence function with interval-censored competing risks data ciregic_aipw
, summary of the fitted semiparametric regression model summary.ciregic_aipw
, and values of predicted cumulative incidence functions predict.ciregic_aipw
Examples
## Continuing the ciregic_aipw(...) example
vcov(fit_aipw)
Variance-covariance matrix of ciregic_lt
Description
vcov
method for class ciregic_lt
Usage
## S3 method for class 'ciregic_lt'
vcov(object, ...)
Arguments
object |
an object of class |
... |
further arguments |
Details
The function vcov
returns the variance-covariance matrix of the fitted semiparametric regression model.
Value
The estimated bootstrap variance-covariance matrix
See Also
The fitted semiparametric regression on cumulative incidence function with interval-censored competing risks data ciregic_lt
, summary of the fitted semiparametric regression model summary.ciregic_lt
, and values of predicted cumulative incidence functions predict.ciregic_lt
Examples
## Continuing the ciregic_lt(...) example
vcov(fit_lt)
Variance-covariance matrix of summary.ciregic
Description
vcov
method for class summary.ciregic
Usage
## S3 method for class 'summary.ciregic'
vcov(object, ...)
Arguments
object |
an object of class |
... |
further arguments |
Details
The vcov
returns the variance-covariance matrix of the fitted semiparametric regression model.
Value
The estimated bootstrap variance-covariance matrix
See Also
The fitted semiparametric regression on cumulative incidence function with interval-censored competing risks data ciregic
, summary of the fitted semiparametric regression model summary.ciregic
, and values of the predicted cumulative incidence functions predict.ciregic
Examples
## Continuing the ciregic(...) example
vcov(summary(fit))
Variance-covariance matrix of summary.ciregic_aipw
Description
vcov
method for class summary.ciregic_aipw
Usage
## S3 method for class 'summary.ciregic_aipw'
vcov(object, ...)
Arguments
object |
an object of class |
... |
further arguments |
Details
The vcov
returns the variance-covariance matrix of the fitted semiparametric regression model.
Value
The estimated bootstrap variance-covariance matrix
See Also
The fitted semiparametric regression on cumulative incidence function with interval-censored competing risks data ciregic_aipw
, summary of the fitted semiparametric regression model summary.ciregic_aipw
, and values of the predicted cumulative incidence functions predict.ciregic_aipw
Examples
## Continuing the ciregic_aipw(...) example
vcov(summary(fit_aipw))
Variance-covariance matrix of summary.ciregic_lt
Description
vcov
method for class summary.ciregic_lt
Usage
## S3 method for class 'summary.ciregic_lt'
vcov(object, ...)
Arguments
object |
an object of class |
... |
further arguments |
Details
The vcov
returns the variance-covariance matrix of the fitted semiparametric regression model.
Value
The estimated bootstrap variance-covariance matrix
See Also
The fitted semiparametric regression on cumulative incidence function with interval-censored competing risks data ciregic_lt
, summary of the fitted semiparametric regression model summary.ciregic_lt
, and values of the predicted cumulative incidence functions predict.ciregic_lt
Examples
## Continuing the ciregic_lt(...) example
vcov(summary(fit_lt))
Wald test for ciregic
and ciregic_lt
Description
waldtest
for class ciregic
or ciregic_lt
. This provides the result of Wald test for the fitted model from the function ciregic
or ciregic_lt
.
Usage
waldtest(obj1, obj2 = NULL, ...)
Arguments
obj1 |
an object of the fitted model in |
obj2 |
an object of the fitted model in |
... |
further arguments |
Details
The function waldtest.ciregic
returns a result of Wald test.
Value
The function waldtest
returns an output table of Wald test of the model from object
.
varnames.full |
a variable name of a vector of variables names in the full model |
varnames.nested |
a variable name of a vector of variables names in the nested model |
vcov |
the estimated bootstrap variance-covariance matrix for overall Wald test |
vcov.event1 |
the estimated bootstrap variance-covariance matrix for cause-specific Wald test (event type 1) |
vcov.event2 |
the estimated bootstrap variance-covariance matrix for cause-specific Wald test (event type 2) |
table |
a table including test statistic, degrees of freedom, and p-value |
Author(s)
Jun Park, jun.park@alumni.iu.edu
Giorgos Bakoyannis, gbakogia@iu.edu
See Also
The fitted semiparametric regression on cumulative incidence function with interval-censored competing risks data ciregic
and left-truncated and interval-censored competing risks data ciregic_lt
Examples
## Continuing the ciregic(...) example
library(intccr)
waldtest(obj1 = fit)
set.seed(12345)
newdata <- dataprep(data = longdata, ID = id, time = t,
event = c, Z = c(z1, z2))
fit.nested <- ciregic(formula = Surv2(v = v, u = u, event = c) ~ z2, data = newdata,
alpha = c(1, 1), nboot = 0, do.par = FALSE)
waldtest(obj1 = fit, obj2 = fit.nested)