recEvFit: Left-censored recurrent events survival models

Description Usage Arguments Value Author(s) See Also Examples

View source: R/recEvFit.R

Description

The function allows the user to fit recurrent events survival models.

Usage

1
2
recEvFit(formula, data, id, prevEp, riskBef, oldInd,
         frailty=FALSE, m=5, seed=NA, ...)

Arguments

formula

a formula object, with the response on the left of a ~ operator, and the terms on the right. The response must be a survival object as returned by the Surv function.

data

a data.frame in which to interpret the variables named in the formula.

id

subject identifier.

prevEp

known previous episodes.

riskBef

indicator for new individual in the cohort (riskBef==FALSE) or subject who was at risk before the start of follow-up (riskBef==TRUE).

oldInd

time an individual has been at risk prior to the follow-up.

frailty

should the model include a frailty term. Defaults to FALSE.

m

number of multiple imputations. The default is m=5.

seed

an integer that is used as argument by the set.seed function for offsetting the random number generator. Default is to leave the random number generator alone.

...

extra arguments to pass to coxph.

Value

A list with seven elements:

fit

a list with all the coxph objects fitted for each imputed dataset.

coeff

a list with the vectors of coefficients from the models fitted to each imputed dataset

loglik

a list with the loglikelihood for each model fitted.

vcov

a list with the variance-covariance matrices for the parameters fitted for each of the imputed datasets.

AIC

a list with the AIC of each of the models fitted.

CMP

summary tables of the fitted COMPoisson models used for imputing missing values

data.impute

the original dataset with the multiple imputed variables as final columns.

Author(s)

David Moriña (University of Barcelona), Gilma Hernández-Herrera (Universidad de Antioquía), Albert Navarro (Universitat Autònoma de Barcelona)

Mantainer: David Moriña <dmorina@ub.edu>

See Also

miRecSurv-package

Examples

1
2
3
4
5
data(sim.data)
fit <- recEvFit(Surv(start2, stop2, status)~x+x.1+x.2, data=sim.data,
                id="nid", prevEp = "obs.episode",
                riskBef = "risk.bef", oldInd = "old", frailty=FALSE, m=5)
summary(fit)

miRecSurv documentation built on Aug. 17, 2021, 5:06 p.m.