This is a small helper function which creates a vector template quick and easily for the PPall() function. Modify this template as you like.

findmodel(thres)

Arguments

thres

A numeric matrix which contains the threshold parameter for each item. NA is allowed - in fact expected!

Details

This function tries to guess the model which was applied to each item by using the matrix of threshold parameters. It only discriminates between GPCM and 4-PL model, and returns a character vector of length equal to the number of items, that contains "GPCM" or "4PL" entries depending on the structure of the thres matrix.

See also

Author

Manuel Reif

Examples

################# GPCM and 4PL mixed ######################################### # some threshold parameters THRES <- matrix(c(-2,-1.23,1.11,3.48,1 ,2,-1,-0.2,0.5,1.3,-0.8,1.5),nrow=2) # slopes sl <- c(0.5,1,1.5,1.1,1,0.98) THRESx <- THRES THRESx[2,1:3] <- NA # for the 4PL item the estimated parameters are submitted, # for the GPCM items the lower asymptote = 0 # and the upper asymptote = 1. la <- c(0.02,0.1,0,0,0,0) ua <- c(0.97,0.91,1,1,1,1) awmatrix <- matrix(c(1,0,1,0,1,1,1,0,0,1 ,2,0,0,0,0,0,0,0,0,1 ,1,2,2,1,1,1,1,0,0,1),byrow=TRUE,nrow=5) # create model2est # this function tries to help finding the appropriate # model by inspecting the THRESx. model2est <- findmodel(THRESx) # MLE respmixed_mle <- PPall(respm = awmatrix,thres = THRESx, slopes = sl,lowerA = la, upperA=ua,type = "mle", model2est=model2est)
#> Estimating: mixed 4PL, GPCM ... #> type = mle #> Estimation finished!
# WLE respmixed_wle <- PPall(respm = awmatrix,thres = THRESx, slopes = sl,lowerA = la, upperA=ua,type = "wle", model2est=model2est)
#> Estimating: mixed 4PL, GPCM ... #> type = wle #> Estimation finished!
# MAP estimation respmixed_map <- PPall(respm = awmatrix,thres = THRESx, slopes = sl,lowerA = la, upperA=ua, type = "map", model2est=model2est)
#> Warning: all mu's are set to 0!
#> Warning: all sigma2's are set to 1!
#> Estimating: mixed 4PL, GPCM ... #> type = map #> Estimation finished!
# EAP estimation respmixed_eap <- PPall(respm = awmatrix,thres = THRESx, slopes = sl,lowerA = la, upperA=ua, type = "eap", model2est=model2est)
#> Estimating: mixed 4PL, GPCM ... #> type = eap #> Estimation finished!
# Robust estimation respmixed_rob <- PPall(respm = awmatrix,thres = THRESx, slopes = sl,lowerA = la, upperA=ua, type = "robust", model2est=model2est)
#> Estimating: mixed 4PL, GPCM ... #> type = robust
#> Warning: Robust estimation for GPCM is still very experimental!
#> Estimation finished!
# summary to summarize the results summary(respmixed_mle)
#> PP Version: 0.6.3.11 #> #> Call: PPall(respm = awmatrix, thres = THRESx, slopes = sl, lowerA = la, upperA = ua, type = "mle", model2est = model2est) #> - job started @ Mon May 24 13:28:00 2021 #> #> Estimation type: mle #> #> Number of iterations: 4 #> ------------------------------------- #> estimate SE #> [1,] 0.1298 0.7195 #> [2,] -0.0653 0.7333 #> [3,] -Inf NA #> [4,] 2.1216 0.9344 #> [5,] -0.0155 0.7295
summary(respmixed_wle)
#> PP Version: 0.6.3.11 #> #> Call: PPall(respm = awmatrix, thres = THRESx, slopes = sl, lowerA = la, upperA = ua, type = "wle", model2est = model2est) #> - job started @ Mon May 24 13:28:00 2021 #> #> Estimation type: wle #> #> Number of iterations: 7 #> ------------------------------------- #> estimate SE #> [1,] 0.1684 0.7171 #> [2,] -0.0146 0.7294 #> [3,] -3.1369 1.8953 #> [4,] 1.8696 0.8552 #> [5,] 0.0359 0.7257
summary(respmixed_map)
#> PP Version: 0.6.3.11 #> #> Call: PPall(respm = awmatrix, thres = THRESx, slopes = sl, lowerA = la, upperA = ua, type = "map", model2est = model2est) #> - job started @ Mon May 24 13:28:00 2021 #> #> Estimation type: map #> #> Number of iterations: 3 #> ------------------------------------- #> estimate SE #> [1,] 0.0862 0.7223 #> [2,] -0.0429 0.7316 #> [3,] -1.4487 0.9789 #> [4,] 1.2758 0.7372 #> [5,] -0.0099 0.7291
summary(respmixed_eap)
#> PP Version: 0.6.3.11 #> #> Call: PPall(respm = awmatrix, thres = THRESx, slopes = sl, lowerA = la, upperA = ua, type = "eap", model2est = model2est) #> - job started @ Mon May 24 13:28:00 2021 #> #> Estimation type: eap #> #> Number of iterations: 0 #> ------------------------------------- #> estimate SE #> [1,] 0.0682 0.5905 #> [2,] -0.0653 0.5950 #> [3,] -1.5237 0.7046 #> [4,] 1.3112 0.6142 #> [5,] -0.0417 0.6119
summary(respmixed_rob)
#> PP Version: 0.6.3.11 #> #> Call: PPall(respm = awmatrix, thres = THRESx, slopes = sl, lowerA = la, upperA = ua, type = "robust", model2est = model2est) #> - job started @ Mon May 24 13:28:00 2021 #> #> Estimation type: robust #> #> Number of iterations: 8 #> ------------------------------------- #> estimate SE #> [1,] -0.1231 0.7382 #> [2,] -0.0060 0.7288 #> [3,] -Inf NA #> [4,] 2.3417 1.0189 #> [5,] -0.5460 0.7835