From using smcfcs regularly, I had made a helper function to check for convergence - I thought it could be useful to have it in the package as a plot() method, as is done in the mice package.
It requires loading ggplot2, which is thus added to suggests instead of imports in DESCRIPTION. To make it work, running smcfcs() returns an object of class "smcfcs", and the list returned additionally contains element smInfo = list("smtype" = smtype, "smformula" = smformula) (on top of impDatasets and smCoefIter). Latest commit passes CRAN/travis checks, and have tested it locally on all smtypes (based on examples in testthat).
I am also happy to re-work this so instead of using ggplot2 it uses base R graphics, with the lattice package - let me know what your preference might be. Thanks!
Best,
Ed
Example
library(smcfcs)
library(ggplot2)
imps <- smcfcs(
originaldata = ex_linquad,
smtype = "lm",
smformula = "y ~ z + x + xsq",
method = c("", "", "norm", "x^2", ""),
numit = 30,
m = 10
)
plot(imps)
Hi Jonathan,
From using smcfcs regularly, I had made a helper function to check for convergence - I thought it could be useful to have it in the package as a
plot()
method, as is done in the mice package.It requires loading ggplot2, which is thus added to suggests instead of imports in DESCRIPTION. To make it work, running
smcfcs()
returns an object of class "smcfcs", and the list returned additionally contains elementsmInfo = list("smtype" = smtype, "smformula" = smformula)
(on top of impDatasets and smCoefIter). Latest commit passes CRAN/travis checks, and have tested it locally on all smtypes (based on examples in testthat).I am also happy to re-work this so instead of using ggplot2 it uses base R graphics, with the lattice package - let me know what your preference might be. Thanks!
Best, Ed
Example