plot.smcfcs | R Documentation |
Visualises the contents of smCoefIter. Specifically, it plots the parameter estimates of the substantive model against the number of iterations from the imputation procedure. This is done for each regression coefficient, and each line corresponds to an imputed dataset.
## S3 method for class 'smcfcs'
plot(x, include = "all", ...)
x |
An object of class 'smcfcs' |
include |
Character vector of coefficient names for which to return the convergence plot. Default is "all" and returns plots for all coefficients in a facetted manner. Recommendation is to plot first with include = "all", and then select coefficient names to zoom in to. For competing risks, the coefficients are indexed by their cause. E.g. for coefficient of a variable x1 in a model for cause 2, will be labelled "x1-cause2". |
... |
Additional parameters to pass on to ggplot2::facet_wrap(), eg. nrow = 2 |
Requires loading of ggplot2 plotting library.
A ggplot2 object, containing the convergence plots, facetted per covariate in the substantive model
Edouard F. Bonneville e.f.bonneville@lumc.nl
## Not run:
# Use simulated competing risks example in package
imps <- smcfcs(
originaldata = ex_compet,
smtype = "compet",
smformula = list(
"Surv(t, d == 1) ~ x1 + x2",
"Surv(t, d == 2) ~ x1 + x2"
),
method = c("", "", "norm", "norm")
)
plot(imps)
plot(imps, include = c("x1-cause1", "x2-cause2"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.