Learn R Programming

MLCIRTwithin (version 1.0)

est_multi_poly_within: Estimate LC IRT model for dichotomous and polytomous responses under within multidimensionality

Description

The function performs maximum likelihood estimation of the parameters of the IRT models assuming a discrete distribution for the ability and within multidimensionality. Every ability level corresponds to a latent class of subjects in the reference population. Maximum likelihood estimation is based on Expectation- Maximization algorithm.

Usage

est_multi_poly_within(S, yv = rep(1,ns), k1, k2, X = NULL, start = 0, link = 1,
        disc = 0, difl = 0, multi1 = 1:J, multi2 = 1:J, piv1 = NULL, piv2 = NULL, 
        Phi = NULL, gac = NULL, De = NULL, fort = FALSE, tol = 10^-10, disp = FALSE,
        output = FALSE, out_se = FALSE, glob = FALSE)

Arguments

S
matrix of all response sequences observed at least once in the sample and listed row-by-row (use NA for missing response)
yv
vector of the frequencies of every response configuration in S
k1
number of ability levels (or latent classes) for the 1st latent variable
k2
number of ability levels (or latent classes) for the 2nd latent variable
X
matrix of covariates that affects the weights
start
method of initialization of the algorithm (0 = deterministic, 1 = random, 2 = arguments given as input)
link
type of link function (0 = no link function, 1 = global logits, 2 = local logits); with no link function the Latent Class model results; with global logits the Graded Response model results; with local logits the Partial Credi
disc
indicator of constraints on the discriminating indices (0 = all equal to one, 1 = free)
difl
indicator of constraints on the difficulty levels (0 = free, 1 = rating scale parameterization)
multi1
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
multi2
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
piv1
initial value of the vector of weights of the latent classes (if start=2) for the 1st latent variable
piv2
initial value of the vector of weights of the latent classes (if start=2) for the 2nd latent variable
Phi
initial value of the matrix of the conditional response probabilities (if start=2)
gac
initial value of the complete vector of discriminating indices (if start=2)
De
initial value of regression coefficients for the covariates (if start=2)
fort
to use Fortran routines when possible
tol
tolerance level for checking convergence of the algorithm as relative difference between consecutive log-likelihoods
disp
to display the likelihood evolution step by step
output
to return additional outputs (Phi,Pp,Piv)
out_se
to return standard errors
glob
to use global logits in the covariates

Value

  • piv1estimated vector of weights of the latent classes (average of the weights in case of model with covariates) for the 1st latent variable
  • piv2estimated vector of weights of the latent classes (average of the weights in case of model with covariates) for the 2nd latent variable
  • Th1estimated matrix of ability levels for each dimension and latent class for the 2nd latent variable
  • Th2estimated matrix of ability levels for each dimension and latent class for the 2nd latent variable
  • Becestimated vector of difficulty levels for every item (split in two vectors if difl=1)
  • ga1cestimated vector of discriminating indices for every item (with all elements equal to 1 with Rasch parametrization) for the 1st latent variable
  • ga2cestimated vector of discriminating indices for every item (with all elements equal to 1 with Rasch parametrization) for the 2nd latent variable
  • fv1vector indicating the reference item chosen for each latent dimension for the 1st latent variable
  • fv2vector indicating the reference item chosen for each latent dimension for the 2nd latent variable
  • Phiarray of the conditional response probabilities for every item and each of the k1*k2 latent classes
  • Dematrix of regression coefficients for the multinomial logit model on the class weights
  • Pivmatrix of the weights for every response configuration (if output=TRUE)
  • Ppmatrix of the posterior probabilities for each response configuration and latent class (if output=TRUE)
  • lklog-likelhood at convergence of the EM algorithm
  • npnumber of free parameters
  • aicAkaike Information Criterion index
  • bicBayesian Information Criterion index
  • entEtropy index to measure the separation of classes
  • lkvVector to trace the log-likelihood evolution across iterations (if output=TRUE)
  • seDe1Standard errors for De (if output=TRUE) for the 1st latent variable
  • seDe2Standard errors for De (if output=TRUE) for the 2nd latent variable
  • separStandard errors for vector of parameters containing Th and Be (if out_se=TRUE)
  • sega1Standard errors for vector of discrimination indices (if out_se=TRUE) for the 1st latent variable
  • sega2Standard errors for vector of discrimination indices (if out_se=TRUE) for the 2nd latent variable
  • VnEstimated variance-covariance matrix for all parameter estimates (if output=TRUE)

References

Bartolucci, F. (2007), A class of multidimensional IRT models for testing unidimensionality and clustering items, Psychometrika, 72, 141-157.

Bacci, S., Bartolucci, F. and Gnaldi, M. (2014), A class of Multidimensional Latent Class IRT models for ordinal polytomous item responses, Communication in Statistics - Theory and Methods, 43, 787-800.

Examples

Run this code
## Fit the model under different situations for NAEP data
data(naep)
multi1 = 1:12
multi2 = 2:12
# Rasch model and 2PL with two dimensions (within)
out10 = est_multi_poly_within(naep,k1=3,k2=3,multi1=multi1,multi2=multi2,link=1,disp=TRUE,
                  out_se=TRUE) 
out11 = est_multi_poly_within(naep,k1=3,k2=3,multi1=multi1,multi2=multi2,link=1,disc=1,
                  disp=TRUE,out_se=TRUE)

# fit the model under different situations for RLMS data
# example of use of the function to account for non-ignorable missing responses
data(RLMS)
X = RLMS[,1:4]
Y = RLMS[,6:9]
YR = cbind(Y,1*(!is.na(Y)))
multi1 = 1:4
multi2 = 5:8
# MAR model
out0 = est_multi_poly_within(YR,X=X,k1=3,k2=2,multi1=multi1,multi2=multi2,link=1,difl=1,
                 disc=1,glob=1,disp=TRUE,out_se=TRUE) 
# NMAR model
multi1 = 1:8
out1 = est_multi_poly_within(YR,X=X,k1=3,k2=2,multi1=multi1,multi2=multi2,link=1,difl=1,
                 disc=1,glob=1,disp=TRUE,out_se=TRUE) 
# testing effect of the latent trait on missingness
c(out0$bic,out1$bic)
test1 = out1$ga1c[-1]/out1$sega1

Run the code above in your browser using DataLab