View source: R/create_model_info.r
produce_model_function | R Documentation |
This internal function takes the model type, parsed formula, inference, and extra args and returns a list with all of the specific information (e.g., extra functions) needed to run the model. The output is used in the frequentist and Bayesian internal model run functions.
produce_model_function( model.type, formula.parsed, inference, model.extra.args = NULL, main.ivs = NULL )
model.type |
The type of model to run. |
formula.parsed |
The parsed formula object. |
inference |
Whether the model should be run using 'frequentist' or 'Bayesian' inference. |
model.extra.args |
Extra arguments passed to the function used to run the model. |
main.ivs |
A list of the main effects (e.g., a treatment) that the analysis is focused on. Used on to identify if a survival model has time-varying hazards. |
Based on the type of model to run and the statistical inference used, this function returns a list of model-specific functions and flags that allow the model to be easily run.
The functions model_run.frequentist' and 'model_run.bayesian' take the returns from this function and actually run the model. For a frequentist approach the model is run once for each random sample of the main data. For the Bayesian approach the model is run once for each chain.
Other model setup functions:
determine_model()
,
identify_tve()
,
parse_formula()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.