id_plot_gbeta_prior: Launch the Generalized Beta Distribution Explorer Shiny App

View source: R/Plot.R

id_plot_gbeta_priorR Documentation

Launch the Generalized Beta Distribution Explorer Shiny App

Description

This function starts an interactive Shiny application to visualize a generalized Beta distribution on a symmetrical interval from -scale to +scale in order to calculate the distribution paramters alpha (the restrict_sd_high/restrict_N_low parameter to id_estimate) and beta (the restrict_N_high/restrict_sd_low parameter to id_estimate). This function is useful for understanding what values to use to pin item discrimination parameters in id_estimate given a specific prior mean initial_y and a relative level of precision prior_sample_size (also known as phi). Higher values of prior_sample_size will imply a tighter prior around the pinned discrimination parameter.

Usage

id_plot_gbeta_prior(initial_y = 0, prior_sample_size = 200, limits = c(-1, 1))

Arguments

initial_y

Initial observed variate y (default: 0)

prior_sample_size

Relative level of precision/tightness around y (default: 200). Can be thought of as the relative sample size used to estimate y.

limits

Limits of prior. Default is ⁠[-1,1]⁠. Set to ⁠[0,1]⁠ for a conventional IRT with all positive discrimination parameters (i.e. as in a test-taking scenario).

Details

The function is also useful for calculating the prior for all non-constrained discrimination parameters as well (discrim_reg_shape and discrim_reg_scale). These parameters are denoted in the Shiny app output for easy cut and paste to the id_estimate function call.

Value

A ggplot2 object showing the generalized Beta prior distribution for the selected parameter values, or an interactive Shiny application if run interactively.

Examples

# Launch interactive Shiny app to explore the generalized Beta prior
if(interactive()) {

id_plot_gbeta_prior(initial_y=0.5, prior_sample_size=200)

}

idealstan documentation built on May 13, 2026, 1:08 a.m.