simulate_likert: Simulate Likert Scale Item Responses

View source: R/simulation.R

simulate_likertR Documentation

Simulate Likert Scale Item Responses

Description

Simulates Likert scale item responses based on a specified number of response categories and the centered parameters of the latent variable.

Usage

simulate_likert(n_levels, cp)

Arguments

n_levels

number of response categories for the Likert scale item.

cp

centered parameters of the latent variable. Named vector including mean (mu), standard deviation (sd), and skewness (skew). Skewness must be between -0.95 and 0.95.

Details

The simulation process uses the following model detailed by Boari and Nai-Ruscone. Let X be the continuous variable of interest, measured using Likert scale questions with K response categories. The observed discrete variable Y is defined as follows:

Y = k, \quad \text{ if } \ \ x_{k - 1} < X \leq x_{k} \quad \text{ for } \ \ k = 1, \dots, K

where x_{k}, k = 0, \dots, K are endpoints defined in the domain of X such that:

-\infty = x_{0} < x_{1} < \dots < x_{K - 1} < x_{K} = \infty.

The endpoints dictate the transformation of the density f_{X} of X into a discrete probability distribution:

\text{Pr}(Y = k) = \int_{x_{k - 1}}^{x_{k}} f_{X}(x) \, dx \quad \text{ for } \ \ k = 1, \dots, K.

The continuous latent variable is modeled using a skew normal distribution. The function simulate_likert performs the following steps:

  • Ensures the centered parameters are within the acceptable range.

  • Converts the centered parameters to direct parameters.

  • Defines the density function for the skew normal distribution.

  • Computes the probabilities for each response category using optimal endpoints.

Value

A named vector of probabilities for each response category.

References

Boari, G. and Nai Ruscone, M. (2015). A procedure simulating Likert scale item responses. Electronic Journal of Applied Statistical Analysis 8(3), 288–297. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1285/i20705948v8n3p288")}

See Also

discretize_density for details on how to calculate the optimal endpoints.

Examples

cp <- c(mu = 0, sd = 1, skew = 0.5)
simulate_likert(n_levels = 5, cp = cp)
cp2 <- c(mu = 1, sd = 2, skew = -0.3)
simulate_likert(n_levels = 7, cp = cp2)

markolalovic/responsesR documentation built on Oct. 15, 2024, 11:14 a.m.