rStructuredFactor {FactorCopula} | R Documentation |
Simulation of bi-factor and second-order copula models for item response data
Description
Simulating item response data from the bi-factor and second-order copula models for item response data.
Usage
rBifactor(n, d, grpsize, categ, copnames1,copnames2, theta1, theta2)
rSecond_order(n, d, grpsize, categ, copnames1, copnames2, theta1, theta2)
Arguments
n |
Sample size. |
d |
Number of observed variables/items. |
grpsize |
vector indicating the size for each group, e.g., c(4,4,4) indicating four items in all three groups. |
categ |
A vector of categories for the observed variables/items. |
theta1 |
For the bi-factor model: copula parameter vector of size |
theta2 |
For the bi-factor model: copula parameter vector of size |
copnames1 |
For the bi-factor copula: |
copnames2 |
For the bi-factor copula: |
Value
Data matrix of dimension n\times d
, where n
is the sample size, and d
is the total number of observed variables/items.
Author(s)
Sayed H. Kadhem s.kadhem@uea.ac.uk
Aristidis K. Nikoloulopoulos a.nikoloulopoulos@uea.ac.uk
References
Kadhem, S.H. and Nikoloulopoulos, A.K. (2023) Bi-factor and second-order copula models for item response data. Psychometrika, 88, 132–157. doi:10.1007/s11336-022-09894-2.
Examples
# ---------------------------------------------------
# ---------------------------------------------------
#Sample size
n = 500
#Ordinal Variables ---------------------------------
d = 9
grpsize=c(3,3,3)
ngrp=length(grpsize)
#Categories for ordinal ----------------------------
categ = rep(3,d)
# ---------------------------------------------------
# ---------------------------------------------------
# Bi-factor copula model
# ---------------------------------------------------
# ---------------------------------------------------
#Copula parameters
theta = rep(2.5, d)
delta = rep(1.5, d)
#Copula names
copulanames1 = rep("gum", d)
copulanames2 = rep("gum", d)
#----------------- Simulating data ------------------
data_Bifactor = rBifactor(n, d, grpsize, categ, copulanames1,
copulanames2, theta, delta)
# ---------------------------------------------------
# ---------------------------------------------------
# Second-order copula model
# ---------------------------------------------------
# ---------------------------------------------------
#Copula parameters
theta= rep(1.5, ngrp)
delta = rep(2.5, d)
#Copula names
copulanames1 = rep("gum", ngrp)
copulanames2 = rep("gum", d)
data_Second_order = rSecond_order(n, d, grpsize, categ,
copulanames1, copulanames2, theta, delta)