ggum_simulation: GGUM Simulation

Description Usage Arguments Value See Also Examples

View source: R/ggum_simulation.R

Description

Generates randomly drawn item and person parameters, and simulated responses.

Usage

1
2
3
4
ggum_simulation(n, m, K, theta = NULL, alpha = NULL, delta = NULL,
  tau = NULL, theta_params = c(0, 1), alpha_params = c(1.5, 1.5,
  0.25, 4), delta_params = c(2, 2, -5, 5), tau_params = c(1.5, 1.5, -2,
  0))

Arguments

n

An integer vector of length one giving the number of respondents

m

An integer vector of length one giving the number of items

K

An integer vector giving the number of options for each item; if the vector is of length one, all m items will have the same number of options.

theta

(Optional) A numeric vector of respondents' latent traits; if not given, the values are drawn from a normal distribution whose mean and standard deviation are given by the theta_params parameter

alpha

(Optional) A numeric vector of items' discrimination parameters; if not given, the values are drawn from a four parameter beta distribution whose parameters are given by alpha_params

delta

(Optional) A numeric vector of items' location parameters; if not given, the values are drawn from a four parameter beta distribution whose parameters are given by delta_params

tau

(Optional) A list of numeric vectors giving each item's option thresholds; if not given, the values are drawn from a four parameter beta distribution whose parameters are given by tau_params

theta_params

A numeric vector of length two; the mean and standard deviation of the normal distribution theta is drawn from

alpha_params

A numeric vector of length four; the two shape parameters and a and b values for the four parameter beta distribution alpha is drawn from; the default is 1.5, 1.5, 0.25, and 4

delta_params

A numeric vector of length four; the two shape parameters and a and b values for the four parameter beta distribution delta is drawn from; the default is 2, 2, -5, and 5

tau_params

A numeric vector of length four;the two shape parameters and a and b values for the four parameter beta distribution each tau vector is drawn from; the default is 1.5, 1.5, -2, and 0

Value

A list with five elements; "theta" containing the theta draws, "alpha" containing the alpha draws, "delta" containing the delta draws, "tau" containing the tau draws, and "response_matrix" containing the simulated response matrix.

See Also

ggumProbability

Examples

1
2
3
4
## Simulate data with 10 items, each with four options, and 100 respondents
set.seed(123)
sim_data <- ggum_simulation(100, 10, 4)
str(sim_data)

bggum documentation built on Jan. 19, 2020, 9:07 a.m.