A function designed to simulate IRT ideal point data.
id_sim_gen(num_person = 20, num_bills = 50, model_type = "binary",
latent_space = FALSE, absence_discrim_sd = 2,
absence_diff_mean = 0.5, reg_discrim_sd = 2, diff_sd = 0.25,
time_points = 1, time_process = "random", time_sd = 0.1,
ideal_pts_sd = 1, prior_type = "gaussian", ordinal_outcomes = 3,
inflate = FALSE, sigma_sd = 1)
The number of persons/persons
The number of items/bills
One of 'binary'
, 'ordinal_rating'
, 'ordinal_grm'
, 'poisson'
'normal'
, or 'lognormal'
Whether to use the latent space formulation of the ideal point model
FALSE
by default. NOTE: currently, the package only has estimation for a
binary response with the latent space formulation.
The SD of the discrimination parameters for the inflated model
The mean intercept for the inflated model; increasing it will lower the total number of missing data
The SD of the discrimination parameters for the non-inflated model
The SD of the difficulty parameters (bill/item intercepts)
The number of time points for time-varying legislator/person parameters
The process used to generate the ideal points: either 'random'
for a random walk, 'AR'
for an AR1 process,
or 'GP'
for a Gaussian process.
The standard deviation of the change in ideal points over time (should be low relative to
ideal_pts_sd
)
The SD for the person/person ideal points
The statistical distribution that generates the data. Currently only 'gaussian' is supported.
If model
is 'ordinal'
, an integer giving the total number of categories
If TRUE
, an missing-data-inflated dataset is produced.
If a normal or log-normal distribution is being fitted, this parameter gives the standard deviation of the outcome (i.e. the square root of the variance).
The results is a idealdata
object that can be used in the
id_estimate
function to run a model. It can also be used in the simulation
plotting functions.
This function produces simulated data that matches (as closely as possible) the models used in the underlying Stan code. Currently the simulation can produce inflated and non-inflated models with binary, ordinal (GRM and rating-scale), Poisson, Normal and Log-Normal responses.
id_plot_sims
for plotting fitted models versus true values.