50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

autoFC (version 0.2.0.1002)

get_simulation_matrices: Generate Simulated Person and Item Parameter Matrices for the Thurstonian IRT Model Based on Confirmatory Factor Analysis Results

Description

This function takes in factor analysis results from lavaan::cfa() or get_CFA_estimates(), and generates simulated person and item parameter matrices for the Thurstonian IRT model. The latent "utility" value of each item for each simulated person is also produced.

Usage

get_simulation_matrices(
  loadings,
  intercepts,
  residuals,
  covariances,
  N,
  N_items,
  N_dims,
  dim_names,
  empirical
)

Value

A list containing:

  • Lambda Item loading matrix specifying which items load onto which dimension,

    Mu Item intercept matrix,

    Epsilon Item residual matrix,

    Theta Simulated latent scores for each of the N_dims dimensions for all N simulated respondents,

    Utility latent utility value of N_item Likert items for each of the N participants.

Arguments

loadings, intercepts, residuals, covariances

Data frame of factor loadings, intercepts, residuals and latent variable covariances, preferably obtained from get_CFA_estimates(), or extracted from lavaan::parameterEstimates().

N

Number of simulated responses you wish to generate.

N_items

Optional. Total number of response items. Default to the number of rows in loadings.

N_dims

Optional. Total number of response items. Default to the length of dim_names.

dim_names

Name of the latent variables (dimensions); Order should be consistent with how they appear in your CFA model as you have specified in get_CFA_estimates().

empirical

As in MASS::mvrnorm(); Should mu and sigma specify the empirical, rather than population mean and covariance?

Author

Mengtong Li

Details

Based on the Thurstonian IRT model (Brown & Maydeu-Olivares, 2011), this function generates the latent utility value of N_item Likert items for each of the N participants.

Readers can refer to Brown & Maydeu-Olivares (2011) and the online tutorial in Li et al., (in press) for detailed description of simulation procedures.

References

Brown, A., & Maydeu-Olivares, A. (2011). Item response modeling of forced-choice questionnaires. Educational and Psychological Measurement, 71(3), 460-502. https://doi.org/10.1177/0013164410375112 Li, M., Zhang, B., Li, L., Sun, T., & Brown, A., (2024). Mixed-Keying or Desirability-Matching in the Construction of Forced-Choice Measures? An Empirical Investigation and Practical Recommendations. Organizational Research Methods. https://doi.org/10.1177/10944281241229784

See Also

get_CFA_estimates()

Examples

Run this code
rating_data <- HEXACO_example_data
cfa_model <- paste0("H =~ ", paste0("SS", seq(6,60,6), collapse = " + "), "\n",
                    "E =~ ", paste0("SS", seq(5,60,6), collapse = " + "), "\n",
                    "X =~ ", paste0("SS", seq(4,60,6), collapse = " + "), "\n",
                    "A =~ ", paste0("SS", seq(3,60,6), collapse = " + "), "\n",
                    "C =~ ", paste0("SS", seq(2,60,6), collapse = " + "), "\n",
                    "O =~ ", paste0("SS", seq(1,60,6), collapse = " + "), "\n")
cfa_estimates <- get_CFA_estimates(response_data = rating_data,
                                   fit_model = cfa_model, 
                                   item_names = paste0("SS",c(1:60)))
cfa_matrices <- get_simulation_matrices(loadings = cfa_estimates$loadings,
                                        intercepts = cfa_estimates$intercepts,
                                        residuals = cfa_estimates$residuals,
                                        covariances = cfa_estimates$covariances,
                                        N = 100, N_items = 60, N_dims = 6,
                                        dim_names = c("H", "E", "X", "A", "C", "O"),
                                        empirical = TRUE)

Run the code above in your browser using DataLab