create_params | R Documentation |
create_params
is a generic function for creating an object containing
parameters from a fitted statistical model. If uncertainty != "none"
,
then random samples from suitable probability distributions are returned.
create_params(object, ...) ## S3 method for class 'lm' create_params(object, n = 1000, uncertainty = c("normal", "none"), ...) ## S3 method for class 'multinom' create_params(object, n = 1000, uncertainty = c("normal", "none"), ...) ## S3 method for class 'multinom_list' create_params(object, n = 1000, uncertainty = c("normal", "none"), ...) ## S3 method for class 'flexsurvreg' create_params(object, n = 1000, uncertainty = c("normal", "none"), ...) ## S3 method for class 'flexsurvreg_list' create_params(object, n = 1000, uncertainty = c("normal", "none"), ...) ## S3 method for class 'partsurvfit' create_params( object, n = 1000, uncertainty = c("normal", "bootstrap", "none"), max_errors = 0, silent = FALSE, ... )
object |
A statistical model to randomly sample parameters from. |
... |
Currently unused. |
n |
Number of random observations to draw. Not used if |
uncertainty |
Method determining how parameter uncertainty should be handled.
If |
max_errors |
Maximum number of errors that are allowed when fitting statistical models during the bootstrap procedure. This argument may be useful if, for instance, the model fails to converge during some bootstrap replications. Default is 0. |
silent |
Logical indicating whether error messages should be suppressed. Passed to
the |
An object prefixed by params_
. Mapping between create_params
and the classes of the returned objects are:
create_params.lm
-> params_lm
create_params.multinom
-> params_mlogit
create_params.multinom_list
-> params_mlogit_list
create_params.flexsurvreg
-> params_surv
create_params.flexsurvreg_list
-> params_surv_list
create_params.partsurvfit
-> params_surv_list
These methods are typically used alongside create_input_mats()
to create model objects as a function of input data and a
fitted statistical model. For instance,
create_PsmCurves()
creates the survival model for a partitioned survival model,
create_IndivCtstmTrans()
creates the transition model for an individual
continuous time state transition model,
create_CohortDtstmTrans()
creates the transition model for a cohort discrete
time state transition model, and
create_StateVals()
creates a health state values model.
# create_params.lm fit <- lm(costs ~ female, data = psm4_exdata$costs$medical) n <- 5 params_lm <- create_params(fit, n = n) head(params_lm$coefs) head(params_lm$sigma) # create_params.flexsurvreg library("flexsurv") fit <- flexsurvreg(formula = Surv(futime, fustat) ~ 1, data = ovarian, dist = "weibull") n <- 5 params_surv_wei <- create_params(fit, n = n) print(params_surv_wei$dist) head(params_surv_wei$coefs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.