| id_plot_items | R Documentation |
This function plots item-level parameters (discrimination or difficulty) from a
fitted idealstan object. It can display both observed (non-inflated) and
missing (inflated) item parameters.
id_plot_items(
object,
param_type = "discrimination",
item_type = "both",
include = NULL,
high_limit = 0.95,
low_limit = 0.05,
text_size_label = 2,
point_size = 1,
item_labels = TRUE,
order_by = "median",
return_data = FALSE,
show_true = FALSE,
use_chain = NULL,
...
)
object |
A fitted |
param_type |
Which parameter to plot: |
item_type |
Which item parameters to show: |
include |
A character vector of item IDs to include in the plot (all others excluded). If NULL (default), all items are shown. |
high_limit |
The quantile (number between 0 and 1) for the high end of posterior uncertainty to show in plot. Default is 0.95. |
low_limit |
The quantile (number between 0 and 1) for the low end of posterior uncertainty to show in plot. Default is 0.05. |
text_size_label |
The size of text labels for item names. Default is 2. |
point_size |
The size of points in the plot. Default is 1. |
item_labels |
If |
order_by |
How to order items: |
return_data |
If |
show_true |
If the model was fitted on simulated data, show the true parameter values.
Default is |
use_chain |
Which MCMC chains to use. Default is NULL (use all chains). |
... |
Other arguments (currently ignored) |
A ggplot2 object, or if return_data=TRUE, a list with elements plot and data.
to_idealstan <- id_make(score_data = senate114,
outcome_disc = 'cast_code',
person_id = 'bioname',
item_id = 'rollnumber',
time_id='date')
fitted_model <- id_estimate(to_idealstan,
model_type = 2,
use_method = "pathfinder",
fixtype='vb_partial',
restrict_ind_high = "BARRASSO, John A.",
restrict_ind_low = "WARREN, Elizabeth")
# After fitting a model:
# Plot discrimination parameters for all items
id_plot_items(fitted_model)
# Plot only difficulty parameters
id_plot_items(fitted_model, param_type = "difficulty")
# Plot only observed (non-inflated) discrimination
id_plot_items(fitted_model, item_type = "observed")
# Plot specific items only
id_plot_items(fitted_model, include = c("224", "368", "391"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.