Learn R Programming

SemiCompRisks (version 2.4)

FreqID: The function to fit parametric Weibull models for the frequentist anlaysis of semi-competing risks data.

Description

Independent semi-competing risks data can be analyzed using hierarchical models. Markov or semi-Markov assumption can be adopted for the conditional hazard function for time to the terminal event given time to non-terminal event.

Usage

FreqID(Y, lin.pred, data, model="semi-Markov", frailty = TRUE)

Arguments

Y
a data.frame containing semi-competing risks outcomes from n subjects. It is of dimension $n\times 4$: the columns correspond to $y_1$, $\delta_1$, $y_2$, $\delta_2$.
lin.pred
a list containing three formula objects that correspond to $h_g$, $g$=1,2,3.
data
a data.frame in which to interpret the variables named in the formulas in lin.pred.
model
a character value that specifies the type of a model based on the assumption on $h_3$: "semi-Markov" or "Markov".
frailty
a logical value to determine whether to include the subject-specific shared frailty term, $\gamma$, into the model.

Value

  • FreqID returns an object of class Freq.

Details

See BayesID for a detailed description of the models.

References

Lee, K. H., Haneuse, S., Schrag, D., and Dominici, F. (2015), Bayesian semiparametric analysis of semicompeting risks data: investigating hospital readmission after a pancreatic cancer diagnosis, Journal of the Royal Statistical Society: Series C, 64, 2, 253-273.

See Also

print.Freq, summary.Freq, plot.Freq, BayesID.

Examples

Run this code
# loading a data set
data(scrData)
Y <- scrData[,c(1,2,3,4)]
form1 <- as.formula( ~ x1 + x2 + x3)
form2 <- as.formula( ~ x1 + x2)
form3 <- as.formula( ~ x1 + x2)
lin.pred <- list(form1, form2, form3)

fit_WB	<- FreqID(Y, lin.pred, data=scrData, model="semi-Markov")

fit_WB
summ.fit_WB <- summary(fit_WB); names(summ.fit_WB)
summ.fit_WB
plot(fit_WB, tseq=seq(from=0, to=30, by=5))
plot(fit_WB, tseq=seq(from=0, to=30, by=5), plot.est = "BH")
names(fit_WB.plot <- plot(fit_WB, tseq=seq(0, 30, 5), plot=FALSE))

Run the code above in your browser using DataLab