View source: R/estimate_plots.R
A function to parameter estimate plots with 95 percent confidence bounds for up to two models we wish to compare.
1 2 | estimate_plots(model1, model2 = NULL, type = c("glm/lm", "zero-inflated",
"generic"), model1_name = "Model 1", model2_name = "Model 2")
|
model1 |
A model object returned by a regression estimation routine in R that we wish to plot the parameter estimates of. |
model2 |
A optional second model object returned by a regression estimation routine in R that we wish to plot the parameter estimates of alongside model 1. Defaults to NULL if no comparison model is provided. |
type |
The type of model object(s) we are passing to the plotting function. Defaults to "glm/lm", in which case the function expects model output of type "lm" or "glm" to plot. Alternatively, "zero-inflated" may be selected, in which case the function expects model output from the zeroinfl() function available in the pscl package. Finally, a list object may be provided if the user wishes to pass in estimation results that are hand-rolled or do not follow the formatting in one of the above packages. In this case, the list object must contain a $varnames field with variable names as they will displayed in the plots, a $coefficients field with the coefficient values as a numeric vector, and an $se field containing a numeric vector of standard errors for those coefficient values. The function currently does not support comparison between different types of models, but may do so in the future. |
model1_name |
The name we wish to give model1 in the legend if plotting two model's parameter estimates together. Defaults to "Model 1". |
model2_name |
The name we wish to give model2 in the legend if plotting two model's parameter estimates together. Defaults to "Model 2". |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.