Description Usage Arguments Value See Also Examples
Obtains samples from posterior distribution for the Exploratory reduced Reparameterized Unified Model (ErRUM).
1 2 3 4 5 6 7 8 9 10 11 12 13 |
y |
Binary responses to assessments in |
k |
Number of Attribute Levels as a positive |
burnin |
Number of Observations to discard on the chain. |
chain_length |
Length of the MCMC chain |
verbose |
Display estimation progress updates. |
X, v0, v1, cv0, cv1, bnu |
Additional tuning parameters |
An errum
object that has:
PISTAR
RSTAR
PIs
QS
m_Delta
Delta_biject
M2
M1
NUS
simcdm::attribute_bijection()
,
simcdm::sim_rrum_items()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | # Setup Simulation Parameters
N = 5
K = 3
J = 30
# Note:
# Sample size has been reduced to create a minimally
# viable example that can be run during CRAN's automatic check.
# Please make sure to have a larger sample size of around 3,000.
# Sample true attribute profiles
Z = matrix(rnorm(N * K), N, K)
Sig = matrix(.5, K, K)
diag(Sig) = 1
theta = Z %*% chol(Sig)
thvals = matrix(qnorm((1:K) / (K + 1)),
N, K, byrow = TRUE)
Alphas = 1 * (theta > thvals)
# Defining matrix of possible attribute profiles
As = as.matrix(expand.grid(c(0, 1), c(0, 1), c(0, 1)))
Q = rbind(As[rep(c(2, 3, 5), 4),],
As[rep(c(4, 6, 7), 4),],
As[rep(8, 6),])
# Use simulation functions available in simcdm
if (requireNamespace("simcdm", quietly = TRUE)) {
a = As %*% simcdm::attribute_bijection(K)
As = As[a + 1,]
# Setting item parameters
pistar = rep(.9, J)
rstar = matrix(.6, J, K) * Q
# Simulate data under rRUM model
Y = simcdm::sim_rrum_items(Q, rstar, pistar, Alphas)
# Estimation Settings
chainLength = 10000 # Run with 20000
burnin = chainLength / 2
# Gibbs Estimation
model = errum(Y, K, burnin, chainLength)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.