Description Usage Arguments Details Value Author(s)
Generate an rms:Predict
object or data frame for an ensemble of
simulated disease registries
1 2 3 4 5 6 7 8 9 10 11 12 | predReg(genReg, N, M = 100, fit = NULL,
adjust.to = fit$Design$limits["Adjust to", ],
do.pred = function(df) {
fit.call <- fit$call
fit.call$data <- quote(df)
fit <- eval(fit.call)
fit$Design$limits["Adjust to", names(adjust.to)] <- adjust.to
if(is(fit, "lrm"))
Predict(fit, fun = plogis)
else
Predict(fit) },
...)
|
genReg |
A function that returns a simulated registry dataset, taking as
its first parameter the desired size of the simulated registry,
and possibly other parameters passed through via the |
N |
Size of generated registries |
M |
Size of the ensemble |
fit |
A fitted model usually intended to serve as a template
for a model to be fitted to the simulated registries.
This may be |
adjust.to |
A list of adjust-to values for the fitted models,
defaulting to the adjust-to parameters of |
do.pred |
A function to be run on the data generated during each iteration
of the simulation, generating either an |
... |
Additional parameters passed to |
Given a function for generating a simulated disease registry, this function
generates an ensemble of such registries. It then returns an rms:Predict
object that contains ensemble-averaged predictions and confidence bounds.
Depending on the return type of do.pred
, either an
rms:Predict
object containing ensemble-averaged predictions
with confidence bounds reflecting their estimated ensemble variance,
or else a data frame collecting the vector returned by do.pred
David C. Norris
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.