| id_plot_all_hist | R Documentation |
This function produces density plots of the different types of parameters in an idealstan model: item (bill) difficulty and discrimination
parameters, and person (legislator) ideal points.
id_plot_all_hist(
object,
params = "person",
param_labels = NULL,
dens_type = "all",
return_data = FALSE,
func = median,
...
)
object |
A fitted |
params |
Select the type of parameter from the model to plot. |
param_labels |
A vector of labels equal to the number of parameters. Primarily useful if |
dens_type |
Can be |
return_data |
Whether or not to return the plot as a ggplot2 object and the data together in a list instead of plotting. |
func |
The function to use if |
... |
Other options passed on to the plotting function, currently ignored. |
A ggplot2 object showing density or histogram plots of the selected model parameters.
If return_data=TRUE, a list with elements plot and data.
sim <- id_sim_gen()
est <- id_estimate(sim, model_type=1, fixtype='vb_full',
use_method="pathfinder", nchains=2, ncores=2)
# plot posterior distribution of person ideal points
id_plot_all_hist(est, params='person')
# plot item discrimination parameters
id_plot_all_hist(est, params='obs_discrim')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.