Description Usage Arguments Author(s) Examples
This function performs CSVS given a model fitted using the multinom()
function of the nnet
package or the vglm()
function of the
VGAM
package.
1 |
g |
the estimated g, must be fixed to one value |
model |
the model fitted using either |
discreteSurv |
Boolean variable telling us whether a 'simple' multinomial regression is looked for or if the goal is a discrete survival-time model for multiple modes of failure is needed. |
nbIntercepts |
how many cause-specific intercepts are there? they |
package |
Which package has been used to fit the model, |
Rachel Heyard
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # data extraction:
data("VAP_data")
# the definition of the full model with three potential predictors:
FULL <- outcome ~ ns(day, df = 4) + gender + type + SOFA
# here the define time as a spline with 3 knots
# we first need to fit the multinomial model:
model_full <- multinom(formula = FULL, data = VAP_data,
maxit = 150, trace = FALSE)
G <- 9 # let's suppose g equals to nine
# then we proceed to CSVS
CSVS_nnet <- CSVS(g = G, model = model_full,
discreteSurv = TRUE, package = 'nnet')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.