Description Usage Arguments Examples
View source: R/STATEOCCUPANCYCOX_IMP.R
This function uses RShiny to plot predicted state occupancy probabilities, overall survival probabilities, event-free probabilities, and the transition cumulative hazards for a particular set of covariate values. These probabilities are estimated based on a Multistate cure model fit with COX baseline hazards fit using the MCEM algorithm. The estimated probabilities incorporate only baseline information. This function cannot be applied for prediction when recurrence time is included in the model from recurrence to death.
1 2 | STATEOCCUPANCYCOX_IMP(times, TransCov, newCov, beta, alpha, Basehaz13,
Basehaz24, Basehaz14, Basehaz34)
|
times |
number of iterations for the EM or MCEM algorithm |
TransCov |
a list with elements: Trans13, Trans24, Trans14, Trans34, PNonCure. Each list element is a vector containing the names of the variables in newCov to be used in the model for the corresponding transition. 13 is NonCured -> Recurrence, 24 is Cured -> Death, 14 is NonCured -> Death, 34 is Recurrence -> Death. PNonCure contains the names of the newCovariates for the logistic regression for P(NonCure). |
newCov |
A dataframe with columns corresponding to newCovariates used in the model fit. The rows should correspond to the newCovariate values for which we will make our predictions. |
beta |
Estimate from multistate cure model fit |
alpha |
Estimate from multistate cure model fit |
Basehaz13 |
Estimate of the baseline hazard for the 1->3 transition. This is estimated using function BaselineHazard_IMP. |
Basehaz24 |
Estimate of the baseline hazard for the 2->4 transition. This is estimated using function BaselineHazard_IMP. |
Basehaz14 |
Estimate of the baseline hazard for the 1->4 transition. This is estimated using function BaselineHazard_IMP. |
Basehaz34 |
Estimate of the baseline hazard for the 3->4 transition. This is estimated using function BaselineHazard_IMP. |
shape |
Estimate from multistate cure model fit |
1 2 3 4 5 6 7 8 9 10 | attach(SimulateMultiCure(type = "CovariateMissingness"))
Cov = data.frame(X1,X2)
VARS = names(Cov)
TransCov = list(Trans13 = VARS, Trans24 = VARS, Trans14 = VARS, Trans34 = VARS, PNonCure = VARS)
datWIDE = data.frame( Y_R, Y_D, delta_R , delta_D, G)
fit = MultiCure(iternum = 100, datWIDE, Cov, ASSUME = "SameHazard", TransCov = TransCov, BASELINE = "cox", IMPNUM = 10, COVIMPUTEFUNCTION = COVIMPUTEFUNCTION, COVIMPUTEINITIALIZE = COVIMPUTEINITIALIZE) ### Note: This will take awhile
beta = apply(fit[[3]][,90:100], 1, mean)
alpha = apply(fit[[4]][,90:100], 1, mean)
haz = Baselinehazard_IMP(datWIDE, CovImp = fit[[5]],GImp = fit[[6]], YRImp = fit[[7]],deltaRImp = fit[[8]], beta, alpha, TransCov, ASSUME = "SameHazard")
STATEOCCUPANCYCOX_IMP(times = seq(0,100,5), TransCov, newCov = data.frame(X1 = 0, X2 = 0), beta, alpha, Basehaz13 = haz[[1]], Basehaz24 = haz[[2]], Basehaz14 = haz[[3]], Basehaz34 = haz[[4]]) ### Note: This will take awhile
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.