id_sim_gen: Simulate IRT ideal point data

Description Usage Arguments Details Value See Also

View source: R/Simulate.R

Description

A function designed to simulate IRT ideal point data.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
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
)

Arguments

num_person

The number of persons/persons

num_bills

The number of items/bills

model_type

One of 'binary', 'ordinal_rating', 'ordinal_grm', 'poisson' 'normal', or 'lognormal'

latent_space

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.

absence_discrim_sd

The SD of the discrimination parameters for the inflated model

absence_diff_mean

The mean intercept for the inflated model; increasing it will lower the total number of missing data

reg_discrim_sd

The SD of the discrimination parameters for the non-inflated model

diff_sd

The SD of the difficulty parameters (bill/item intercepts)

time_points

The number of time points for time-varying legislator/person parameters

time_process

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.

time_sd

The standard deviation of the change in ideal points over time (should be low relative to ideal_pts_sd)

ideal_pts_sd

The SD for the person/person ideal points

prior_type

The statistical distribution that generates the data. Currently only 'gaussian' is supported.

ordinal_outcomes

If model is 'ordinal', an integer giving the total number of categories

inflate

If TRUE, an missing-data-inflated dataset is produced.

sigma_sd

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).

Details

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.

Value

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.

See Also

id_plot_sims for plotting fitted models versus true values.


saudiwin/idealstan documentation built on March 26, 2021, 3:32 p.m.