This function fits the latent trait model for binary data and populates the fitted values for discrimination and difficulty parameters to an object of class Cat.
## S4 method for signature 'data.frame'ltmCat(data, quadraturePoints =21,...)## S4 method for signature 'ltm'ltmCat(data, quadraturePoints =NULL,...)
Arguments
data: A data frame of manifest variables or an object of class ltm.
quadraturePoints: A numeric to be passed into the ltm function indicating the number of Gauss-Hermite quadrature points. Only applicable when data is a data frame. Default value is 21.
...: arguments to be passed to methods. For more details about the arguments, see ltm in the ltm package.
Returns
The function ltmCat returns an object of class Cat with changes to the following slots:
difficulty A vector consisting of difficulty parameters for each item.
discrimination A vector consisting of discrimination parameters for each item.
model The string "ltm", indicating this Cat object corresponds to a latent trait model.
See Cat-class for default values of Cat object slots. See Examples and setters for example code to change slot values.
Details
The data argument of the function ltmCat is either a data frame or an object of class ltm from the ltm package. If it is a data frame each row represents a respondent and each column represents a question item. If it is an object of the class ltm, it is output from the ltm function in the ltm package.
The quadraturePoints argument of the function ltmCat is used only when the data argument is a data frame. quadraturePoints is then passed to the ltm function from the ltm package when fitting the latent trait model to the data and is used when approximating the value of integrals.
Note
In case the Hessian matrix at convergence is not positive definite try to use start.val = "random".
Examples
## Not run:## Creating Cat object with raw datadata(npi)ltm_cat1 <- ltmCat(npi, quadraturePoints =100)## Creating Cat object with fitted object of class ltmltm_fit <- ltm(npi ~ z1, control = list(GHk =100))## from ltm packageclass(ltm_fit)ltm_cat2 <- ltmCat(ltm_fit)## Note the two Cat objects are identicalidentical(ltm_cat1, ltm_cat2)## End(Not run)## Creating Cat objects from large datasets is computationally expensive## Load the Cat object created from the above codedata(ltm_cat)## Slots that have changed from default valuesgetModel(ltm_cat)getDifficulty(ltm_cat)getDiscrimination(ltm_cat)## Changing slots from default valuessetEstimation(ltm_cat)<-"MLE"setSelection(ltm_cat)<-"MFI"
References
Baker, Frank B. and Seock-Ho Kim. 2004. Item Response Theory: Parameter Estimation Techniques. New York: Marcel Dekker.
Rizopoulos, Dimitris. 2006. ``ltm: An R Package for Latent Variable Modeling and Item Response Theory Analyses." Journal of Statistical Software 17(5):1-25.
See Also
Cat-class, npi, probability, tpmCat
Author(s)
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil