It searches for the global maximum of the log-likelihood of within-item muldimensional models given a vector of possible number of classes to try for.
search.model_within(S, yv = rep(1, ns), kv1, kv2, X = NULL,
link = c("global","local"), disc = FALSE, difl = FALSE,
multi1, multi2, fort = FALSE, tol1 = 10^-6, tol2 = 10^-10,
glob = FALSE, disp = FALSE, output = FALSE, out_se = FALSE,
nrep = 2, Zth1 = NULL, zth1 = NULL, Zth2=NULL, zth2=NULL,
Zbe=NULL, zbe=NULL, Zga1=NULL, zga1=NULL, Zga2=NULL,
zga2=NULL)
matrix of all response sequences observed at least once in the sample and listed row-by-row (use NA for missing responses)
vector of the frequencies of every response configuration in S
vector of the possible numbers of ability levels (or latent classes) for the 1st latent variable
vector of the possible numbers of ability levels (or latent classes) for the 2nd latent variable
matrix of covariates affecting the weights
type of link function ("global" for global logits, "local" for local logits); with global logits a graded response model results; with local logits a partial credit model results (with dichotomous responses, global logits is the same as using local logits resulting in the Rasch or the 2PL model depending on the value assigned to disc)
indicator of constraints on the discriminating indices (FALSE = all equal to one, TRUE = free)
indicator of constraints on the difficulty levels (FALSE = free, TRUE = rating scale parametrization)
matrix with a number of rows equal to the number of dimensions and elements in each row equal to the indices of the items measuring the dimension corresponding to that row for the 1st latent variable
matrix with a number of rows equal to the number of dimensions and elements in each row equal to the indices of the items measuring the dimension corresponding to that row for the 2nd latent variable
to use Fortran routines when possible
tolerance level for checking convergence of the algorithm as relative difference between consecutive log-likelihoods (initial check based on random starting values)
tolerance level for checking convergence of the algorithm as relative difference between consecutive log-likelihoods (final convergence)
to use global logits in the covariates
to display the likelihood evolution step by step
to return additional outputs (Piv,Pp,lkv)
to return standard errors
number of repetitions of each random initialization
matrix for the specification of constraints on the support points for the 1st latent variable
vector for the specification of constraints on the support points for the 1st latent variable
matrix for the specification of constraints on the support points for the 2nd latent variable
vector for the specification of constraints on the support points for the 2nd latent variable
matrix for the specification of constraints on the item difficulty parameters
vector for the specification of constraints on the item difficulty parameters
matrix for the specification of constraints on the item discriminating indices for the 1st latent variable
vector for the specification of constraints on the item discriminating indices for the 1st latent variable
matrix for the specification of constraints on the item discriminating indices for the 2nd latent variable
vector for the specification of constraints on the item discriminating indices for the 2nd latent variable
output of each single model for each k
in kv1
and kv2
; it is similar to output from est_multi_poly_within, with the addition of values of number of latent classes for the 1st latent variable (k1
) and the 2nd latent variable (k2
) and the sequence of log-likelihoods (lktrace
) for the deterministic start, for each random start, and for the final estimation obtained with a tolerance level equal to tol2
Akaike Information Criterion index for each k
in kv1
and kv2
Bayesian Information Criterion index for each k
in kv1
and kv2
Entropy index for each k
in kv1
and kv2
NEC index for each k
in kv1
and kv2
log-likelihood at convergence of the EM algorithm for each k
in kv1
and kv2
trace of any errors occurred during the estimation process for each k
in kv1
and kv2
Bartolucci, F., Bacci, S. and Gnaldi, M. (2014), MultiLCIRT: An R package for multidimensional latent class item response models, Computational Statistics & Data Analysis, 71, 971-985.
# NOT RUN {
# }
# NOT RUN {
# Fit the model under different within-item multidimensional structures
# for SF12_nomiss data
data(SF12_nomiss)
S = SF12_nomiss[,1:12]
X = SF12_nomiss[,13]
# Partial credit model with two latent variables sharing six items
# (free difficulty parameters and constrained discriminating parameters;
# 1 to 3 latent classes for the 1st latent variable and 1 to 2 classes for the 2nd latent variable;
# one covariate):
multi1 = c(1:5, 8:12)
multi2 = c(6:12, 1)
out1 = search.model_within(S=S,kv1=1:3,kv2=1:2,X=X,link="global",disc=FALSE,
multi1=multi1,multi2=multi2,disp=TRUE,
out_se=TRUE,tol1=10^-4, tol2=10^-7, nrep=1)
# Main output
out1$lkv
out1$aicv
out1$bicv
# Model with 2 latent classes for each latent variable
out1$out.single[[4]]$k1
out1$out.single[[4]]$k2
out1$out.single[[4]]$Th1
out1$out.single[[4]]$Th2
out1$out.single[[4]]$piv1
out1$out.single[[4]]$piv2
out1$out.single[[4]]$ga1c
out1$out.single[[4]]$ga2c
out1$out.single[[4]]$Bec
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab