| id_plot_legis_var | R Documentation |
This function can be used on a fitted idealstan object to plot the over-time variances
(average rates of change in ideal points) for all the persons/legislators in the model.
id_plot_legis_var(
object,
return_data = FALSE,
include = NULL,
high_limit = 0.95,
low_limit = 0.05,
text_size_label = 2,
text_size_group = 2.5,
point_size = 1,
hjust_length = -0.7,
person_labels = TRUE,
group_labels = FALSE,
person_ci_alpha = 0.1,
group_color = TRUE,
...
)
object |
A fitted |
return_data |
If true, the calculated legislator/bill data is returned along with the plot in a list |
include |
Specify a list of person/legislator IDs to include in the plot (all others excluded) |
high_limit |
The quantile (number between 0 and 1) for the high end of posterior uncertainty to show in plot |
low_limit |
The quantile (number between 0 and 1) for the low end of posterior uncertainty to show in plot |
text_size_label |
ggplot2 text size for legislator labels |
text_size_group |
ggplot2 text size for group text used for points |
point_size |
If |
hjust_length |
horizontal adjustment of the legislator labels |
person_labels |
if |
group_labels |
if |
person_ci_alpha |
The transparency level of the dot plot and confidence bars for the person ideal points |
group_color |
If |
... |
Other options passed on to plotting function, currently ignored |
This function will plot the person/legislator over-time variances as a vertical
dot plot with associated high-density posterior interval (can be changed
with high_limit and low_limit options).
A ggplot2 object showing person/legislator over-time variance in ideal points as a dot
plot with posterior intervals. If return_data=TRUE, a list with elements plot and data.
data('senate114')
senate114$cast_code <- ifelse(senate114$cast_code=="Absent", NA,
as.integer(senate114$cast_code) - 1L)
senate_data <- id_make(senate114, outcome_disc='cast_code',
person_id='bioname', item_id='rollnumber',
group_id='party_code', time_id='date')
senate_time_fit <- id_estimate(senate_data,
model_type=2, fixtype='vb_full',
vary_ideal_pts='random_walk',
use_method="pathfinder",
restrict_ind_high="WARREN, Elizabeth",
restrict_ind_low="BARRASSO, John A.",
nchains=2, ncores=4)
id_plot_legis_var(senate_time_fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.