| Type: | Package |
| Title: | Computerized Adaptive Testing for Survey Research |
| Version: | 1.6.0 |
| Description: | Provides methods of computerized adaptive testing for survey researchers. See Montgomery and Rossiter (2020) <doi:10.1093/jssam/smz027>. Includes functionality for data fit with the classic item response methods including the latent trait model, the Birnbaum three parameter model, the graded response, and the generalized partial credit model. Additionally, includes several ability parameter estimation and item selection routines. During item selection, all calculations are done in compiled C++ code. |
| Depends: | ltm(≥ 1.1.1), R(≥ 3.4) |
| License: | GPL-3 |
| Imports: | jsonlite, methods, stats, plyr, Rcpp(≥ 1.0.1), RcppParallel |
| LinkingTo: | BH(≥ 1.69.0.1), Rcpp(≥ 1.0.1), RcppArmadillo, RcppGSL(≥ 0.3.6), RcppParallel |
| LazyData: | true |
| RoxygenNote: | 7.3.3 |
| SystemRequirements: | GNU make |
| Suggests: | catIrt(≥ 0.5.0), catR(≥ 3.16), testthat(≥ 2.0.1) |
| BugReports: | https://github.com/erossiter/catSurv/issues |
| Encoding: | UTF-8 |
| NeedsCompilation: | yes |
| Packaged: | 2025-10-15 13:18:59 UTC; erossite |
| Author: | Jacob Montgomery [aut], Erin Rossiter [aut, cre] |
| Maintainer: | Erin Rossiter <erossite@nd.edu> |
| Repository: | CRAN |
| Date/Publication: | 2025-10-15 13:40:02 UTC |
Computerized Adaptive Testing Survey (catSurv) Object
Description
Creates an object of class Cat. Cat objects are used in administering Computerized Adaptive Testing (CAT) Surveys. These objects contain several pieces of information relevant for CAT surveys, and are used as input in the main functions of the catSurv package.
Details
Assume we have a survey battery with I questions. An object of the class Cat has the following slots:
-
idsA vector of lengthIof unique question identifiers. Default is the column names of response data frame used to calibrateCatobject. -
guessingA vector of lengthIof guessing parameters. Guessing parameters are only applicable forCatobjects fit with the"tpm"model, using thetpmCatfunction. -
discriminationA vector of lengthIof discrimination parameters. -
difficultyA vector or list of lengthIof difficulty parameters. ForCatobjects of the"ltm"or"tpm"model,difficultyis a vector that contains a parameter for each item. ForCatobjects of the"grm"or"gpcm"model,difficultyis a list that contains a vector for each item, and each vector contains parameters for each response option. -
answersA vector of lengthIof answers to questions as given by the survey respondent. Unanswered questions have the valueNA. Questions respondent has skipped or refused to answer have a value of-1. -
priorNameA character vector of length one giving the prior distribution to use for the ability parameter estimates. The options are"NORMAL"for the normal distribution,"STUDENT_T"for the student's t distribution, and"UNIFORM"for the uniform distribution. The default value is"NORMAL". -
priorParamsA numeric vector of length two of parameters for the distribution specified in thepriorNameslot. WhenpriorNameis set to"NORMAL", the first element ofpriorParamsis the mean, and the second element is the standard deviation. WhenpriorNameis set to"STUDENT_T", the first element ofpriorParamsis the location parameter and the second is degrees of freedom. WhenpriorNameis set to"UNIFORM", the elements ofpriorParamsare lower and upper bound, respectively. Note that the uniform distribution is only applicable for the"EAP"estimation method. The default values are0,1. -
lowerBoundA numeric indicating the lower bound of the interval of the latent scale used in estimation. The default value is-5. -
upperBoundA numeric indicating the upper bound of the interval of the latent scale used in estimation. The default value is5. -
modelA string indicating the model fit to the data. The options are"ltm"for the latent trait model,"tpm"for Birnbaum's three parameter model,"grm"for the graded response model, and"gpcm"for the generalized partial credit model. -
estimationA string indicating the approach to estimating ability parameters. The options are"EAP"for the expected a posteriori approach,"MAP"for the modal a posteriori approach,"MLE"for the maximum likelihood approach, and"WLE"for the weighted maximum likelihood approach. The default value is"EAP". -
estimationDefaultA string indicating the approach to estimating ability parameters when the primary estimation choice indicated in theestimationslot is"MLE"or"WLE"and this estimation fails to converge. The options are"EAP"and"MAP". The default value is"MAP". -
selectionA string indicating the approach for selecting the next item. The options are"EPV"for minimum expected posterior variance,"MEI"for maximum expected information,"MFI"for maximum Fisher information,"MPWI"for maximum posterior weighted information,"MLWI"for maximum likelihood weighted information,"KL"for the maximum expected Kullback-Leibler (KL) information,"LKL"maximum likelihood weighted KL information,"PKL"maximum posterior weighted KL information,"MFII"for maximum Fisher interval information, and"RANDOM"where the next item is chosen randomly. The default value is"EPV". -
zA numeric used in calculating\delta.\deltais used in determining the bounds of integration for someselectItemmethods. SeeselectItemfor more information. Default value is0.9. -
lengthThresholdA numeric. The number of questions answered must be greater than or equal to this threshold to stop administering items. The default value isNA. -
seThresholdA numeric. The standard error estimate of the latent trait must be less than this threshold to stop administering items. The default value isNA. -
infoThresholdA numeric. The Fisher's information for all remaining items must be less than this threshold to stop administering items. The default value isNA. -
gainThresholdA numeric. The absolute value of the difference between the standard error of the latent trait estimate and the square root of the expected posterior variance for each item must be less than this threshold to stop administering items. The default value isNA. -
lengthOverrideA numeric. The number of questions answered must be less than this override to continue administering items. The default value isNA. -
gainOverrideA numeric. The absolute value of the difference between the standard error of the latent trait estimate and the square root of the expected posterior variance for each item must be less than this override to continue administering items. The default value isNA.
Author(s)
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil
See Also
checkStopRules, estimateTheta, gpcmCat, grmCat, ltmCat, selectItem, tpmCat
Agreeableness Cat Object
Description
Cat object containing item parameters for graded response model fit with responses to the 20-item Agreeableness dimension of the 100-item IPIP representation of Costa and McCrae's Five Factor Model
Usage
data(agree_cat)
Format
An object of class Cat of length 1.
Details
Cat object containing item parameters for graded response model fit with 774,410 response profiles by myPersonality Poject and 1500 response profiles collected by YouGov in June 2018. The sample from myPersonality Project was a convenience sample, and the respondents from YouGov were matched to a sampling frame on gender, age, race, and education.
See Cat-class for details regarding the Cat object structure.
See grmCat for details regarding the graded response model.
A normal prior was chosen with mean from the theta estimates from the YouGov sample (.113) and a standard deviation (1.5) wide enough to envelope the range of estimated theta values across both samples.
Note that due to how the item parameters were estimated, large, positive values indicate "more" of the latent trait.
Response options are 1=Very inaccurate; 2=Moderately inaccurate; 3=Neither inaccurate nor accurate; 4=Moderately accurate; 5=Very accurate.
The wording of the question items:
I...
q86Have a good word for everyone.
q6Believe that others have good intentions.
q66Respect others.
q46Accept people as they are.
q36Make people feel at ease.
q26Am concerned about others.
q56Trust what people say.
q76Sympathize with others' feelings.
q13Am easy to satisfy.
q96Treat all people equally.
q82Have a sharp tongue.
q9Cut others to pieces.
q22Suspect hidden motives in others.
q32Get back at others.
q92Insult people.
q42Believe that I am better than others.
q52Contradict others.
q62Make demands on others.
q2Hold a grudge.
q72Am out for my own personal gain.
Source
See https://dataverse.harvard.edu/dataverse/pdsl for the raw YouGov and/or Qualtrics data.
References
Costa, P. T., Jr., & McCrae, R. R. (1992). Revised NEO Personality Inventory (NEO PI-R) and NEO Five-Factor Inventory (NEO-FFI): Professional manual. Odessa, FL: Psychological Assessment Resources.
Stillwell, David, and Michal Kosinski. 2007. "myPersonality Project." https://sites.google.com/michalkosinski.com/mypersonality
See Also
Check if Stop and/or Override Rules are Met
Description
Evaluates the specified stopping and/or override rules to check if respondent should be asked further questions.
Usage
checkStopRules(catObj)
Arguments
catObj |
An object of class |
Details
The stopping rule thresholds are stored in the following Cat object slots:
lengthThreshold, seThreshold, infoThreshold, and gainThreshold. The override
thresholds are stored in the following Cat object slots: lengthOverride, gainOverride.
A value of NA indicates the rule will not be used in evaluating if further questions should be administered.
A user can specify any combination of stopping rules and/or overrides.
Stopping Rules:
lengthThreshold: Number of question's answered \geq a
seThreshold: SE(\hat{\theta}) < a
infoThreshold: FI < a \forall remaining items
gainThreshold: SE(\hat{\theta}) - \sqrt{EPV} | < a \forall remaining items
Overrides:
lengthOverride: Number of question's answered < a
gainOverride: |SE(\hat{\theta}) - \sqrt{EPV} | \geq a \forall remaining items
Value
The function checkStopRules returns a boolean. TRUE indicates all specified stopping rules are met
and no specified overrides are met. No further items should be administered. FALSE indicates at least one specified
stopping rule is not met, or if any specified override threshold is met. Additional items should be administered.
Note
This function is to allow users to access the internal functions of the package. During item selection, all calculations are done in compiled C++ code.
Author(s)
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil
References
Babcock, Ben, and David J. Weiss. 2009. “Termination Criteria in Computerized Adaptive Tests: Variable-Length CATs are not Biased." Proceedings of the 2009 GMAC Conference on Computerized Adaptive Testing. Vol. 14.
See Also
Cat-class, estimateSE, expectedPV, fisherInf
Examples
## Loading ltm Cat object
data(ltm_cat)
## Store example answers
setAnswers(ltm_cat) <- c(1,0,1,0,1,0,0,0,1,1, rep(NA, 30))
## Stop administering items if standard error of ability
## estimate is low enough
setSeThreshold(ltm_cat) <- .5
checkStopRules(ltm_cat)
## Now stop if standard error is low enough, but only if respondent has
## answered 11 questions
setLengthOverride(ltm_cat) <- 11
checkStopRules(ltm_cat)
## When respondent has answered 11 questions and standard error
## of ability estimate is below .5, stop administering items
setAnswers(ltm_cat) <- c(1,0,1,0,1,0,0,0,1,1,0, rep(NA, 29))
checkStopRules(ltm_cat)
Conscientiousness Cat Object
Description
Cat object containing item parameters for graded response model fit with responses to the 20-item Conscientiousness dimension of the 100-item IPIP representation of Costa and McCrae's Five Factor Model
Usage
data(consc_cat)
Format
An object of class Cat of length 1.
Details
Cat object containing item parameters for graded response model fit with 774,410 response profiles by myPersonality Project and 1500 response profiles collected by YouGov in June 2018. The sample from myPersonality Project was a convenience sample, and the respondents from YouGov were matched to a sampling frame on gender, age, race, and education.
See Cat-class for details regarding the Cat object structure.
See grmCat for details regarding the graded response model.
A normal prior was chosen with mean from the theta estimates from the YouGov sample (.455) and a standard deviation (1.5) wide enough to envelope the range of estimated theta values across both samples.
Note that due to how the item parameters were estimated, large, positive values indicate "more" of the latent trait.
Response options are 1=Very inaccurate; 2=Moderately inaccurate; 3=Neither inaccurate nor accurate; 4=Moderately accurate; 5=Very accurate.
The wording of the question items:
I...
q15Am always prepared.
q85Pay attention to details.
q75Get chores done right away.
q95Carry out my plans.
q55Make plans and stick to them.
q5Complete tasks successfully.
q25Do things according to a plan.
q45Am exacting in my work.
q65Finish what I start.
q35Follow through with my plans.
q28Waste my time.
q88Find it difficult to get down to work.
q98Do just enough work to get by.
q78Don't see things through.
q20Shirk my duties.
q38Mess things up.
q58Leave things unfinished.
q48Don't put my mind on the task at hand.
q68Make a mess of things.
q8Need a push to get started.
Source
See https://dataverse.harvard.edu/dataverse/pdsl for the raw YouGov and/or Qualtrics data.
References
Costa, P. T., Jr., & McCrae, R. R. (1992). Revised NEO Personality Inventory (NEO PI-R) and NEO Five-Factor Inventory (NEO-FFI): Professional manual. Odessa, FL: Psychological Assessment Resources.
Stillwell, David, and Michal Kosinski. 2007. "myPersonality Project." https://sites.google.com/michalkosinski.com/mypersonality
See Also
The First Derivative of the Log-Likelihood
Description
Calculates either the first derivative of the log-likelihood or the first derivative
of the log-posterior evaluated at point \theta.
Usage
d1LL(catObj, theta, use_prior)
Arguments
catObj |
An object of class |
theta |
A numeric or an integer indicating the value for |
use_prior |
A logical indicating whether to calculate based on the log-likelihood or log-posterior |
Details
When the usePrior argument is FALSE, the function d1LL evaluates the first derivative of the log-likelihood at point \theta.
When the usePrior argument is TRUE, the function d1LL evaluates the first derivative of the log-posterior at point \theta.
If the argument use_prior is TRUE, the function d1LL must use the the normal prior distribution.
Value
The function d1LL returns a numeric of the derivative of the log-likelihood (or log-posterior) given a respondent's answer profile.
Note
This function is to allow users to access the internal functions of the package. During item selection, all calculations are done in compiled C++ code.
Author(s)
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil
References
Baker, Frank B. and Seock-Ho Kim. 2004. Item Response Theory: Parameter Estimation Techniques. New York: Marcel Dekker.
Choi, Seung W. and Richard J. Swartz. 2009. “Comparison of CAT Item Selection Criteria for Polytomous Items." Applied Psychological Measurement 33(6):419-440.
Muraki, Eiji. 1992. “A generalized partial credit model: Application of an EM algorithm." ETS Research Report Series 1992(1):1-30.
van der Linden, Wim J. 1998. “Bayesian Item Selection Criteria for Adaptive Testing." Psychometrika 63(2):201-216.
See Also
Examples
## Loading ltm Cat object
data(ltm_cat)
## Store example answers
setAnswers(ltm_cat) <- c(1,0,1,0,1, rep(NA, 35))
## d1LL for Cat object of the ltm model
d1LL(ltm_cat, theta = 1, use_prior = FALSE)
The Second Derivative of the Log-Likelihood
Description
Calculates either the second derivative of the log-likelihood or the second derivative
of the log-posterior evaluated at point \theta.
Usage
d2LL(catObj, theta, use_prior)
Arguments
catObj |
An object of class |
theta |
A numeric or an integer indicating the value for |
use_prior |
A logical indicating whether to calculate based on the log-likelihood or log-posterior |
Details
When the usePrior argument is FALSE, the function d2LL evaluates the second derivative of the log-likelihood at point \theta.
When the usePrior argument is TRUE, the function d2LL evaluates the second derivative of the log-posterior at point \theta.
If the argument use_prior is TRUE, the function d2LL must use the the normal prior distribution.
Value
The function d2LL returns a numeric of the second derivative of the log-likelihood (or log-posterior) given a respondent's answer profile.
Note
This function is to allow users to access the internal functions of the package. During item selection, all calculations are done in compiled C++ code.
Author(s)
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil
References
Baker, Frank B. and Seock-Ho Kim. 2004. Item Response Theory: Parameter Estimation Techniques. New York: Marcel Dekker.
Choi, Seung W. and Richard J. Swartz. 2009. “Comparison of CAT Item Selection Criteria for Polytomous Items." Applied Psychological Measurement 33(6):419-440.
Muraki, Eiji. 1992. “A generalized partial credit model: Application of an EM algorithm." ETS Research Report Series 1992(1):1-30.
van der Linden, Wim J. 1998. “Bayesian Item Selection Criteria for Adaptive Testing." Psychometrika 63(2):201-216.
See Also
Examples
## Loading ltm Cat object
data(ltm_cat)
## Store example answers
setAnswers(ltm_cat) <- c(1,0,1,0,1, rep(NA, 35))
## d2LL for Cat object of the ltm model
d2LL(ltm_cat, theta = 1, use_prior = FALSE)
Empathizing Quotient Cat Object
Description
Cat object containing item parameters for graded response model fit with responses to the 40-item Empathy Quotient personality inventory
Usage
data(empathy_cat)
Format
An object of class Cat of length 1.
Details
Cat object containing item parameters for graded response model fit with 13976 response profiles collected by myPersonality Project, 3050 response profiles collected by Qualtrics in June 2018, and 1500 response profiles collected by YouGov in June 2018. The sample from myPersonality Project was a convenience sample, and the respondents from YouGov were matched to a sampling frame on gender, age, race, and education.
See Cat-class for details regarding the Cat object structure.
See grmCat for details regarding the graded response model.
A normal prior was chosen with mean from the theta estimates from the YouGov sample (-0.363) and a standard deviation (1.5) wide enough to envelope the range of estimated theta values across both samples.
Note that due to how the item parameters were estimated, large, positive values indicate "more" of the latent trait.
Response options are 1=Strongly disagree; 2=Slightly disagree; 3=Slightly agree; 4=Strongly agree
The wording of the question items:
q1I can easily tell if someone else wants to enter a conversation.
q4I find it difficult to explain to others things that I understand easily, when they don't understand it first time.
q6I really enjoy caring for other people.
q8I find it hard to know what to do in a social situation.
q10People often tell me that I went too far in driving my point home in a discussion.
q11It doesn't bother me too much if I am late meeting a friend.
q12Friendships and relationships are just too difficult, so I tend not to bother with them.
q14I often find it difficult to judge if something is rude or polite.
q15In a conversation, I tend to focus on my own thoughts rather than on what my listener might be thinking.
q18When I was a child, I enjoyed cutting up worms to see what would happen.
q19I can pick up quickly if someone says one thing but means another.
q21It is hard for me to see why some things upset people so much.
q22I find it easy to put myself in somebody else's shoes.
q25I am good at predicting how someone will feel.
q26I am quick to spot when someone in a group is feeling awkward or uncomfortable.
q27If I say something that someone else is offended by, I think that that's their problem, not mine.
q28If anyone asked me if I liked their haircut, I would reply truthfully, even if I didn't like it.
q29I can't always see why someone should have felt offended by a remark.
q32Seeing people cry doesn't really upset me.
q34I am very blunt, which some people take to be rudeness, even though this is unintentional.
q35I don't tend to find social situations confusing.
q36Other people tell me I am good at understanding how they are feeling and what they are thinking.
q37When I talk to people, I tend to talk about their experiences rather than my own.
q38It upsets me to see an animal in pain.
q39I am able to make decisions without being influenced by people's feelings.
q41I can easily tell if someone else is interested or bored with what I am saying.
q42I get upset if I see people suffering on news programs.
q43Friends usually talk to me about their problems as they say that I am very understanding.
q44I can sense if I am intruding, even if the other person doesn't tell me.
q46People sometimes tell me that I have gone too far with teasing.
q48Other people often say that I am insensitive, though I don't always see why.
q49If I see a stranger in a group, I think that it is up to them to make an effort to join in.
q50I usually stay emotionally detached when watching a film.
q52I can tune into how someone else feels rapidly and intuitively.
q54I can easily work out what another person might want to talk about.
q55I can tell if someone is masking their true emotion.
q57I don't consciously work out the rules of social situations.
q58I am good at predicting what someone will do.
q59I tend to get emotionally involved with a friend's problems.
q60I can usually appreciate the other person's viewpoint, even if I don't agree with it.
Source
See https://dataverse.harvard.edu/dataverse/pdsl for the raw YouGov and/or Qualtrics data.
References
Baron-Cohen, Simon, and Sally Wheelwright. "The empathy quotient: an investigation of adults with Asperger syndrome or high functioning autism, and normal sex differences." Journal of autism and developmental disorders 34, no. 2 (2004): 163-175.
Stillwell, David, and Michal Kosinski. 2007. "myPersonality Project." https://sites.google.com/michalkosinski.com/mypersonality
See Also
Standard Error of Ability Parameter Estimate
Description
Estimates the standard error for a respondent's ability parameter estimate, \theta.
Usage
estimateSE(catObj)
Arguments
catObj |
An object of class |
Details
The function estimateSE estimates the standard error of the ability estimate
given the estimation approach of the Cat object, specified in estimation slot of Cat object.
The expected a posteriori approach is used when estimation slot is "EAP". This method involves integration. See Note for more information.
The modal a posteriori approach is used when estimation slot is "MAP". This method is only available using the normal prior distribution.
The maximum likelihood approach is used when estimation slot is "MLE". When the likelihood
of the ability estimate is undefined,
the MAP or EAP method will be used, determined by what is specified in the estimationDefault slot in Cat object.
The weighted maximum likelihood approach is used when estimation slot is "WLE".
Estimating \theta requires root finding with the “Brent” method in the GNU Scientific
Library (GSL) with initial search interval of [-5,5].
Value
The function estimateSE returns a numeric for the standard error for \theta.
Note
This function is to allow users to access the internal functions of the package. During item selection, all calculations are done in compiled C++ code.
This function uses adaptive quadrature methods from the GNU Scientific
Library (GSL) to approximate single-dimensional
integrals with high accuracy. The bounds of integration are determined by the
lowerBound and upperBound slots of the Cat object.
Author(s)
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil
See Also
Examples
## Loading ltm Cat object
data(ltm_cat)
## Store example answers
setAnswers(ltm_cat) <- c(1,0,1,0,1, rep(NA, 35))
## Set different estimation procedures and calculate ability estimate and its standard error
setEstimation(ltm_cat) <- "EAP"
estimateTheta(ltm_cat)
estimateSE(ltm_cat)
setEstimation(ltm_cat) <- "MAP"
estimateTheta(ltm_cat)
estimateSE(ltm_cat)
setEstimation(ltm_cat) <- "MLE"
estimateTheta(ltm_cat)
estimateSE(ltm_cat)
setEstimation(ltm_cat) <- "WLE"
estimateTheta(ltm_cat)
estimateSE(ltm_cat)
Estimate of the Respondent's Ability Parameter
Description
Estimates the expected value of the ability parameter \theta, conditioned on the observed answers, prior, and the item parameters.
Usage
estimateTheta(catObj)
Arguments
catObj |
An object of class |
Details
Estimation approach is specified in estimation slot of Cat object.
The expected a posteriori approach is used when estimation slot is "EAP". This method involves integration. See Note for more information.
The modal a posteriori approach is used when estimation slot is "MAP". This method is only available using the normal prior distribution.
The maximum likelihood approach is used when estimation slot is "MLE". When the likelihood is undefined,
the MAP or EAP method will be used, determined by what is specified in the estimationDefault slot in Cat object.
The weighted maximum likelihood approach is used when estimation slot is "WLE".
Estimating \theta requires root finding with the “Brent” method in the GNU Scientific
Library (GSL) with initial search interval of [-5,5].
Value
The function estimateTheta returns a numeric consisting of the expected value of the respondent's ability parameter.
Note
This function is to allow users to access the internal functions of the package. During item selection, all calculations are done in compiled C++ code.
This function uses adaptive quadrature methods from the GNU Scientific
Library (GSL) to approximate single-dimensional
integrals with high accuracy. The bounds of integration are determined by the
lowerBound and upperBound slots of the Cat object.
Author(s)
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil
References
van der Linden, Wim J. 1998. "Bayesian Item Selection Criteria for Adaptive Testing." Psychometrika 63(2):201-216.
Van der Linden, Wim J., and Peter J. Pashley. 2009. "Item Selection and Ability Estimation in Adaptive Testing." Elements of Adaptive Testing. Springer New York, 3-30.
See Also
Examples
## Loading ltm Cat object
data(ltm_cat)
## Store example answers
setAnswers(ltm_cat) <- c(1,0,1,0,1, rep(NA, 35))
## Set different estimation procedures and estimate ability parameter
setEstimation(ltm_cat) <- "EAP"
estimateTheta(ltm_cat)
setEstimation(ltm_cat) <- "MAP"
estimateTheta(ltm_cat)
setEstimation(ltm_cat) <- "MLE"
estimateTheta(ltm_cat)
setEstimation(ltm_cat) <- "WLE"
estimateTheta(ltm_cat)
Estimates of Ability Parameters for a Dataset of Response Profiles
Description
Estimates the expected value of the ability parameter \theta, conditioned on the observed answers, prior, and the item parameters
for complete response profiles for a dataset of respondents.
Usage
## S4 method for signature 'Cat'
estimateThetas(catObj, responses)
Arguments
catObj |
An object of class |
responses |
A dataframe of complete response profiles |
Details
Estimation approach is specified in estimation slot of Cat object.
The expected a posteriori approach is used when estimation slot is "EAP". This method involves integration. See Note for more information.
The modal a posteriori approach is used when estimation slot is "MAP". This method is only available using the normal prior distribution.
The maximum likelihood approach is used when estimation slot is "MLE". When the likelihood is undefined,
the MAP or EAP method will be used, determined by what is specified in the estimationDefault slot in Cat object.
The weighted maximum likelihood approach is used when estimation slot is "WLE".
Estimating \theta requires root finding with the “Brent” method in the GNU Scientific
Library (GSL) with initial search interval of [-5,5].
Value
The function estimateThetas returns a vector containing respondents' estimated ability parameters.
Note
This function is to allow users to access the internal functions of the package. During item selection, all calculations are done in compiled C++ code.
This function uses adaptive quadrature methods from the GNU Scientific
Library (GSL) to approximate single-dimensional
integrals with high accuracy. The bounds of integration are determined by the
lowerBound and upperBound slots of the Cat object.
Author(s)
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil
See Also
Examples
## Loading ltm Cat object
data(ltm_cat)
## Set different estimation procedures and estimate ability parameter
data(npi)
setEstimation(ltm_cat) <- "EAP"
estimateThetas(ltm_cat, responses = npi[1:25, ])
Example Qualtrics Data for Adaptive Inventory
Description
Example data when including an adaptive inventory on a Qualtrics survey
Usage
data(ex_qualtrics_results)
Format
An object of class data.frame with 6 rows and 9 columns.
Details
This data set includes four example responses to a length four adaptive inventory for the agreeableness battery.
See agree_cat for details regarding the Cat object structure and battery items.
See readQualtrics for how to clean adaptive inventory response profiles.
See Also
Example Qualtrics Data for Multiple Adaptive Inventories
Description
Example data when including multiple adaptive inventory on a Qualtrics survey
Usage
data(ex_qualtrics_results_multiple)
Format
An object of class data.frame with 6 rows and 17 columns.
Details
This data set includes four example responses to length four adaptive inventories for both the agreeableness and neuroticism batteries.
See agree_cat and neuro_cat for details regarding the Cat object structure and battery items.
See readQualtrics for how to clean adaptive inventory response profiles.
See Also
agree_cat, neuro_cat,readQualtrics
Expected Kullback-Leibler Information
Description
Calculates the expected Kullback-Leibler information for an individual question item.
Usage
expectedKL(catObj, item)
Arguments
catObj |
An object of class |
item |
An integer indicating the index of the question item |
Details
The function expectedKL calculates the expected value of the Kullback-Leibler information
for a specified item where the bounds of integration are \hat{\theta} \pm \delta,
where \delta is qnorm(z) times the square root of the Fisher test information and
z is specified in the z slot of the Cat object. See Note for more information on integration.
Value
The function expectedKL returns a numeric indicating the
expected Kullback-Leibler information
for the specified item, given the current answer profile and ability parameter estimate.
Note
This function is to allow users to access the internal functions of the package. During item selection, all calculations are done in compiled C++ code.
This function uses adaptive quadrature methods from the GNU Scientific Library (GSL) to approximate single-dimensional integrals with high accuracy.
Author(s)
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil
See Also
likelihoodKL, posteriorKL, selectItem
Examples
## Loading ltm Cat object
data(ltm_cat)
## Store example answers
setAnswers(ltm_cat) <- c(1,0,1,0,1, rep(NA, 35))
## Estimate KL for different unasked items
expectedKL(ltm_cat, item = 10)
expectedKL(ltm_cat, item = 20)
expectedKL(ltm_cat, item = 30)
Expected Observed Information
Description
Calculates the expected information, which is the observed information attained from a specific response set times the probability of that profile occurring.
Usage
expectedObsInf(catObj, item)
Arguments
catObj |
An object of class |
item |
An integer indicating the index of the question item |
Value
The function expectedObsInf returns a numeric value of the expected information. **Not implemented
for three parameter model for binary data.**
Note
This function is to allow users to access the internal functions of the package. During item selection, all calculations are done in compiled C++ code.
Author(s)
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil
See Also
estimateSE,obsInf, probability, selectItem
Examples
## Loading ltm Cat object
data(ltm_cat)
## Store example answers
setAnswers(ltm_cat) <- c(1,0,1,0,1, rep(NA, 35))
## Expected observed information for different items
expectedObsInf(ltm_cat, item = 10)
expectedObsInf(ltm_cat, item = 20)
Expected Posterior Variance
Description
Estimates the expected posterior variance for a respondent's estimated ability parameter for an item yet to be answered based on a respondent's ability parameter estimate from the already-answered items.
Usage
expectedPV(catObj, item)
Arguments
catObj |
An object of class |
item |
An integer indicating the index of the question item |
Value
The function expectedPV returns a numeric value indicating a respondent's expected posterior variance for an unasked item.
Note
This function is to allow users to access the internal functions of the package. During item selection, all calculations are done in compiled C++ code.
Author(s)
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil
See Also
estimateSE, probability, selectItem
Examples
## Loading ltm Cat object
data(ltm_cat)
## Store example answers
setAnswers(ltm_cat) <- c(1,0,1,0,1, rep(NA, 35))
## Estimate EPV for different unasked items
expectedPV(ltm_cat, item = 10)
expectedPV(ltm_cat, item = 20)
expectedPV(ltm_cat, item = 30)
Extraversion Cat Object
Description
Cat object containing item parameters for graded response model fit with responses to the 20-item Extraversion dimension of the 100-item IPIP representation of Costa and McCrae's Five Factor Model
Usage
data(extra_cat)
Format
An object of class Cat of length 1.
Details
Cat object containing item parameters for graded response model fit with 774,410 response profiles by myPersonality Project and 1500 response profiles collected by YouGov in June 2018. The sample from myPersonality Project was a convenience sample, and the respondents from YouGov were matched to a sampling frame on gender, age, race, and education.
See Cat-class for details regarding the Cat object structure.
See grmCat for details regarding the graded response model.
A normal prior was chosen with mean from the theta estimates from the YouGov sample (-.367) and a standard deviation (1.3) wide enough to envelope the range of estimated theta values across both samples.
Note that due to how the item parameters were estimated, large, positive values indicate "more" of the latent trait.
Response options are 1=Very inaccurate; 2=Moderately inaccurate; 3=Neither inaccurate nor accurate; 4=Moderately accurate; 5=Very accurate.
The wording of the question items:
I...
q83Feel comfortable around people.
q10Make friends easily.
q73Am skilled in handling social situations.
q63Am the life of the party.
q53Know how to captivate people.
q93Start conversations.
q33Warm up quickly to others.
q43Talk to a lot of different people at parties.
q3Don't mind being the center of attention.
q23Cheer people up.
q39Have little to say.
q14Keep in the background.
q89Would describe my experiences as somewhat dull.
q59Don't like to draw attention to myself.
q29Don't talk a lot.
q18Avoid contacts with others.
q99Am hard to get to know.
q79Retreat from others.
q69Find it difficult to approach others.
q49Keep others at a distance.
Source
See https://dataverse.harvard.edu/dataverse/pdsl for the raw YouGov and/or Qualtrics data.
References
Costa, P. T., Jr., & McCrae, R. R. (1992). Revised NEO Personality Inventory (NEO PI-R) and NEO Five-Factor Inventory (NEO-FFI): Professional manual. Odessa, FL: Psychological Assessment Resources.
Stillwell, David, and Michal Kosinski. 2007. "myPersonality Project." https://sites.google.com/michalkosinski.com/mypersonality
See Also
Fisher's Information
Description
Calculates the expected value of the observed information of the likelihood evaluated at the input value \theta.
Usage
fisherInf(catObj, theta, item)
Arguments
catObj |
An object of class |
theta |
A numeric or an integer indicating the potential value for |
item |
An integer indicating the index of the question item |
Details
For the dichotomous case, this Fisher's information is equivalent to the observed information.
Value
The function fisherInf returns a numeric of the expected value of the observed information of the likelihood evaluated at the input value \theta.
Note
This function is to allow users to access the internal functions of the package. During item selection, all calculations are done in compiled C++ code.
Author(s)
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil
See Also
fisherTestInfo, obsInf, selectItem
Examples
## Loading ltm Cat object
data(ltm_cat)
## Store example answers
setAnswers(ltm_cat) <- c(1,0,1,0,1, rep(NA, 35))
## Fisher's information for different items, at ability parameter of 1
fisherInf(ltm_cat, theta = 1, item = 10)
fisherInf(ltm_cat, theta = 1, item = 20)
Fisher's Test Information
Description
Calculates the total information gained for a respondent for all answered items, conditioned on \theta.
Usage
fisherTestInfo(catObj, theta)
Arguments
catObj |
An object of class |
theta |
A numeric indicating the position on the latent trait. |
Value
The function fisherTestInfo returns a numeric indicating the total information gained for a respondent,
given a specific answer set and the current estimate of \theta.
Note
This function is to allow users to access the internal functions of the package. During item selection, all calculations are done in compiled C++ code.
Author(s)
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil
See Also
Examples
## Loading ltm Cat object
data(ltm_cat)
## Store example answers
setAnswers(ltm_cat) <- c(1,0,1,0,1, rep(NA, 35))
## Fisher's test information for answer profile
fisherTestInfo(ltm_cat, theta = 2)
Convert JSON object to Cat object
Description
This function object of class Cat.
Usage
## S4 method for signature 'json'
fromJSONCat(jsonObj)
## S4 method for signature 'character'
fromJSONCat(jsonObj)
Arguments
jsonObj |
A |
Details
The jsonObj argument of the function fromJSONCat is an object of class json from the rjson package. This function simply populates a Cat object with the information provided in the jsonObj, thus element and slot names must match.
Value
The function fromJSONCat returns an object of class Cat with slots populated with the corresponding information stored in the jsonObj.
See Cat-class for required Cat object slots.
Author(s)
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil
See Also
Methods for Accessing Cat Object Slots
Description
Getter methods to access slots of a Cat object.
Usage
## S4 method for signature 'Cat'
getModel(catObj)
## S4 method for signature 'Cat'
getGuessing(catObj)
## S4 method for signature 'Cat'
getDiscrimination(catObj)
## S4 method for signature 'Cat'
getDifficulty(catObj)
## S4 method for signature 'Cat'
getAnswers(catObj)
## S4 method for signature 'Cat'
getIds(catObj)
## S4 method for signature 'Cat'
getPriorName(catObj)
## S4 method for signature 'Cat'
getPriorParams(catObj)
## S4 method for signature 'Cat'
getLowerBound(catObj)
## S4 method for signature 'Cat'
getUpperBound(catObj)
## S4 method for signature 'Cat'
getEstimation(catObj)
## S4 method for signature 'Cat'
getEstimationDefault(catObj)
## S4 method for signature 'Cat'
getSelection(catObj)
## S4 method for signature 'Cat'
getZ(catObj)
## S4 method for signature 'Cat'
getLengthThreshold(catObj)
## S4 method for signature 'Cat'
getSeThreshold(catObj)
## S4 method for signature 'Cat'
getInfoThreshold(catObj)
## S4 method for signature 'Cat'
getGainThreshold(catObj)
## S4 method for signature 'Cat'
getLengthOverride(catObj)
## S4 method for signature 'Cat'
getGainOverride(catObj)
Arguments
catObj |
An object of class |
Value
These functions return the respective slot from Cat object.
Author(s)
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil
References
Montgomery, Jacob M., and Erin L. Rossiter. "So many questions, so little time: Integrating adaptive inventories into public opinion research." Journal of Survey Statistics and Methodology (2019).
See Also
Examples
## Loading ltm Cat object
data(ltm_cat)
## Getting estimation slot before and after change
getEstimation(ltm_cat)
setEstimation(ltm_cat) <- "MAP"
getEstimation(ltm_cat)
## Getting discrimination slot before and after change
getDiscrimination(ltm_cat)
setDiscrimination(ltm_cat) <- rep(1, 40)
getDiscrimination(ltm_cat)
Computerized Adaptive Testing Generalized Partial Credit Model
Description
This function fits the generalized partial credit model for ordinal polytomous data and populates the fitted values for discrimination and difficulty parameters to an object of class Cat.
Usage
## S4 method for signature 'data.frame'
gpcmCat(data, quadraturePoints = 21, ...)
## S4 method for signature 'gpcm'
gpcmCat(data, quadraturePoints = NULL, ...)
Arguments
data |
A data frame of manifest variables or an object of class |
quadraturePoints |
A numeric to be passed into the |
... |
arguments to be passed to methods. For more details about the arguments, see |
Details
The data argument of the function gpcmCat is either a data frame or an object of class gpcm 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 gpcm, it is output from the gpcm function in the ltm package.
The quadraturePoints argument of the function gpcmCat is used only when the data argument is a data frame. quadraturePoints is then passed to the gpcm function from the ltm package when fitting the generalized partial credit model to the data and is used when approximating the value of integrals.
Value
The function gpcmCat returns an object of class Cat with changes to the following slots:
-
difficultyA list of difficulty parameters, where each element in the list corresponds to the difficulty parameters for an item. -
discriminationA vector consisting of of discrimination parameters for each item. -
modelThe string"gpcm", indicating thisCatobject corresponds to a generalized partial credit model.
See Cat-class for default values of Cat object slots. See Examples and setters for example code to change slot values.
Note
This Cat object should be used for testing package functionality only.
In case the Hessian matrix at convergence is not positive definite try to use start.val = "random".
Author(s)
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil
References
Baker, Frank B. and Seock-Ho Kim. 2004. Item Response Theory: Parameter Estimation Techniques. New York: Marcel Dekker.
Muraki, Eiji. 1992. “A generalized partial credit model: Application of an EM algorithm." ETS Research Report Series 1992(1):1-30.
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, grmCat, polknowTAPS, probability
Examples
## Not run:
## Creating Cat object with fitted object of class gpcm
data(polknowTAPS)
gpcm_fit <- gpcm(polknowTAPS, constraint = "gpcm", control = list(iter.qN = 200, GHk = 100))
class(gpcm_fit)
gpcm_cat <- gpcmCat(gpcm_fit)
## End(Not run)
## Creating Cat objects from large datasets is computationally expensive
## Load the Cat object created from the above code
data(gpcm_cat)
## Slots that have changed from default values
getModel(gpcm_cat)
getDifficulty(gpcm_cat)
getDiscrimination(gpcm_cat)
## Changing slots from default values
setEstimation(gpcm_cat) <- "MLE"
setSelection(gpcm_cat) <- "MFI"
gpcm Cat Object
Description
An object of class Cat created using the gpcmCat function with the polknowTAPS dataset.
To have a better fitting model, we first fit an object of class gpcm from the ltm package which
provides for additional control values to be used in fitting. See gpcmCat.
Usage
data(gpcm_cat)
Format
An object of class Cat. See Cat-class for more details.
See Also
Cat-class, gpcmCat, polknowTAPS
Examples
## Not run:
## How this Cat object was created
data(polknowTAPS)
gpcm_fit <- gpcm(polknowTAPS, constraint = "gpcm", control = list(iter.qN = 200, GHk = 100))
gpcm_cat <- gpcmCat(gpcm_fit)
## End(Not run)
## How to load this Cat object for usage
data(gpcm_cat)
Computerized Adaptive Testing Graded Response Model
Description
This function fits the graded response model for ordinal polytomous data and populates the fitted values for discrimination and difficulty parameters to an object of class Cat.
Usage
## S4 method for signature 'data.frame'
grmCat(data, quadraturePoints = 21, ...)
## S4 method for signature 'grm'
grmCat(data, quadraturePoints = NULL, ...)
Arguments
data |
A data frame of manifest variables or an object of class |
quadraturePoints |
A numeric to be passed into the |
... |
arguments to be passed to methods. For more details about the arguments, see |
Details
The data argument of the function grmCat is either a data frame or an object of class grm 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 grm, it is output from the grm function in the ltm package.
The quadraturePoints argument of the function grmCat is used only when the data argument is a data frame. quadraturePoints is then passed to the grm function from the ltm package when fitting the graded response model to the data and is used when approximating the value of integrals.
Value
The function grmCat returns an object of class Cat with changes to the following slots:
-
difficultyA list of difficulty parameters, where each element in the list corresponds to the difficulty parameters for an item. -
discriminationA vector consisting of discrimination parameters for each item. -
modelThe string"grm", indicating thisCatobject corresponds to a graded response model.
See Cat-class for default values of Cat object slots. See Examples and setters for example code to change slot values.
Note
In case the Hessian matrix at convergence is not positive definite try to use start.val = "random".
Author(s)
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil
References
Baker, Frank B. and Seock-Ho Kim. 2004. Item Response Theory: Parameter Estimation Techniques. New York: Marcel Dekker.
Samejima, Fumiko. 1969. “Estimation of Latent Ability Using a Response Pattern of Graded Scores." Psychometrika monograph supplement 34(4):100-114.
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, gpcmCat, nfc, probability
Examples
## Not run:
## Creating Cat object with raw data
data(nfc)
grm_cat1 <- grmCat(nfc, quadraturePoints = 100)
## Creating Cat object with fitted object of class grm
grm_fit <- grm(nfc, control = list(GHk = 100)) ## from ltm package
class(grm_fit)
grm_cat2 <- grmCat(grm_fit)
## Note the two Cat objects are identical
identical(grm_cat1, grm_cat2)
## End(Not run)
## Creating Cat objects from large datasets is computationally expensive
## Load the Cat object created from the above code
data(grm_cat)
## Slots that have changed from default values
getModel(grm_cat)
getDifficulty(grm_cat)
getDiscrimination(grm_cat)
## Changing slots from default values
setEstimation(grm_cat) <- "MLE"
setSelection(grm_cat) <- "MFI"
grm Cat Object
Description
An object of class Cat created using the grmCat function with the nfc dataset.
Usage
data(grm_cat)
Format
An object of class Cat. See Cat-class for more details.
See Also
Examples
## Not run:
## How this Cat object was created
data(nfc)
grm_cat <- grmCat(nfc, quadraturePoints = 100)
## End(Not run)
## How to load this Cat object for usage
data(grm_cat)
Likelihood of the Specified Response Set
Description
Calculates the likelihood of a respondent, with ability parameter \theta, having offered the specific set of responses stored in the Cat objects answers slot. All calculations are conditional on the item-level parameters stored in the Cat object.
Usage
likelihood(catObj, theta)
Arguments
catObj |
An object of class |
theta |
A numeric or an integer indicating the value for |
Value
The function likelihood returns a numeric value of the likelihood of the respondent having offered the provided response profile.
Note that when no questions have been answered, likelihood evaluates to 1.
Note
This function is to allow users to access the internal functions of the package. During item selection, all calculations are done in compiled C++ code.
Author(s)
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil
References
Baker, Frank B. and Seock-Ho Kim. 2004. Item Response Theory: Parameter Estimation Techniques. New York: Marcel Dekker.
Choi, Seung W. and Richard J. Swartz. 2009. “Comparison of CAT Item Selection Criteria for Polytomous Items." Applied Psychological Measurement 33(6):419-440.
Muraki, Eiji. 1992. “A generalized partial credit model: Application of an EM algorithm." ETS Research Report Series 1992(1):1-30.
van der Linden, Wim J. 1998. “Bayesian Item Selection Criteria for Adaptive Testing." Psychometrika 63(2):201-216.
See Also
Examples
## Loading ltm Cat object
## Likelihood for Cat object of the ltm model
data(ltm_cat)
setAnswers(ltm_cat) <- c(1,0,1,0,1, rep(NA, 35))
likelihood(ltm_cat, theta = 1)
## Loading grm Cat object
## Likelihood for Cat object of the grm model
data(grm_cat)
setAnswers(grm_cat) <- c(1,1,5,2,5, rep(NA, 13))
likelihood(grm_cat, theta = 1)
Expected Kullback-Leibler Information, Weighted by Likelihood
Description
Calculates the expected Kullback-Leibler information, weighted by likelihood, for a specified item.
Usage
likelihoodKL(catObj, item)
Arguments
catObj |
An object of class |
item |
An integer indicating the index of the question item |
Details
The function likelihoodKL calculates the expected Kullback-Leibler information
for question item, where the proposed values of the true ability parameter are weighted by
the current likelihood.
This function involves integration. See Note for more information.
Value
The function likelihoodKL returns a numeric indicating the
expected Kullback-Leibler information weighted by the likelihood
for the specified item, given the current answer profile and ability parameter estimate.
Note
This function is to allow users to access the internal functions of the package. During item selection, all calculations are done in compiled C++ code.
This function uses adaptive quadrature methods from the GNU Scientific
Library (GSL) to approximate single-dimensional
integrals with high accuracy. The bounds of integration are determined by the
lowerBound and upperBound slots of the Cat object.
Author(s)
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil
See Also
expectedKL, posteriorKL, selectItem
Examples
## Loading ltm Cat object
data(ltm_cat)
## Store example answers
setAnswers(ltm_cat) <- c(1,0,1,0,1, rep(NA, 35))
## Estimate EPV for different unasked items
likelihoodKL(ltm_cat, item = 10)
likelihoodKL(ltm_cat, item = 20)
likelihoodKL(ltm_cat, item = 30)
Look Ahead to Select Next Item
Description
Selects the next item that would be asked for all possible response options to the question the respondent is currently answering.
Usage
lookAhead(catObj, item)
Arguments
catObj |
An object of class |
item |
A numeric indicating the question item the respondent is currently answering. |
Value
A function lookAhead returns a data.frame.
The the first column of the data frame is the possible response option to the question the respondent
is currently answering and the second column is the next item that should be asked given each response.
Note
This function is to allow users to access the internal functions of the package. During item selection, all calculations are done in compiled C++ code.
Author(s)
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil
See Also
Examples
## Loading ltm Cat object
data(ltm_cat)
## Store example answers
setAnswers(ltm_cat) <- c(1,0,1,0,1, rep(NA, 35))
## What should be asked next if respondent is currently answering item 6
lookAhead(ltm_cat, 6)
## Loading grm Cat object
data(grm_cat)
## Store example answers
setAnswers(grm_cat) <- c(4,3,5,1,1, rep(NA, 13))
## What should be asked next if respondent is currently answering item 6
lookAhead(grm_cat, 6)
Computerized Adaptive Testing Latent Trait Model
Description
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.
Usage
## 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 |
quadraturePoints |
A numeric to be passed into the |
... |
arguments to be passed to methods. For more details about the arguments, see |
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.
Value
The function ltmCat returns an object of class Cat with changes to the following slots:
-
difficultyA vector consisting of difficulty parameters for each item. -
discriminationA vector consisting of discrimination parameters for each item. -
modelThe string"ltm", indicating thisCatobject 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.
Note
In case the Hessian matrix at convergence is not positive definite try to use start.val = "random".
Author(s)
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil
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
Examples
## Not run:
## Creating Cat object with raw data
data(npi)
ltm_cat1 <- ltmCat(npi, quadraturePoints = 100)
## Creating Cat object with fitted object of class ltm
ltm_fit <- ltm(npi ~ z1, control = list(GHk = 100)) ## from ltm package
class(ltm_fit)
ltm_cat2 <- ltmCat(ltm_fit)
## Note the two Cat objects are identical
identical(ltm_cat1, ltm_cat2)
## End(Not run)
## Creating Cat objects from large datasets is computationally expensive
## Load the Cat object created from the above code
data(ltm_cat)
## Slots that have changed from default values
getModel(ltm_cat)
getDifficulty(ltm_cat)
getDiscrimination(ltm_cat)
## Changing slots from default values
setEstimation(ltm_cat) <- "MLE"
setSelection(ltm_cat) <- "MFI"
ltm Cat Object
Description
An object of class Cat created using the ltmCat function with the npi dataset.
Usage
data(ltm_cat)
Format
An object of class Cat. See Cat-class for more details.
See Also
Examples
## Not run:
## How this Cat object was created
data(npi)
ltm_cat <- ltmCat(npi, quadraturePoints = 100)
## End(Not run)
## How to load this Cat object for usage
data(ltm_cat)
Machiavellianism Personality Cat Object
Description
Cat object containing item parameters for graded response model fit with responses to the 20 item machiavellianism inventory
Usage
data(mach_cat)
Format
An object of class Cat of length 1.
Details
Cat object containing item parameters for graded response model fit with 3020 response profiles collected by Qualtrics in June 2018 and 12299 response profiles collected by the Open Source Psychometrics Project in 2012.
See Cat-class for details regarding the Cat object structure.
See grmCat for details regarding the graded response model.
A normal prior was chosen with mean from the theta estimates from the Qualtrics sample (-0.713) and a standard deviation (1) wide enough to envelope the range of estimated theta values across both samples.
Note that due to how the item parameters were estimated, large, positive values indicate "more" of the latent trait.
Response options are: 5 = Strongly agree, 4 = Somewhat agree, 3 = Neither agree nor disagree, 2 = Somewhat disagree, 1 = Strongly disagree
The wording of the item responses is:
Q1Never tell anyone the real reason you did something unless it is useful to do so.
Q2The best way to handle people is to tell them what they want to hear.
Q3One should take action only when sure it is morally right.
Q4Most people are basically good and kind.
Q5It is safest to assume that all people have a vicious streak and it will come out when they are given a chance.
Q6Honesty is the best policy in all cases.
Q7There is no excuse for lying to someone else.
Q8Generally speaking, people won't work hard unless they're forced to do so.
Q9All in all, it is better to be humble and honest than to be important and dishonest.
Q10When you ask someone to do something for you, it is best to give the real reasons for wanting it rather than giving reasons which carry more weight.
Q11Most people who get ahead in the world lead clean, moral lives.
Q12Anyone who completely trusts anyone else is asking for trouble.
Q13The biggest difference between most criminals and other people is that the criminals are stupid enough to get caught.
Q14Most people are brave.
Q15It is wise to flatter important people.
Q16It is possible to be good in all respects.
Q17P.T. Barnum was wrong when he said that there's a sucker born every minute.
Q18It is hard to get ahead without cutting corners here and there.
Q19People suffering from incurable diseases should have the choice of being put painlessly to death.
Q20Most people forget more easily the death of their parents than the loss of their property.
Source
See https://dataverse.harvard.edu/dataverse/pdsl for the raw YouGov and/or Qualtrics data.
See https://openpsychometrics.org/_rawdata/, maintained by Eric Jorgenson, for the raw Open Source Psychometrics Project data.
References
Christie, R., F. L. Geis, and D. Berger (1970), Studies in Machiavellianism, New York: Academic Press.
Open Source Psychometrics Project. https://openpsychometrics.org/_rawdata/
See Also
Make Tree of Possible Question Combinations
Description
Pre-calculates a complete branching scheme of all possible questions-answer combinations and stores it as a list of lists or a flattened table of values.
Usage
makeTree(catObj, flat = FALSE)
Arguments
catObj |
An object of class |
flat |
A logical indicating whether to return tree as as a list of lists or a table |
Details
The function takes a Cat object and generates a tree of all possible question-answer combinations, conditional on previous answers in the branching scheme and the current \theta estimates for the branch.
The tree is stored as a list of lists, iteratively generated by filling in a possible answer, calculating the next question via selectItem, filling in a possible answer for that question, and so forth.
The length of each complete branching scheme within the tree is dictated by the lengthThreshold slot within the Cat object.
Value
The function makeTree returns either a list or a table. If the argument flat is FALSE, the default value, the function returns a list of lists.
If the argument flat is TRUE, the function takes the list of lists and configures it into a flattened table where the columns represent the battery items and the rows represent the possible answer profiles.
Note
This function is computationally expensive. If there are k response options and the researcher wants a complete branching scheme to include n items, k^{n-1} complete branching schemes will be calculated. Setting n is done via the lengthThreshold slot in the Cat object. See Examples.
This function is to allow users to access the internal functions of the package. During item selection, all calculations are done in compiled C++ code.
Author(s)
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil
See Also
Cat-class, checkStopRules, selectItem
Examples
## Loading ltm Cat object
data(ltm_cat)
## Setting complete branches to include 3 items
setLengthThreshold(ltm_cat) <- 3
## Object returned is list of lists
ltm_list <- makeTree(ltm_cat)
## Object returned is table
ltm_table <- makeTree(ltm_cat, flat = TRUE)
Neuroticism Cat Object
Description
Cat object containing item parameters for graded response model fit with responses to the 20-item Neuroticism dimension of the 100-item IPIP representation of Costa and McCrae's Five Factor Model
Usage
data(neuro_cat)
Format
An object of class Cat of length 1.
Details
Cat object containing item parameters for graded response model fit with 774,410 response profiles by myPersonality Project and 1500 response profiles collected by YouGov in June 2018. The sample from myPersonality Project was a convenience sample, and the respondents from YouGov were matched to a sampling frame on gender, age, race, and education.
See Cat-class for details regarding the Cat object structure.
See grmCat for details regarding the graded response model.
A normal prior was chosen with mean from the theta estimates from the YouGov sample (-.025) and a standard deviation (1.2) wide enough to envelope the range of estimated theta values across both samples.
Note that due to how the item parameters were estimated, large, positive values indicate "more" of the latent trait.
Response options are 1=Very inaccurate; 2=Moderately inaccurate; 3=Neither inaccurate nor accurate; 4=Moderately accurate; 5=Very accurate.
The wording of the question items:
I...
q12Often feel blue.
q30Dislike myself.
q80Am often down in the dumps.
q70Have frequent mood swings.
q50Panic easily.
q90Am filled with doubts about things.
q100Feel threatened easily.
q17Get stressed out easily.
q40Fear for the worst.
q60Worry about things.
q37Seldom feel blue.
q11Feel comfortable with myself.
q67Rarely get irritated.
q19Am not easily bothered by things.
q97Am very pleased with myself.
q27Am relaxed most of the time.
q77Seldom get mad.
q47Am not easily frustrated.
q87Remain calm under pressure.
q57Rarely lose my composure.
Source
See https://dataverse.harvard.edu/dataverse/pdsl for the raw YouGov and/or Qualtrics data.
References
Costa, P. T., Jr., & McCrae, R. R. (1992). Revised NEO Personality Inventory (NEO PI-R) and NEO Five-Factor Inventory (NEO-FFI): Professional manual. Odessa, FL: Psychological Assessment Resources.
Stillwell, David, and Michal Kosinski. 2007. "myPersonality Project." https://sites.google.com/michalkosinski.com/mypersonality
See Also
Need for Affect Cat Object
Description
Cat object containing item parameters for graded response model fit with responses to the 26 item Need for Affect inventory
Usage
data(nfa_cat)
Format
An object of class Cat of length 1.
Details
Cat object containing item parameters for graded response model fit with 2507 response profiles from MTurk, 4990 response profiles collected by Qualtrics in June 2018, and 1512 response profiles from The American Panel Survey (TAPS) in December 2014. TAPS is a monthly online panel survey of about 2,000 adults in the United States. The panel was recruited in the fall of 2011 using an address-based sampling frame. TAPS surveys are administered online. Selected panelists who do not have a computer or online service are provided a computer and internet access by TAPS.
See Cat-class for details regarding the Cat object structure.
See grmCat for details regarding the graded response model.
A normal prior was chosen with mean from the theta estimates from the TAPS sample (.236) and a standard deviation (1.3) wide enough to envelope the range of estimated theta values across both samples.
Note that due to how the item parameters were estimated, large, positive values indicate "more" of the latent trait.
Response options are:
5 = Strongly agree, 4 = Somewhat agree, 3 = Neither agree nor disagree, 2 = Somewhat disagree, 1 = Strongly disagree
The wording of the question items is:
q1It is important for me to be in touch with my feelings.
q2I think that it is very important to explore my feelings.
q3I am a very emotional person.
q4It is important for me to know how others are feeling.
q5Emotions help people get along in life.
q6Strong emotions are generally beneficial.
q7I feel that I need to experience strong emotions regularly.
q8I approach situations in which I expect to experience strong emotions.
q9I feel like I need a good cry every now and then.
q10I like to dwell on my emotions.
q11We should indulge our emotions.
q12I like decorating my bedroom with a lot of pictures and posters of things emotionally significant to me.
q13The experience of emotions promotes human survival.
q14I do not know how to handle my emotion, so I avoid them.
q15I find strong emotions overwhelming and therefore try to avoid them.
q16Emotions are dangerous—they tend to get me into situations that I would rather avoid.
q17I would prefer not to experience either the lows or highs of emotion.
q18If I reflect on my past, I see that I tend to be afraid of emotions.
q19I would love to be like Mr. Spock, who is totally logical and experiences little emotion.
q20I have trouble telling the people close to me that I love them.
q21Displays of emotions are embarrassing.
q22Acting on ones emotions is always a mistake.
q23I am sometimes afraid of how I might act if I become too emotional.
q24Avoiding emotional events helps me sleep better at night.
q25I wish I could feel less emotion.
q26People can function most effectively when they are not experiencing strong emotions.
Source
See https://dataverse.harvard.edu/dataverse/pdsl for the raw YouGov and/or Qualtrics data.
See https://wc.wustl.edu for raw TAPS data.
References
Maio, Gregory R., and Victoria M. Esses. "The need for affect: Individual differences in the motivation to approach or avoid emotions." Journal of personality 69.4 (2001): 583-614.
See Also
Need For Cognition
Description
Data of survey respondents' responses to 18 NFC questions, which is a reduced version of NFC (Cacioppo and Petty 1984). For each question, respondents could choose one of five response options: 1 = agree strongly, 2 = agree somewhat, 3 = neither agree nor disagree, 4 = disagree somewhat, 5 = disagree strongly. Missingness is optional. Observations come from one of three administrations of the survey: The American Panel Survey, Amazon's Mechanical Turk in fall of 2014, or Amazon's Mechanical Turk in spring of 2015.
Usage
data(nfc)
Format
A data frame with 4043 observations on the following 18 variables.
NFC1I really enjoy a task that involves coming up with new solutions to problems
NFC4I would prefer a task that is intellectual, difficult, and important to one that is somewhat important but does not require much thought
NFC10Learning new ways to think doesn't excite me very much
NFC12I usually end up deliberating about issues even when they do not affect me personally
NFC15The idea of relying on thought to make my way to the top appeals to me
NFC16The notion of thinking abstractly is appealing to me
NFC19I only think as hard as I have to
NFC21I think tasks that require little thought once I've learned them
NFC22I prefer to think about small, daily projects to long-term ones
NFC23I would rather do something that requires little thought than something that is sure to challenge my thinking abilities
NFC24I find satisfaction in deliberating hard and for long hours
NFC29I like to have the responsibility of handing a situation that requires a lot of thinkings
NFC31I feel relief rather than satisfaction after completing a task that required a lot of mental effort
NFC32Thinking is not my idea of fun
NFC33I try to anticipate and avoid situations where there is likely a chance I will have to think in depth about something
NFC39I prefer my life to be filed with puzzles that I must solve
NFC40I would prefer complex to simple problems
NFC43Its enough for me that something gets the job done; I don't care how or why it works
References
Cacioppo, John T. and Richard E. Petty. 1984. "The Efficient Assessment of Need for Cognition." Journal of Personality Assessment 48(3):306-307.
Need for Cognition Cat Object
Description
Cat object containing item parameters for graded response model fit with responses to the 34 item Need for Cognition inventory
Usage
data(nfc_cat)
Format
An object of class Cat of length 1.
Details
Cat object containing item parameters for graded response model fit with 4985 response profiles collected by Qualtrics in June 2018 and 1512 response profiles from The American Panel Survey (TAPS) in December 2014. TAPS is a monthly online panel survey of about 2,000 adults in the United States. The panel was recruited in the fall of 2011 using an address-based sampling frame. TAPS surveys are administered online. Selected panelists who do not have a computer or online service are provided a computer and internet access by TAPS.
See Cat-class for details regarding the Cat object structure.
See grmCat for details regarding the graded response model.
A normal prior was chosen with mean from the theta estimates from the TAPS sample (.003) and a standard deviation (1.6) wide enough to envelope the range of estimated theta values across both samples.
Note that due to how the item parameters were estimated, large, positive values indicate "more" of the latent trait.
Response options are:
5 = Strongly agree, 4 = Somewhat agree, 3 = Neither agree nor disagree, 2 = Somewhat disagree, 1 = Strongly disagree
The wording of the question items is:
q1I would prefer complex to simple problems.
q2I don't like to have the responsibility for handling a situation that requires a lot of thinking.
q3Thinking is not my idea of fun.
q4I would rather do something that requires little thought than something that is sure to challenge my thinking abilities.
q5I try to anticipate and avoid situations where there is a likely chance I will have to think in depth about something.
q6I find little satisfaction in deliberating hard and for long hours.
q7I only think as hard as I have to.
q8I prefer to think about small, daily projects more than long-term ones.
q9I like tasks that require little thought once I've learned them.
q10The idea of relying on thought to make my way to the top does not appeal to me.
q11I really enjoy a task that involves coming up with new solutions to problems.
q12Learning new ways to think doesn't excite me very much.
q13I prefer my life to be filled with puzzles that I must solve.
q14The notion of thinking abstractly is not appealing to me.
q15I would prefer a task that is intellectual, difficult, and important to one that is somewhat important but does not require much thought.
q16I feel relief rather the satisfaction after completing a task that required a lot of mental effort.
q17Its enough for me that something gets the job done, I don't care how or why it works.
q18I usually end up deliberating about issues even when they do not affect me personally.
q19I tend to set goals that can be accomplished only by expending considerable mental effort.
q20I am usually tempted to put more thought into a task than the job minimally requires.
q21I am hesitant about making important decisions after thinking about them.
q22I prefer just to let things happen rather than try to understand why they turned out that way.
q23I have difficulty thinking in new and unfamiliar situations.
q24I am an intellectual.
q25I don't reason well under pressure.
q26I more often talk with other people about the reasons/possible solutions to international problems than about gossip or tidbits about what famous people are doing.
q27These days, I see little chance for performing well, even in intellectual jobs, unless one knows the right people.
q28More often than not, more thinking just leads to more errors.
q29I appreciate opportunities to discover the strengths and weaknesses of my own reasoning.
q30I prefer watching educational programs more than entertainment programs.
q31I think best when those around me are very intelligent.
q32Simply knowing the answer rather than understanding the reasons for the answer to a problem is fine with me.
q33Ignorance is bliss.
q34I enjoy thinking about an issue even when the results of my thought will have no effect on the outcome of the issue.
Source
See https://dataverse.harvard.edu/dataverse/pdsl for the raw YouGov and/or Qualtrics data.
See https://wc.wustl.edu for raw TAPS data.
References
Cacioppo, John T., and Richard E. Petty. "The need for cognition." Journal of personality and social psychology 42.1 (1982): 116.
See Also
Narcissistic Personality Inventory
Description
Data from the 40 item Narcissistic Personality Inventory (Raskin and Terry 1988) collected by by the Open Source Psychometrics Project in 2012.
Usage
data(npi)
Format
A data frame with 11,243 observations on the following 40 variables.
Q10 = I have a natural talent for influencing people. 1 = I am not good at influencing people.
Q20 = Modesty doesn't become me. 1 = I am essentially a modest person.
Q30 = I would do almost anything on a dare. 1 = I tend to be a fairly cautious person.
Q40 = When people compliment me I sometimes get embarrassed. 1 = I know that I am good because everybody keeps telling me so.
Q50 = The thought of ruling the world frightens the hell out of me. 1 = If I ruled the world it would be a better place.
Q60 = I can usually talk my way out of anything. 1 = I try to accept the consequences of my behavior.
Q70 = I prefer to blend in with the crowd. 1 = I like to be the center of attention.
Q80 = I will be a success. 1 = I am not too concerned about success.
Q90 = I am no better or worse than most people. 1 = I think I am a special person.
Q100 = I am not sure if I would make a good leader. 1 = I see myself as a good leader.
Q110 = I am assertive. 1 = I wish I were more assertive.
Q120 = I like to have authority over other people. 1 = I don't mind following orders.
Q130 = I find it easy to manipulate people. 1 = I don't like it when I find myself manipulating people.
Q140 = I insist upon getting the respect that is due me. 1 = I usually get the respect that I deserve.
Q150 = I don't particularly like to show off my body. 1 = I like to show off my body.
Q160 = I can read people like a book. 1 = People are sometimes hard to understand.
Q170 = If I feel competent I am willing to take responsibility for making decisions. 1 = I like to take responsibility for making decisions.
Q180 = I just want to be reasonably happy. 1 = I want to amount to something in the eyes of the world.
Q190 = My body is nothing special. 1 = I like to look at my body.
Q200 = I try not to be a show off. 1 = I will usually show off if I get the chance.
Q210 = I always know what I am doing. 1 = Sometimes I am not sure of what I am doing.
Q220 = I sometimes depend on people to get things done. 1 = I rarely depend on anyone else to get things done.
Q230 = Sometimes I tell good stories. 1 = Everybody likes to hear my stories.
Q240 = I expect a great deal from other people. 1 = I like to do things for other people.
Q250 = I will never be satisfied until I get all that I deserve. 1 = I take my satisfactions as they come.
Q260 = Compliments embarrass me. 1 = I like to be complimented.
Q270 = I have a strong will to power. 1 = Power for its own sake doesn't interest me.
Q280 = I don't care about new fads and fashions. 1 = I like to start new fads and fashions.
Q290 = I like to look at myself in the mirror. 1 = I am not particularly interested in looking at myself in the mirror.
Q300 = I really like to be the center of attention. 1 = It makes me uncomfortable to be the center of attention.
Q310 = I can live my life in any way I want to. 1 = People can't always live their lives in terms of what they want.
Q320 = Being an authority doesn't mean that much to me. 1 = People always seem to recognize my authority.
Q330 = I would prefer to be a leader. 1 = It makes little difference to me whether I am a leader or not.
Q340 = I am going to be a great person. 1 = I hope I am going to be successful.
Q350 = People sometimes believe what I tell them. 1 = I can make anybody believe anything I want them to.
Q360 = I am a born leader. 1 = Leadership is a quality that takes a long time to develop.
Q370 = I wish somebody would someday write my biography. 1 = I don't like people to pry into my life for any reason.
Q380 = I get upset when people don't notice how I look when I go out in public. 1 = I don't mind blending into the crowd when I go out in public.
Q390 = I am more capable than other people. 1 = There is a lot that I can learn from other people.
Q400 = I am much like everybody else. 1 = I am an extraordinary person.
Details
Item responses are paired. Respondents had to choose the one that fit them the best.
References
Raskin, Robert and Howard Terry. 1988. "A Principal-Components Analysis of the Narcissistic Personality Inventory and Further Evidence of Its Construct Validity." Journal of Personality and Social Psychology 54(5):890-902.
Open Source Psychometrics Project. https://openpsychometrics.org/_rawdata/
Narcissistic personality inventory question items
Description
A list where each element is a length three vector containin the text of the the question item and the two response options.
Usage
data(npi_battery)
Format
An object of class list of length 40.
References
Raskin, R., and H. Terry (1988), "A Principal-Components Analysis of the Narcissistic Personality Inventory and Further Evidence of Its Construct Validity," Journal of Personality and Social Psychology, 54, 890-902.
See Also
Examples
data(npi_battery)
# Item 1
npi_battery$Q1[1]
# Response options for item 1
npi_battery$Q1[2:3]
Narcissistic Personality Cat Object
Description
Cat object containing item parameters for latent trait model fit with responses to the 40 item Narcissistic Personality inventory
Usage
data(npi_cat)
Format
An object of class Cat of length 1.
Details
Cat object containing item parameters for latent trait model fit with 2945 response profiles collected by Qualtrics in June 2018 and 10440 response profiles collected by the Open Source Psychometrics Project in 2012.
See Cat-class for details regarding the Cat object structure.
See ltmCat for details regarding the latent trait model.
A normal prior was chosen with mean from the theta estimates from the Qualtrics sample (-.069) and a standard deviation (1) wide enough to envelope the range of estimated theta values across both samples.
Note that due to how the item parameters were estimated, large, positive values indicate "more" of the latent trait.
Item responses are paired. Respondents had to choose the one that fit them the best.
The wording of the item responses is:
Q1*0 = I am not good at influencing people. 1 = I have a natural talent for influencing people.
Q20 = Modesty doesn't become me. 1 = I am essentially a modest person.
Q30 = I would do almost anything on a dare. 1 = I tend to be a fairly cautious person.
Q40 = When people compliment me I sometimes get embarrassed. 1 = I know that I am good because everybody keeps telling me so.
Q50 = The thought of ruling the world frightens the hell out of me. 1 = If I ruled the world it would be a better place.
Q60 = I can usually talk my way out of anything. 1 = I try to accept the consequences of my behavior.
Q70 = I prefer to blend in with the crowd. 1 = I like to be the center of attention.
Q80 = I will be a success. 1 = I am not too concerned about success.
Q90 = I am no better or worse than most people. 1 = I think I am a special person.
Q100 = I am not sure if I would make a good leader. 1 = I see myself as a good leader.
Q110 = I am assertive. 1 = I wish I were more assertive.
Q120 = I like to have authority over other people. 1 = I don't mind following orders.
Q130 = I find it easy to manipulate people. 1 = I don't like it when I find myself manipulating people.
Q140 = I insist upon getting the respect that is due me. 1 = I usually get the respect that I deserve.
Q150 = I don't particularly like to show off my body. 1 = I like to show off my body.
Q160 = I can read people like a book. 1 = People are sometimes hard to understand.
Q170 = If I feel competent I am willing to take responsibility for making decisions. 1 = I like to take responsibility for making decisions.
Q180 = I just want to be reasonably happy. 1 = I want to amount to something in the eyes of the world.
Q190 = My body is nothing special. 1 = I like to look at my body.
Q200 = I try not to be a show off. 1 = I will usually show off if I get the chance.
Q210 = I always know what I am doing. 1 = Sometimes I am not sure of what I am doing.
Q220 = I sometimes depend on people to get things done. 1 = I rarely depend on anyone else to get things done.
Q230 = Sometimes I tell good stories. 1 = Everybody likes to hear my stories.
Q240 = I expect a great deal from other people. 1 = I like to do things for other people.
Q250 = I will never be satisfied until I get all that I deserve. 1 = I take my satisfactions as they come.
Q260 = Compliments embarrass me. 1 = I like to be complimented.
Q270 = I have a strong will to power. 1 = Power for its own sake doesn't interest me.
Q280 = I don't care about new fads and fashions. 1 = I like to start new fads and fashions.
Q290 = I like to look at myself in the mirror. 1 = I am not particularly interested in looking at myself in the mirror.
Q300 = I really like to be the center of attention. 1 = It makes me uncomfortable to be the center of attention.
Q310 = I can live my life in any way I want to. 1 = People can't always live their lives in terms of what they want.
Q320 = Being an authority doesn't mean that much to me. 1 = People always seem to recognize my authority.
Q330 = I would prefer to be a leader. 1 = It makes little difference to me whether I am a leader or not.
Q340 = I am going to be a great person. 1 = I hope I am going to be successful.
Q350 = People sometimes believe what I tell them. 1 = I can make anybody believe anything I want them to.
Q360 = I am a born leader. 1 = Leadership is a quality that takes a long time to develop.
Q370 = I wish somebody would someday write my biography. 1 = I don't like people to pry into my life for any reason.
Q380 = I get upset when people don't notice how I look when I go out in public. 1 = I don't mind blending into the crowd when I go out in public.
Q390 = I am more capable than other people. 1 = There is a lot that I can learn from other people.
Q400 = I am much like everybody else. 1 = I am an extraordinary person.
*Note that Item 1 is "reverse coded" from the coding that is typically used. This is because item parameter estimation constrains the first item's discrimination parameter to be positive. So the reverse coding was done for the more intuitive interpretation of item parameters and theta estimates as larger, positive values indicate "more" of the latent trait.
Source
See https://dataverse.harvard.edu/dataverse/pdsl for the raw YouGov and/or Qualtrics data.
See https://openpsychometrics.org/_rawdata/, maintained by Eric Jorgenson, for the raw Open Source Psychometrics Project data.
References
Raskin, R., and H. Terry (1988), "A Principal-Components Analysis of the Narcissistic Personality Inventory and Further Evidence of Its Construct Validity," Journal of Personality and Social Psychology, 54, 890-902.
Open Source Psychometrics Project. https://openpsychometrics.org/_rawdata/
See Also
Need to Evaluate
Description
4005 full response profiles to 16 Need to Evaluate inventory. Observations come from one of three administrations of the survey: The American Panel Survey, Amazon's Mechanical Turk in fall of 2014, or Amazon's Mechanical Turk in spring of 2015.
Usage
data(nte)
Format
An object of class data.frame with 4005 rows and 16 columns.
Details
See nte_cat for detailed information on question wordings and response options.
References
Jarvis, W. Blair G., and Richard E. Petty. "The need to evaluate." Journal of personality and social psychology 70.1 (1996): 172.
See Also
Need to Evaluate Cat Object
Description
Cat object containing item parameters for graded response model fit with responses to the 16 item Need to Evaluate inventory
Usage
data(nte_cat)
Format
An object of class Cat of length 1.
Details
Cat object containing item parameters for graded response model fit with 2534 response profiles from MTurk, 4993 response profiles collected by Qualtrics in June 2018, and 1512 response profiles from The American Panel Survey (TAPS) in December 2014. TAPS is a monthly online panel survey of about 2,000 adults in the United States. The panel was recruited in the fall of 2011 using an address-based sampling frame. TAPS surveys are administered online. Selected panelists who do not have a computer or online service are provided a computer and internet access by TAPS.
See Cat-class for details regarding the Cat object structure.
See grmCat for details regarding the graded response model.
A normal prior was chosen with mean from the theta estimates from the TAPS sample (.002) and a standard deviation (1.3) wide enough to envelope the range of estimated theta values across both samples.
Note that due to how the item parameters were estimated, large, positive values indicate "more" of the latent trait.
Response options are:
5 = Extremely characteristic of me, 4 = Somewhat characteristic of me, 3 = Uncertain, 2 = Somewhat uncharacteristic of me, 1 = Extremely uncharacteristic of me
The wording of the question items is:
q1I form opinions about everything.
q2I prefer to avoid taking extreme positions.
q3It is very important to me to hold strong opinions.
q4I want to know exactly what is good and bad about everything.
q5I often prefer to remain neutral about complex issues.
q6If something does not affect me, I do not usually determine if it is good or bad.
q7I enjoy strongly liking and disliking things.
q8There are many things for which I do not have a preference.
q9It bothers me to remain neutral.
q10I like to have strong opinions even when I am not personally involved.
q11I have many more opinions than the average person.
q12I would rather have a strong opinion than no opinion at all.
q13I pay a lot of attention to whether things are good or bad.
q14I only form strong opinions when I have to.
q15I like to decide that new things are really good or really bad.
q16I am pretty much indifferent to many important issues.
Source
See https://dataverse.harvard.edu/dataverse/pdsl for the raw YouGov and/or Qualtrics data.
See https://wc.wustl.edu for raw TAPS data.
References
Jarvis, W. Blair G., and Richard E. Petty. "The need to evaluate." Journal of personality and social psychology 70.1 (1996): 172.
See Also
Observed Information
Description
Calculates the observed information of the likelihood of a respondent's ability \theta for a given item.
Usage
obsInf(catObj, theta, item)
Arguments
catObj |
An object of class |
theta |
A numeric or an integer indicating the value for |
item |
An integer indicating the index of the question item |
Details
The observed information is equivalent to the negative second derivative of the log-likelihood evaluated at \theta.
This function should never be called when the respondent has answered no questions as the likelihood is not defined.
Value
The function obsInf returns a numeric value of the observed information of the likelihood, given \theta, for a given question item.
Note
This function is to allow users to access the internal functions of the package. During item selection, all calculations are done in compiled C++ code.
Author(s)
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil
See Also
Examples
## Loading ltm Cat object
data(ltm_cat)
## Store example answers
setAnswers(ltm_cat) <- c(1,0,1,0,1, rep(NA, 35))
## Calculate observed information for different ability parameters and items
obsInf(ltm_cat, theta = 1, item = 10)
obsInf(ltm_cat, theta = 1, item = 11)
obsInf(ltm_cat, theta = 0, item = 10)
obsInf(ltm_cat, theta = 0, item = 11)
Openness to Experience Cat Object
Description
Cat object containing item parameters for graded response model fit with responses to the 20-item Openness dimension of the 100-item IPIP representation of Costa and McCrae's Five Factor Model
Usage
data(open_cat)
Format
An object of class Cat of length 1.
Details
Cat object containing item parameters for graded response model fit with 774,410 response profiles by myPersonality Project and 1500 response profiles collected by YouGov in June 2018. The sample from myPersonality Project was a convenience sample, and the respondents from YouGov were matched to a sampling frame on gender, age, race, and education.
See Cat-class for details regarding the Cat object structure.
See grmCat for details regarding the graded response model.
A normal prior was chosen with mean from the theta estimates from the YouGov sample (-.674) and a standard deviation (1.2) wide enough to envelope the range of estimated theta values across both samples.
Note that due to how the item parameters were estimated, large, positive values indicate "more" of the latent trait.
Response options are 1=Very inaccurate; 2=Moderately inaccurate; 3=Neither inaccurate nor accurate; 4=Moderately accurate; 5=Very accurate.
The wording of the question items:
I...
q91Believe in the importance of art.
q1Have a vivid imagination.
q51Tend to vote for liberal political candidates.
q41Carry the conversation to a higher level.
q61Enjoy hearing new ideas.
q31Enjoy thinking about things.
q21Can say things beautifully.
q16Enjoy wild flights of fantasy.
q81Get excited by new ideas.
q71Have a rich vocabulary.
q24Am not interested in abstract ideas.
q74Do not like art.
q7Avoid philosophical discussions.
q34Do not enjoy going to art museums.
q44Tend to vote for conservative political candidates.
q4Do not like poetry.
q94Rarely look for a deeper meaning in things.
q84Believe that too much tax money goes to support artists.
q54Am not interested in theoretical discussions.
q64Have difficulty understanding abstract ideas.
Source
See https://dataverse.harvard.edu/dataverse/pdsl for the raw YouGov and/or Qualtrics data.
References
Costa, P. T., Jr., & McCrae, R. R. (1992). Revised NEO Personality Inventory (NEO PI-R) and NEO Five-Factor Inventory (NEO-FFI): Professional manual. Odessa, FL: Psychological Assessment Resources.
Stillwell, David, and Michal Kosinski. 2007. "myPersonality Project." https://sites.google.com/michalkosinski.com/mypersonality
See Also
Find Answer Profile that Minimizes Bias
Description
Generating all possible combinations of length n from a response profile to determine the possible response profile best able to estimate the true value of theta.
Usage
## S4 method for signature 'Cat'
oracle(catObj, theta, responses, approx = FALSE, parallel = FALSE)
Arguments
catObj |
An object of class |
theta |
A numeric representing the true position on the latent trait. |
responses |
A vector representing the respondent's full answer profile. |
approx |
If TRUE, uses a subset of 1000 potential response profiles |
parallel |
If TRUE, computes in parallel |
Details
lengthThreshold slot should specify how many questions to ask. Note this function uses the estimateTheta method specified in the supplied cat object
Value
A data.frame where the first column is the user-supplied true value of theta, the second column is the best possible theta estimate given n questions are asked, and the remaining columns are the answer profile leading to the best possible theta estimation.
Author(s)
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil
Plotting function for Cat object
Description
Function to plot item response functions, item characteristic functions, and item information functions for Cat objects.
Usage
## S4 method for signature 'Cat'
plot(x, item, plotType, xlim = c(-5, 5), ...)
Arguments
x |
Cat object. |
item |
Numeric. Item index. |
plotType |
Character. Either "IRF", "ICC", or "IIF" for item response functions, item characteristic functions, and item information functions, respectively. |
xlim |
Vector. Range of the x-axis. |
... |
Other arguments passed to plot(). |
MTurk Political Knowledge
Description
Data from Amazon Mechanical Turkers in 2012 responding to 64 political knowledge questions. Political knowledge questions had a varying number of response options, noted below. This dataset codes answers as either correct (a value of 0) or incorrect (a value of 1).
Usage
data(polknowMT)
Format
A data frame with 810 observations on the following 64 questions.
Q1How long is one term for the President of the United States?
Eight years; Six years; Four years; Two years
Q2The FDA is part of the national government primarily responsible for regulating
Food quality; The national parks; Electricity production and energy; Pollution and the environment
Q3Who is the Vice President of the United States?
Leon Panetta; William Daley; Hillary Clinton; Joe Biden
Q4The federal debt is
Much smaller than it was 20 years ago; The difference between imports and exports with foreign countries; The annual difference between spending and tax revenues; The accumulated borrowing of the federal government that has not been repaid
Q5How many times can an individual be elected President of the United States under current laws?
Any number of terms; Three times; Twice; Once
Q6What do we call the first ten amendments to the Constitution?
The Articles of Confederation; The inalienable right; The Bill of Rights; The Declaration of Independence
Q7Is the U.S. federal budget deficit, the amount by which the governments spending exceeds the amount of money it collects, now bigger, about the same, or smaller than it was during most of the 1990s?
Smaller; About the same; Bigger
Q8Who signs bills to become laws?
The President; The Vice President; The Chief Justice of the Supreme Court; The Secretary of State
Q9Which party is generally more supportive of creating a way for immigrants who are in the U.S. illegally to eventually become citizens?
The Republican Party; The Democratic Party
Q10In what month do we vote for the President?
November; October; February; January
Q11What are the two parts of the U.S. Congress?
The Senate and the Supreme Court; The House of Lords and the House of Commons; The House of Representative and the Supreme Court; The Senate and House of Representatives
Q12Which party is generally more supportive of restricting access to abortion?
The Republican Party; The Democratic Party
Q13Which of these political parties is considered most conservative?
Green Party; Republican Party; Democratic Party
Q14The NRA is an organization that advocates for
Clean elections; A cleaner environment; The rights of gun owners; Women's rights
Q15Compared to 30 years ago, is the difference in incomes between the top 20% of households and the bottom 20% of households now bigger, smaller, or the same?
The difference is now the same as 30 years ago; The difference is now smaller than 30 years ago; The difference is now bigger than 30 years ago
Q16The EPA is part of the national government primarily responsible for regulating
Food quality; The national parks; Electricity production and energy; Pollution and the environment
Q17Which party is generally more supportive of reducing the size of the defense budget?
The Republican Party; The Democratic Party
Q18Which party is generally more supportive of increasing taxes on higher income people to reduce the federal budget deficit?
The Republican Party; The Democratic Party
Q19Which party is generally more supportive of allowing drilling for oil in the Arctic National Wildlife Refuge?
The Republican Party; The Democratic Party
Q20Who is the Commander in Chief of the military?
The Attorney General; The President; The Secretary of Defense; The Vice President
Q21The First Amendment to the United States Constitution guarantees all of these rights EXCEPT
Right to remain silent; Right to the free exercise of religion; Right to free speech; Right to peaceably assemble
Q22Roe v Wade is a case decided by the Supreme Court that relates to
Executive power; Campaign finance; Birth control; Abortion
Q23Social Security is
Funded by the personal income tax; Operated by state government; The responsibility of the Department of Defense; The benefit program for senior citizens
Q24What is Medicare?
A private, non-profit organization that runs free health clinic; A private health insurance plan sold to individuals in all 50 states; A program run by state governments to provide health care to poor people; A program run by the U.S. federal government to pay for old people's health care
Q25How many senators are elected from each state?
It depends on the population of the state; Four; Two; One
Q26How many votes are required in Congress to override a presidential veto
A simple majority of both houses of Congress; A simple majority of one house of Congress; A two-thirds majority of both houses of Congress; A two-thirds majority of one house of Congress
Q27The Secretary of State
Serves a two-year term; Serves the state governments; Is nominated by the president; Heads the armed services
Q28Near the end of an election campaign, a polls shows that an issue that no candidate has mentioned is of great concern to voters. What is most likely to happen?
Some candidates will drop out of the race; Candidates will start talking about the issue; Newspapers will not report the results of the poll; The election will be postponed
Q29Liberals are generally said to
Support pro-life policies; Oppose all tax increases; Support military spending; Support government programs to give government assistance the needy
Q30Which party is generally more supportive of reducing the size and scope of the federal government?
The Republican Party; The Democratic Party
Q31The ability of a minority of senators to prevent a vote on a bill is known as Suspension of the rules; Enrollment; A veto; A filibuster
Q32conservatives are generally said to
Support pro-choice policies; Support tax cuts; Oppose military spending; Support government programs to give government assistance to the needy
Q33Which of these regions of the country is generally considered to be most supportive of Republican candidates
Midwest; South; West Coast; New England
Q34The presiding officer in the House of Representatives is
The Majority Leader; The Sergeant at Arms; The Vice President of the United States; The Speaker
Q35Which of these countries is NOT a permanent member of the U.N. Security Council
United Kingdom; France; India; China
Q36Which part has a majority of seats in the U.S. House of Representatives?
Neither; Democrats; Republicans
Q37What state holds the first primary election in Presidential primaries?
Florida; Nevada; South Carolina; New Hampshire
Q38Who is the Speaker of the House of Representatives?
Mitt Romney; Eric Holder; Harry Reid; John Boehner
Q39Most cases are considered by the Supreme Court
In even-numbered years; At the request of the Congress; Upon order of the president; With the approval of at least four justices
Q40How many Justices typically serve on the U.S. Supreme Court
Eleven; Nine; Eight; Seven
Q41What job or political office is no held by Ben Bernanke?
None of these; Minority Whip of the U.S. House; Chief Justice of the United States Supreme Court; Majority leader of the U.S. Senate, Chairman of the Federal Reserve
Q42Whose responsibility is it to nominate judges to the Federal Courts
The state governors; The Supreme Court; Congress; President
Q43Who is the Chief Justice of the U.S. Supreme Court?
Larry Thompson; Anthony Kennedy; David Cole; John Roberts
Q44The U.S. Senate
Votes to confirm nominees to the U.S. Supreme court chosen by the House of Representatives; Plays no role in choosing the members of the U.S. Supreme Court; Chooses members of the U.S. Supreme Court; Votes to confirm nominees to the U.S. Supreme Court chosen by the President
Q45Which party has a majority of seats in the U.S. Senate
Neither; Democrats; Republicans
Q46Which of the states listed below has the greatest number of electoral college votes in the U.S. Presidential Elections?
Puerto Rico; Nevada; North Dakota; Washington, D.C.
Q47Citizens United v the FEC is a case decided by the Supreme Court that relates to
Executive power; Campaign finance; Birth control; Abortion
Q48For how many years is a United States Senator elected that is, how many years are there in one full term of office for a U.S. Senator?
None of these; Eight years; Six years; Four years; Two years
Q49Who is the Prime Minister of the United Kingdom?
Richard Branson; Tony Hayward; Nick Clegg; David Cameron
Q50The president of Afghanistan is named
Bashar al-Assad; Hosni Mubarak; Hamid Karzai; Nouri al-Maliki
Q51The House of Representatives has how many voting members?
Four hundred and forty-one; Four hundred and thirty-five; Two hundred; One hundred
Q52The President of the Senate is
The Majority Leader; The Sergeant at Arms; The Vice President of the United States; The senior senator of the majority party
Q53On which of the following federal programs is the most money spent each year?
Medicare; Education; Subsidies to farmers; Aid to foreign countries
Q54What do all constitutional governments have?
Separation of church and state; A bill of rights; A President as the head of government; Limits on political power
Q55One which of the following does the U.S. federal government spend the least money?
Social Security; National defense; Medicare; Foreign aid
Q56The head of the Department of Justice is
Kathleen Sebelius; Eric Holder; Timothy Geithner; Hillary Clinton
Q57The president may NOT
Declare war; Pardon criminals without justification; Appoint federal officials when Congress is in recess; Refuse to sign legislation passed by Congress
Q58Which of these is NOT primarily the responsibility of the Federal government in Washington?
Interstate commerce; Negotiating treaties with foreign countries; Education; National defense
Q59Who is the current president of Mexico?
Vincente Fox; Hugo Chavez; Dilma Rousseff; Felipe Calderon
Q60Which of the following actions does the United States federal government commonly take to finance a budget deficit?
Expanding public-works projects; Borrowing from the public; Imposing import quotas; Printing more money
Q61Common Cause is an organization that advocates for
Women's rights; Clean elections; A cleaner environment; The right of gun owners
Q62The Byrd Rule is relevant
During the confirmation of cabinet members; For national party conventions; During Congressional debates over non-budgetary policies; For the Reconciliation process
Q63The Majority Leader of the House of Representative is
Nancy Pelosi; Kevin McCarthy; Eric Cantor; John Boehner
Q64On which of the following does the U.S. federal government spend the most money each year?
Education; Medicare; Interest on the national debt; National defense
Source
https://dataverse.harvard.edu/dataset.xhtml?persistentId=hdl:1902.1/19381
References
Jacob M. Montgomery and Joshua Cutler. 2013. "Computerized Adaptive Testing for Public Opinion Surveys." Political Analysis (Spring 2013) 21 (2): 172-192.
TAPS Political Knowledge (Ordered Response Options)
Description
Data of responses to a political knowledge battery from the May 2013 wave of The American Panel Survey (TAPS) out of Washington University in St. Louis.
Usage
data(polknowOrdered)
Format
A data frame with 1340 observations (only complete cases) of the following 10 questions.
Q1Members of the U.S. Supreme Court serve
3 = two-year terms. 4 = ten-year terms. 5 = life terms. 2 = terms determined by the president. 1 = Don't know.
Q2Who is the Chief Justice of the U.S. Supreme Court?
5 = John Roberts. 4 = Antonin Scalia. 3 = Mitt Romney. 2 = Hillary Clinton. 1 = Don't know.
Q3Social Security is
5 = the benefit program for senior citizens. 2 = the responsibility of the Department of Defense. 3 = operated by state governments. 4 = funded by the personal income tax. 1 = Don't know.
Q4On which of the following programs is the most money spent each year?
4 = aid to foreign countries. 5 = Medicare. 2 = subsidies to farmers. 3 = education. 1 = Don't know.
Q5Which party holds a majority of seats in the U.S. House of Representatives in Washington?
4 = Democrats. 3 = Republicans. 2 = Independents. 1 = Don't know.
Q6How many votes are required in Congress to override a presidential veto?
2 = a simple majority of one house of Congress. 3 = a simple majority of both houses of Congress. 4 = a two-thirds majority of one house of Congress. 5 = a two-thirds majority of both houses of Congress. 1 = Don't know.
Q7How long is one term for a member of the U.S. Senate?
3 = two years. 4 = four years. 5 = six years. 2 = eight years. 1 = Don't know.
Q8The ability of a minority of senators to prevent a vote on a bill is known as
4 = a veto. 5 = a filibuster. 3 = enrollment. 2 = suspension of the rules. 1 = Don't know.
Q9Who is the Vice President of the United States?
4 = Nancy Pelosi. 3 = John Boehner. 5 = Joseph Biden. 2 = Harry Reid. 1 = Don't know.
Q10A president may serve
3 = one term. 5 = two terms. 4 = three terms. 2 = any number of terms. 1 = Don't know.
Details
TAPS is a monthly online panel survey of about 2,000 adults in the United States. The panel was recruited in the fall of 2011 using an address-based sampling frame. TAPS surveys are administered online. Selected panelists who do not have a computer or online service are provided a computer and internet access by TAPS.
Source
TAPS Political Knowledge
Description
Data of responses to a political knowledge battery from the May 2013 wave of The American Panel Survey (TAPS) out of Washington University in St. Louis.
Usage
data(polknowTAPS)
Format
A data frame with 1496 observations on the following 10 questions.
Q1Members of the U.S. Supreme Court serve
1 = two-year terms. 2 = ten-year terms. 3 = life terms. 4 = terms determined by the president. 5 = Don't know.
Q2Who is the Chief Justice of the U.S. Supreme Court?
1 = John Roberts. 2 = Antonin Scalia. 3 = Mitt Romney. 4 = Hillary Clinton. 5 = Don't know.
Q3Social Security is
1 = the benefit program for senior citizens. 2 = the responsibility of the Department of Defense. 3 = operated by state governments. 4 = funded by the personal income tax. 5 = Don't know.
Q4On which of the following programs is the most money spent each year?
1 = aid to foreign countries. 2 = Medicare. 3 = subsidies to farmers. 4 = education. 5 = Don't know.
Q5Which party holds a majority of seats in the U.S. House of Representatives in Washington?
1 = Democrats. 2 = Republicans. 3 = Independents. 4 = Don't know.
Q6How many votes are required in Congress to override a presidential veto?
1 = a simple majority of one house of Congress. 2 = a simple majority of both houses of Congress. 3 = a two-thirds majority of one house of Congress. 4 = a two-thirds majority of both houses of Congress. 5 = Don't know.
Q7How long is one term for a member of the U.S. Senate?
1 = two years. 2 = four years. 3 = six years. 4 = eight years. 5 = Don't know.
Q8The ability of a minority of senators to prevent a vote on a bill is known as
1 = a veto. 2 = a filibuster. 3 = enrollment. 4 = suspension of the rules. 5 = Don't know.
Q9Who is the Vice President of the United States?
1 = Nancy Pelosi. 2 = John Boehner. 3 = Joseph Biden. 4 = Harry Reid. 5 = Don't know.
Q10A president may serve
1 = one term. 2 = two terms. 3 = three terms. 4 = any number of terms. 5 = Don't know.
Details
TAPS is a monthly online panel survey of about 2,000 adults in the United States. The panel was recruited in the fall of 2011 using an address-based sampling frame. TAPS surveys are administered online. Selected panelists who do not have a computer or online service are provided a computer and internet access by TAPS.
Source
Expected Kullback-Leibler Information, Weighted by the Prior
Description
Calculates the expected Kullback-Leibler information, weighted by likelihood and prior beliefs, for a specified item.
Usage
posteriorKL(catObj, item)
Arguments
catObj |
An object of class |
item |
An integer indicating the index of the question item |
Details
The function posteriorKL calculates the expected Kullback-Leibler information
for question item, where the proposed values of the true ability parameter are weighted by
the prior.
This function involves integration. See Note for more information.
Value
The function posteriorKL returns a numeric indicating the
expected Kullback-Leibler information weighted by the likelihood
for the specified item, given the current answer profile and ability parameter estimate.
Note
This function is to allow users to access the internal functions of the package. During item selection, all calculations are done in compiled C++ code.
This function uses adaptive quadrature methods from the GNU Scientific
Library (GSL) to approximate single-dimensional
integrals with high accuracy. The bounds of integration are determined by the
lowerBound and upperBound slots of the Cat object.
Author(s)
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil
See Also
expectedKL, likelihoodKL, selectItem
Examples
## Loading ltm Cat object
data(ltm_cat)
## Store example answers
setAnswers(ltm_cat) <- c(1,0,1,0,1, rep(NA, 35))
## Estimate EPV for different unasked items
posteriorKL(ltm_cat, item = 10)
posteriorKL(ltm_cat, item = 20)
posteriorKL(ltm_cat, item = 30)
Evaluate the Prior Density Distribution at Position theta
Description
Calculates the density at theta of either the normal, Student's t, or uniform distribution.
Usage
prior(catObj, theta)
Arguments
catObj |
An object of class |
theta |
A numeric value at which to evaluate the prior |
Details
The priorName slot of Cat object needs to be either "UNIFORM", "NORMAL", or "STUDENT_T".
When priorName slot is "NORMAL", the first element of priorParams slot is the mean,
the second element is the standard deviation.
When priorName slot is "STUDENT_T", the first
element of priorParams slot is the non-centrality parameters and the second is degrees of freedom.
When priorName slot is "UNIFORM", the elements of the priorParams slot are the lower and upper bounds,
of the interval, respectively. Note that the "UNIFORM" is only applicable for the expected a posteriori (EAP) estimation method.
Value
The function prior returns a numeric consisting of prior value, \pi(\theta), given the value \theta.
Note
This function is to allow users to access the internal functions of the package. During item selection, all calculations are done in compiled C++ code.
This function uses Boost C++ source libraries for the uniform and Student's t
distributions and calls dnorm4 written in C which is identical to that
of dnorm in R.
Author(s)
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil
See Also
Examples
## Loading ltm Cat object
data(ltm_cat)
## Prior calculation for different distributions
ltm_cat@priorName <- "NORMAL"
ltm_cat@priorParams <- c(0, 1) ## Parameters are mean and standard deviation
prior(ltm_cat, theta = 1)
ltm_cat@priorName <- "STUDENT_T"
ltm_cat@priorParams <- c(1, 3) ## Parameters are non-centrality param and degrees of freedom
prior(ltm_cat, theta = 1)
ltm_cat@priorName <- "UNIFORM"
ltm_cat@priorParams <- c(-1, 1) ## Parameters are lower bound and upper bound of interval
prior(ltm_cat, theta = 1)
Probability of Responses to a Question Item or the Left-Cumulative Probability of Responses
Description
Calculates the probability of specific responses or the left-cumulative probability of responses to item conditioned on a respondent's ability (\theta).
Usage
probability(catObj, theta, item)
Arguments
catObj |
An object of class |
theta |
A numeric or an integer indicating the value for |
item |
An integer indicating the index of the question item |
Details
For the ltm model, the probability of non-zero response for respondent j on item i is
Pr(y_{ij}=1|\theta_j)=\frac{\exp(a_i + b_i \theta_j)}{1+\exp(a_i + b_i \theta_j)}
where \theta_j is respondent j 's position on the latent scale of interest, a_i is item i 's discrimination parameter,
and b_i is item i 's difficulty parameter.
For the tpm model, the probability of non-zero response for respondent j on item i is
Pr(y_{ij}=1|\theta_j)=c_i+(1-c_i)\frac{\exp(a_i + b_i \theta_j)}{1+\exp(a_i + b_i \theta_j)}
where \theta_j is respondent j 's position on the latent scale of interest, a_i is item i 's discrimination parameter,
b_i is item i 's difficulty parameter, and c_i is item i 's guessing parameter.
For the grm model, the probability of a response in category k or lower for respondent j on item i is
Pr(y_{ij} < k|\theta_j)=\frac{\exp(\alpha_{ik} - \beta_i \theta_{ij})}{1+\exp(\alpha_{ik} - \beta_i \theta_{ij})}
where \theta_j is respondent j 's position on the latent scale of interest, \alpha_ik the k-th element of item i 's difficulty parameter,
\beta_i is discrimination parameter vector for item i. Notice the inequality on the left side and the absence of guessing parameters.
For the gpcm model, the probability of a response in category k for respondent j on item i is
Pr(y_{ij} = k|\theta_j)=\frac{\exp(\sum_{t=1}^k \alpha_{i} [\theta_j - (\beta_i - \tau_{it})])}
{\sum_{r=1}^{K_i}\exp(\sum_{t=1}^{r} \alpha_{i} [\theta_j - (\beta_i - \tau_{it}) )}
where \theta_j is respondent j 's position on the latent scale of interest, \alpha_i is the discrimination parameter for item i,
\beta_i is the difficulty parameter for item i, and \tau_{it} is the category t threshold parameter for item i, with k = 1,...,K_i response options
for item i. For identification purposes \tau_{i0} = 0 and \sum_{t=1}^1 \alpha_{i} [\theta_j - (\beta_i - \tau_{it})] = 0. Note that when fitting the model,
the \beta_i and \tau_{it} are not distinct, but rather, the difficulty parameters are \beta_{it} = \beta_{i} - \tau_{it}.
Value
When the model slot of the catObj is "ltm", the function probability returns a numeric vector of length one representing the probability of observing a non-zero response.
When the model slot of the catObj is "tpm", the function probability returns a numeric vector of length one representing the probability of observing a non-zero response.
When the model slot of the catObj is "grm", the function probability returns a numeric vector of length k+1, where k is the number of possible responses. The first element will always be zero and the (k+1)th element will always be one. The middle elements are the cumulative probability of observing response k or lower.
When the model slot of the catObj is "gpcm", the function probability returns a numeric vector of length k, where k is the number of possible responses. Each number represents the probability of observing response k.
Note
This function is to allow users to access the internal functions of the package. During item selection, all calculations are done in compiled C++ code.
Author(s)
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil
References
Baker, Frank B. and Seock-Ho Kim. 2004. Item Response Theory: Parameter Estimation Techniques. New York: Marcel Dekker.
Choi, Seung W. and Richard J. Swartz. 2009. “Comparison of CAT Item Selection Criteria for Polytomous Items." Applied Psychological Measurement 33(6):419-440.
Muraki, Eiji. 1992. “A generalized partial credit model: Application of an EM algorithm." ETS Research Report Series 1992(1):1-30.
van der Linden, Wim J. 1998. “Bayesian Item Selection Criteria for Adaptive Testing." Psychometrika 63(2):201-216.
See Also
Examples
## Loading ltm Cat object
## Probability for Cat object of the ltm model
data(ltm_cat)
probability(ltm_cat, theta = 1, item = 1)
## Loading tpm Cat object
## Probability for Cat object of the tpm model
probability(tpm_cat, theta = 1, item = 1)
## Loading grm Cat object
## Probability for Cat object of the grm model
probability(grm_cat, theta = 1, item = 1)
## Loading gpcm Cat object
## Probability for Cat object of the gpcm model
probability(gpcm_cat, theta = -3, item = 2)
Qualtrics AJAX Handler
Description
Qualtrics AJAX Handler used to implement catSurv functionality in a Qualtrics survey
Usage
## S4 method for signature 'character'
processAJAX(catObj, item)
Arguments
catObj |
An object of class |
item |
An integer indicating the index of the question item |
Details
This function is not intended for researcher use, rather it is a public facing function of the package because it is used by catSurv to integrate computerized adaptive testing into a Qualtrics survey.
Author(s)
Joshua Landman
Clean adaptive inventory responses from Qualtrics
Description
This function cleans the adaptive inventory responses stored as embedded data in Qualtrics
Usage
## S4 method for signature 'character'
readQualtrics(catObj, responseID)
Arguments
catObj |
Vector containing JSON character representations of the completed Cat objects from Qualtrics survey |
responseID |
Vector containing unique character identifiers for the respondents in the Qualtrics survey |
Details
This function cleans the adaptive inventory responses contained in the Qualtrics survey results. Because different respondents recieve different adaptive inventories, their answers to the battery are not stored as usual as separate columns in the Data & Analysis tab in the Qualtrics toolbar. Rather, the respondents' answers to the adaptive battery are saved in the catObj embedded data object. To access the answers, click "Export & Import", and then "Export Data." In the window that appears, we recommend downloading the data as a .csv file. Then, feed this function the catObj column and the responseID column.
Value
This function returns a data frame containing cleaned adaptive inventory responses.
Author(s)
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil
See Also
Cat-class, ex_qualtrics_results, ex_qualtrics_results_multiple
Examples
data(ex_qualtrics_results) # loads example results
cat_vect <- ex_qualtrics_results$catObj[-c(1,2)] # vector of Cat embedded data objects
ids <- ex_qualtrics_results$ResponseId[-c(1,2)] # vector of respondent identifiers
# clean answer profiles
clean_df <- readQualtrics(catObj = cat_vect, responseID = ids)
# estimate respondents' positions
setEstimation(agree_cat) <- "MAP"
estimateThetas(catObj = agree_cat, responses = clean_df)
Right Wing Authoritarianism Cat Object
Description
Cat object containing item parameters for graded response model fit with responses to the 20 item Right Wing Authoritarianism inventory
Usage
data(rwa_cat)
Format
An object of class Cat of length 1.
Details
Cat object containing item parameters for graded response model fit with 2056 response profiles from Lucid, 2519 response profiles from MTurk, and 1423 response profiles collected by YouGov in June 2018. The sample from MTurk was a convenience sample The respondents from YouGov were matched to a sampling frame on gender, age, race, and education.
See Cat-class for details regarding the Cat object structure.
See grmCat for details regarding the graded response model.
A normal prior was chosen with mean from the theta estimates from the YouGov sample (.241) and a standard deviation (1) wide enough to envelope the range of estimated theta values across both samples.
Note that due to how the item parameters were estimated, large, positive values indicate "more" of the latent trait.
Response options are:
5 = Strongly agree, 4 = Somewhat agree, 3 = Neither agree nor disagree, 2 = Somewhat disagree, 1 = Strongly disagree
The wording of the question items is:
q1Our country desperately needs a mighty leader who will do what has to be done to destroy the radical new ways and sinfulness that are ruining us.
q2Gays and lesbians are just as healthy and moral as anybody else.
q3It is always better to trust the judgment of the proper authorities in government and religion than to listen to the noisy rabble-rousers in our society who are trying to create doubt in people's minds.
q4Atheists and others who have rebelled against the established religions are no doubt every bit as good and virtuous as those who attend church regularly.
q5The only way our country can get through the crisis ahead is to get back to our traditional values, put some tough leaders in power, and silence the troublemakers spreading bad ideas.
q6There is absolutely nothing wrong with nudist camps.
q7Our country needs free thinkers who have the courage to defy traditional ways, even if this upsets many people.
q8Our country will be destroyed someday if we do not smash the perversions eating away at our moral fiber and traditional beliefs.
q9Everyone should have their own lifestyle, religious beliefs, and sexual preferences, even if it makes them different from everyone else.
q10The "old-fashioned ways" and the "old-fashioned values" still show the best way to live.
q11You have to admire those who challenged the law and the majority's view by protesting for women's abortion rights, for animal rights, or to abolish school prayer.
q12What our country really needs is a strong, determined leader who will crush evil, and take us back to our true path.
q13Some of the best people in our country are those who are challenging our government, criticizing religion, and ignoring the "normal way things are supposed to be done."
q14God's laws about abortion, pornography and marriage must be strictly followed before it is too late, and those who break them must be strongly punished.
q15There are many radical, immoral people in our country today, who are trying to ruin it for their own godless purposes, whom the authorities should put out of action.
q16A "woman's place" should be wherever she wants to be. The days when women are submissive to their husbands and social conventions belong strictly in the past.
q17Our country will be great if we honor the ways of our forefathers, do what the authorities tell us to do, and get rid of the "rotten apples" who are ruining everything.
q18There is no "ONE right way" to live life; everybody has to create their own way.
q19Homosexuals and feminists should be praised for being brave enough to defy "traditional family values."
q20This country would work a lot better if certain groups of troublemakers would just shut up and accept their group's traditional place in society.
Source
See https://dataverse.harvard.edu/dataverse/pdsl for the raw YouGov and/or Qualtrics data.
References
Altemeyer, Bob. Enemies of freedom: Understanding right-wing authoritarianism. Jossey-Bass, 1988.
See Also
Social Dominance Orientation Cat Object
Description
Cat object containing item parameters for graded response model fit with responses to the 15 item Social Dominance Orientation inventory
Usage
data(sdo_cat)
Format
An object of class Cat of length 1.
Details
Cat object containing item parameters for graded response model fit with 2042 response profiles from Lucid, 1192 response profiles from MTurk, and 1482 response profiles collected by YouGov in June 2018. The sample from MTurk was a convenience sample The respondents from YouGov were matched to a sampling frame on gender, age, race, and education.
See Cat-class for details regarding the Cat object structure.
See grmCat for details regarding the graded response model.
A normal prior was chosen with mean from the theta estimates from the YouGov sample (.19) and a standard deviation (1) wide enough to envelope the range of estimated theta values across both samples.
Note that due to how the item parameters were estimated, large, positive values indicate "more" of the latent trait.
Response options are:
5 = Strongly agree, 4 = Somewhat agree, 3 = Neither agree nor disagree, 2 = Somewhat disagree, 1 = Strongly disagree
The wording of the question items is:
q1Some groups of people are simply inferior to other groups.
q2In getting what you want, it is sometimes necessary to use force against other groups.
q3It's OK if some groups have more of a chance in life than others.
q4To get ahead in life, it is sometimes necessary to step on other groups.
q5If certain groups stayed in their place, we would have fewer problems.
q6It's probably a good thing that certain groups are at the top and other groups are at the bottom.
q7Inferior groups should stay in their place.
q8Sometimes other groups must be kept in their place.
q9It would be good if groups could be equal.
q10Group equality should be our ideal.
q11All groups should be given an equal chance in life.
q12We should do what we can to equalize conditions for different groups.
q13Increased social equality is beneficial to society.
q14We would have fewer problems if we treated people more equally.
q15We should strive to make incomes as equal as possible.
q16No group should dominate in society.
Source
See https://dataverse.harvard.edu/dataverse/pdsl for the raw YouGov and/or Qualtrics data.
References
Pratto, F., J. Sidanius, L. M. Stallworth, and B. F. Malle (1994), "Social Dominance Orientation: A Personality Variable Predicting Social and Political Attitudes," Journal of Personality and Social Psychology, 67, 741.
See Also
Select Next Item
Description
Selects the next item in the question set to be administered to respondent based on the specified selection method.
Usage
selectItem(catObj)
Arguments
catObj |
An object of class |
Details
Selection approach is specified in the selection slot of the Cat object.
The minimum expected posterior variance criterion is used when the selection
slot is "EPV". This method calls expectedPV for each unasked item.
The maximum Fisher's information criterion is used when the selection
slot is "MFI". This method calls fisherInf for each unasked item.
The maximum likelihood weighted information criterion is used when the selection
slot is "MLWI". Note that when no questions have been answered, likelihood evaluates to 1. This method involves integration. See Note for more information.
The maximum posterior weighted information criterion is used when the selection
slot is "MPWI". Note that when no questions have been answered, likelihood evaluates to 1. This method involves integration. See Note for more information.
The maximum expected information criterion is used when the selection
slot is "MEI". This method calls expectedObsInf for each unasked item. **Not implemented
for three parameter model for binary data.**
The maximum Kullback-Leibler information criterion is used when the selection
slot is "KL". This method calls expectedKL for each unasked item. See expectedKL for more information.
The maximum likelihood weighted Kullback-Leibler information criterion is used when the selection
slot is "LKL". This method calls likelihoodKL for each unasked item.
The maximum posterior weighted Kullback-Leibler information criterion is used when the selection
slot is "PKL". This method calls posteriorKL for each unasked item.
The maximum Fisher interval information criterion is used when the selection
slot is "MFII". This method involves integration. See Note for more information.
The bounds of integration are \hat{\theta} \pm \delta,
where \delta is qnorm(z) times the square root of the Fisher test information and
z is specified in the z slot of the Cat object.
A random number generator is used when the selection
slot is "RANDOM".
Value
The function selectItem returns a list with three elements:
estimates: a data frame with a row for each unasked question and three columns representing
the item index number, the item name, and the item value (calculated by the specified selection method),
and
next_item: a numeric representing the index of the item that should be asked next.
next_item_name: a string representing the unique identifier of the item that should be asked next.
Note
This function is to allow users to access the internal functions of the package. During item selection, all calculations are done in compiled C++ code.
This function uses adaptive quadrature methods from the GNU Scientific
Library (GSL) to approximate single-dimensional
integrals with high accuracy. The bounds of integration are determined by the
lowerBound and upperBound slots of the Cat object unless otherwise noted.
The "RANDOM" item selection criterion uses the package RcppArmadillo to randomly
choose the next item among unasked questions. RcppArmadillo provides an exact reproduction
of R's sample function that can be called from C++.
In the rare instance that item parameters are identical, it may be that that selectItem must choose
between two items with the same value calculated by the selection criterion. In such an instance, selectItem
will choose the item with the lower question index.
Author(s)
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil
References
van der Linden, Wim J. 1998. "Bayesian Item Selection Criteria for Adaptive Testing." Psychometrika 63(2):201-216.
Van der Linden, Wim J., and Peter J. Pashley. 2009. "Item Selection and Ability Estimation in Adaptive Testing." Elements of Adaptive Testing. Springer New York, 3-30.
Veldkamp, B.P., 2003. Item Selection in Polytomous CAT. In New Developments in Psychometrics (pp. 207-214). Springer Japan.
See Also
estimateTheta, expectedPV, fisherInf
Examples
## Loading ltm Cat object
data(ltm_cat)
## Store example answers
setAnswers(ltm_cat) <- c(1,0,1,0,1, rep(NA, 35))
## Set different selection criterion and choose next item
setSelection(ltm_cat) <- "EPV"
selectItem(ltm_cat)
setSelection(ltm_cat) <- "MFI"
selectItem(ltm_cat)
setSelection(ltm_cat) <- "MLWI"
selectItem(ltm_cat)
setSelection(ltm_cat) <- "MPWI"
selectItem(ltm_cat)
setSelection(ltm_cat) <- "MEI"
selectItem(ltm_cat)
setSelection(ltm_cat) <- "KL"
selectItem(ltm_cat)
setSelection(ltm_cat) <- "LKL"
selectItem(ltm_cat)
setSelection(ltm_cat) <- "PKL"
selectItem(ltm_cat)
setSelection(ltm_cat) <- "MFII"
selectItem(ltm_cat)
setSelection(ltm_cat) <- "RANDOM"
selectItem(ltm_cat)
Methods for Setting Value(s) to Cat Object Slots
Description
Setter methods to control changes to the slots of a Cat object.
Usage
## S4 replacement method for signature 'Cat'
setGuessing(catObj) <- value
## S4 replacement method for signature 'Cat'
setDiscrimination(catObj) <- value
## S4 replacement method for signature 'Cat'
setDifficulty(catObj) <- value
## S4 replacement method for signature 'Cat'
setAnswers(catObj) <- value
## S4 replacement method for signature 'Cat'
setIds(catObj) <- value
## S4 replacement method for signature 'Cat'
setModel(catObj) <- value
## S4 replacement method for signature 'Cat'
setPriorName(catObj) <- value
## S4 replacement method for signature 'Cat'
setPriorParams(catObj) <- value
## S4 replacement method for signature 'Cat'
setLowerBound(catObj) <- value
## S4 replacement method for signature 'Cat'
setUpperBound(catObj) <- value
## S4 replacement method for signature 'Cat'
setEstimation(catObj) <- value
## S4 replacement method for signature 'Cat'
setEstimationDefault(catObj) <- value
## S4 replacement method for signature 'Cat'
setSelection(catObj) <- value
## S4 replacement method for signature 'Cat'
setZ(catObj) <- value
## S4 replacement method for signature 'Cat'
setLengthThreshold(catObj) <- value
## S4 replacement method for signature 'Cat'
setSeThreshold(catObj) <- value
## S4 replacement method for signature 'Cat'
setGainThreshold(catObj) <- value
## S4 replacement method for signature 'Cat'
setInfoThreshold(catObj) <- value
## S4 replacement method for signature 'Cat'
setLengthOverride(catObj) <- value
## S4 replacement method for signature 'Cat'
setGainOverride(catObj) <- value
Arguments
catObj |
An object of class |
value |
The new value(s) |
Author(s)
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil
See Also
Examples
## Loading ltm Cat object
data(ltm_cat)
## Setting estimation slot
getEstimation(ltm_cat)
setEstimation(ltm_cat) <- "MAP"
getEstimation(ltm_cat)
## Setting distrimination slot
getDiscrimination(ltm_cat)
setDiscrimination(ltm_cat) <- rep(1, 40)
getDiscrimination(ltm_cat)
Calculates Fisher Information under different adaptive battery specifications
Description
Takes in a a Cat object, a set of respondents, and their corresponding theta values, and calculates the amount of information given an adaptive battery.
Usage
simulateFisherInfo(catObjs = list(), theta, responses)
Arguments
catObjs |
A list of |
theta |
A vector of numerics representing the true value of theta. |
responses |
A dataframe of answer profiles corresponding to the true values of theta. |
Details
The function takes a Cat object, theta, and response profiles.
The user defines the selection type, estimation type, etc. so that the questions can be applied adaptively
These adaptive profiles are then used to calculate the total inforamtion gained for a respondent for all answered
items, conditioned on theta.
Value
The function simulateFisherInfo returns a dataframe where each Cat object corresponds to a column and each respondent corresponds to a row.
Author(s)
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil, Jaerin Kim, Dominique Lockett
See Also
Cat-class, fisherTestInfo, selectItem
Examples
## Not run:
# Example takes > 2.5 min to run
# Load Cat object
data(grm_cat)
# Simulate respondents
respondents <- plyr::adply(.data = matrix(c(-1, 0, 1)),
.margins = 1,
.id = NULL,
.fun = simulateRespondents, cat = grm_cat, n = 10)
# A stopping rule (here, a common one) is required
grm_cat@lengthThreshold <- 3
# Specify different adaptive inventory procedures
grm_MAP <- grm_EAP <- grm_cat
grm_MAP@estimation <- "MAP"
grm_EAP@estimation <- "EAP"
# List of Cat objects
grmList <- list(grm_MAP, grm_EAP)
# Results
fisher_inf_results <- simulateFisherInfo(catObjs = grmList,
theta = rep(c(-1, 0, 1),
each = 10),
responses = respondents)
## End(Not run)
Simulate answer profiles given some true value of theta
Description
The function simulates n answer profiles given a true value of theta and a battery's item parameters stored in a Cat object.
Usage
## S4 method for signature 'Cat'
simulateRespondents(catObj, theta, n)
Arguments
catObj |
An object of class |
theta |
A numeric representing the true position on the latent trait. |
n |
A numeric indicating the number of answer profiles to simulate. |
Value
Function returns a dataframe where each row is a possible answer profile simulated given the provided value of theta
Author(s)
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil
Examples
# Load Cat object
data(grm_cat)
# Simulate 5 response profiles given a theta of 2
sim_resp <- simulateRespondents(catObj = grm_cat, theta = 2, n = 5)
Estimates theta under different adaptive battery specifications
Description
Takes in response profiles from multiple respondents and multiple Cat object (i.e., adaptive battery) specifications and returns a set of theta estimates
Usage
simulateThetas(catObjs = list(), responses, return_adaptive = FALSE)
Arguments
catObjs |
A list of |
responses |
A matrix of response profiles |
return_adaptive |
Boolean indicating if user wants dataframe containing only answers chosen via the adaptive design for each Cat object in catObjs list. |
Details
The function takes multiple Cat objects, stored in a list, and generates an estimation for theta.
Value
The function simulateThetas returns a dataframe where each Cat object corresponds to a column and each respondent
corresponds to a row if return_adaptive is FALSE, the default.
Optionally, simulateThetas returns a list containing that dataframe plus dataframes
for the answer profiles simulated via each adaptive design if return_adaptive is TRUE.
Author(s)
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil, Jaerin Kim, Dominique Lockett
See Also
Examples
## Not run:
# Example takes > 2.5 min to run
# Load Cat object
data(grm_cat)
# Simulate respondents
respondents <- plyr::adply(.data = matrix(c(-1, 0, 1)),
.margins = 1,
.id = NULL,
.fun = simulateRespondents, cat = grm_cat, n = 10)
# A stopping rule (here, a common one) is required
grm_cat@lengthThreshold <- 3
# Specify different adaptive inventory procedures
grm_MAP <- grm_EAP <- grm_cat
grm_MAP@estimation <- "MAP"
grm_EAP@estimation <- "EAP"
# List of Cat objects
grmList <- list(cat1 = grm_MAP, cat2 = grm_EAP)
# Results
theta_est_results <- simulateThetas(catObjs = grmList, responses = respondents)
## End(Not run)
Update Answer to Single Item
Description
Stores answer to item k to the Cat object's answers slot.
Usage
## S4 method for signature 'Cat'
storeAnswer(catObj, item, answer, returnJSON = FALSE)
## S4 method for signature 'character'
storeAnswer(catObj, item, answer, returnJSON = FALSE)
Arguments
catObj |
An object of class |
item |
An integer indicating the index of the question item |
answer |
The answer to the |
returnJSON |
Boolean indicating whether the updated |
Details
The function storeAnswer updates the Cat object, but the updated object must be assigned to an object for the changes to be stored. See Examples.
Value
The function storeAnswer returns an updated object of class Cat with the answers slot reflecting the newly stored answer to the indicated item. All previously stored answers remain the same, and all unanswered questions remain NA.
Author(s)
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil
Examples
## Loading ltm Cat object
data(ltm_cat)
## Printing current answers slot
getAnswers(ltm_cat)
## Storing answer of 0 to item 1
ltm_cat <- storeAnswer(ltm_cat, item = 1, answer = 0)
## Now object reflects answer to item 1
getAnswers(ltm_cat)
Conservation (Schwartz Values) Cat Object
Description
Cat object containing item parameters for graded response model fit with responses to the Conservation (Schwartz Values) inventory
Usage
data(sv_conservation_cat)
Format
An object of class Cat of length 1.
Details
Cat object containing item parameters for graded response model fit with 8,173 response profiles by the myPersonality Project and 718 response profiles collected by YouGov in June 2018. The sample from myPersonality Project was a convenience sample, and the respondents from YouGov were matched to a sampling frame on gender, age, race, and education.
See Cat-class for details regarding the Cat object structure.
See grmCat for details regarding the graded response model.
A normal prior was chosen with mean from the theta estimates from the YouGov sample (.480) and a standard deviation (1.4) wide enough to envelope the range of estimated theta values across both samples.
Note that due to how the item parameters were estimated, large, positive values indicate "more" of the latent trait.
Response options for the Schwartz Values survey are:
0 - means the value is not at all important, it is not relevant as a guiding principle for you. 3 - means the value is important. 6 - means the value is very important.
-1 is for rating any values opposed to the principles that guide you. 7 is for rating a value of supreme importance as a guiding principle in your life; ordinarily there are no more than two such values.
However, for computerized adaptive testing methods, the 0-7 response option range as been shifted to a 1-9 range.
The wording of the question items:
q11POLITENESS (courtesy, good manners)
q20SELF-DISCIPLINE (self-restraint, resistance to temptation)
q40HONORING OF PARENTS AND ELDERS (showing respect)
q47OBEDIENT (dutiful, meeting obligations)
q18RESPECT FOR TRADITION (preservation of time-honored customs)
q32MODERATE (avoiding extremes of feeling & action)
q36HUMBLE (modest, self-effacing)
q44ACCEPTING MY PORTION IN LIFE (submitting to life's circumstances)
q51DEVOUT (holding to religious faith & belief)
q8SOCIAL ORDER (stability of society)
q13NATIONAL SECURITY (protection of my nation from enemies)
q15RECIPROCATION OF FAVORS (avoidance of indebtedness)
q22FAMILY SECURITY (safety for loved ones)
q56CLEAN (neat, tidy)
Source
See https://dataverse.harvard.edu/dataverse/pdsl for the raw YouGov and/or Qualtrics data.
References
Stillwell, David, and Michal Kosinski. 2007. "myPersonality Project." https://sites.google.com/michalkosinski.com/mypersonality
Schwartz, Shalom H. "Universals in the content and structure of values: Theoretical advances and empirical tests in 20 countries." Advances in experimental social psychology. Vol. 25. Academic Press, 1992. 1-65.
See Also
Openness to Change (Schwartz Values) Cat Object
Description
Cat model created for the Openness to Change (Schwartz Values) inventory
Usage
data(sv_open_cat)
Format
An object of class Cat of length 1.
Details
Cat object containing item parameters for graded response model fit with 8,448 response profiles by myPersonality Project and 718 response profiles collected by YouGov in June 2018. The sample from myPersonality Project was a convenience sample, and the respondents from YouGov were matched to a sampling frame on gender, age, race, and education.
See Cat-class for details regarding the Cat object structure.
See grmCat for details regarding the graded response model.
A normal prior was chosen with mean from the theta estimates from the YouGov sample (-3.54) and a standard deviation (1.2) wide enough to envelope the range of estimated theta values across both samples.
Note that due to how the item parameters were estimated, large, positive values indicate "more" of the latent trait.
Response options for the Schwartz Values survey are:
0 - means the value is not at all important, it is not relevant as a guiding principle for you. 3 - means the value is important. 6 - means the value is very important.
-1 is for rating any values opposed to the principles that guide you. 7 is for rating a value of supreme importance as a guiding principle in your life; ordinarily there are no more than two such values.
However, for computerized adaptive testing methods, the 0-7 response option range as been shifted to a 1-9 range.
The wording of the question items:
q5FREEDOM (freedom of action and thought)
q15RECIPROCATION OF FAVORS (avoidance of indebtedness)
q31INDEPENDENT (self-reliant, self-sufficient)
q41CHOOSING OWN GOALS (selecting own purposes)
q53CURIOUS (interested in everything, exploring)
q9AN EXCITING LIFE (stimulating experiences)
q25A VARIED LIFE (filled with challenge, novelty and change)
q37DARING (seeking adventure, risk)
q4PLEASURE (gratification of desires)
q50ENJOYING LIFE (enjoying food, sex, leisure, etc.)
q57SELF-INDULGENT (doing pleasant things)
Source
See https://dataverse.harvard.edu/dataverse/pdsl for the raw YouGov and/or Qualtrics data.
References
Stillwell, David, and Michal Kosinski. 2007. "myPersonality Project." https://sites.google.com/michalkosinski.com/mypersonality
Schwartz, Shalom H. "Universals in the content and structure of values: Theoretical advances and empirical tests in 20 countries." Advances in experimental social psychology. Vol. 25. Academic Press, 1992. 1-65.
See Also
Self-Enhancement (Schwartz Values) Cat Object
Description
Cat object containing item parameters for graded response model fit with responses to the Self-Enhancement(Schwartz Values) inventory
Usage
data(sv_selfenhance_cat)
Format
An object of class Cat of length 1.
Details
Cat object containing item parameters for graded response model fit with 8,497 response profiles by myPersonality Project and 718 response profiles collected by YouGov in June 2018. The sample from myPersonality Project was a convenience sample, and the respondents from YouGov were matched to a sampling frame on gender, age, race, and education.
See Cat-class for details regarding the Cat object structure.
See grmCat for details regarding the graded response model.
A normal prior was chosen with mean from the theta estimates from the YouGov sample (-.09) and a standard deviation (1.2) wide enough to envelope the range of estimated theta values across both samples.
Note that due to how the item parameters were estimated, large, positive values indicate "more" of the latent trait.
Response options for the Schwartz Values survey are:
0 - means the value is not at all important, it is not relevant as a guiding principle for you. 3 - means the value is important. 6 - means the value is very important.
-1 is for rating any values opposed to the principles that guide you. 7 is for rating a value of supreme importance as a guiding principle in your life; ordinarily there are no more than two such values.
However, for computerized adaptive testing methods, the 0-7 response option range as been shifted to a 1-9 range.
The wording of the question items:
q4PLEASURE (gratification of desires)
q50ENJOYING LIFE (enjoying food, sex, leisure, etc.)
q57SELF-INDULGENT (doing pleasant things)
q34AMBITIOUS (hard-working, aspiring)
q39INFLUENTIAL (having an impact on people and events)
q43CAPABLE (competent, effective, efficient)
q55SUCCESSFUL (achieving goals)
q3SOCIAL POWER (control over others, dominance)
q12WEALTH (material possessions, money)
q27AUTHORITY (the right to lead or command)
q46PRESERVING MY PUBLIC IMAGE (protecting my "face")
Source
See https://dataverse.harvard.edu/dataverse/pdsl for the raw YouGov and/or Qualtrics data.
References
Stillwell, David, and Michal Kosinski. 2007. "myPersonality Project." https://sites.google.com/michalkosinski.com/mypersonality
Schwartz, Shalom H. "Universals in the content and structure of values: Theoretical advances and empirical tests in 20 countries." Advances in experimental social psychology. Vol. 25. Academic Press, 1992. 1-65.
See Also
Self-Transcendence (Schwartz Values) Cat Object
Description
Cat object containing item parameters for graded response model fit with responses to the Self-Transcendence (Schwartz Values) inventory
Usage
data(sv_selftransc_cat)
Format
An object of class Cat of length 1.
Details
Cat object containing item parameters for graded response model fit with 8,415 response profiles by myPersonalit Project and 718 response profiles collected by YouGov in June 2018. The sample from myPersonality Project was a convenience sample, and the respondents from YouGov were matched to a sampling frame on gender, age, race, and education.
See Cat-class for details regarding the Cat object structure.
See grmCat for details regarding the graded response model.
A normal prior was chosen with mean from the theta estimates from the YouGov sample (.004) and a standard deviation (1.2) wide enough to envelope the range of estimated theta values across both samples.
Note that due to how the item parameters were estimated, large, positive values indicate "more" of the latent trait.
Response options for the Schwartz Values survey are:
0 - means the value is not at all important, it is not relevant as a guiding principle for you. 3 - means the value is important. 6 - means the value is very important.
-1 is for rating any values opposed to the principles that guide you. 7 is for rating a value of supreme importance as a guiding principle in your life; ordinarily there are no more than two such values.
However, for computerized adaptive testing methods, the 0-7 response option range as been shifted to a 1-9 range.
The wording of the question items:
q1EQUALITY (equal opportunity for all)
q17A WORLD AT PEACE (free of war and conflict)
q24UNITY WITH NATURE (fitting into nature)
q26WISDOM (a mature understanding of life)
q29A WORLD OF BEAUTY (beauty of nature and the arts)
q30SOCIAL JUSTICE (correcting injustice, care for the weak)
q35BROADMINDED (tolerant of different ideas and beliefs)
q38PROTECTING THE ENVIRONMENT (preserving nature)
q33LOYAL (faithful to my friends, group)
q45HONEST (genuine, sincere)
q49HELPFUL (working for the welfare of others)
q52RESPONSIBLE (dependable, reliable)
q54FORGIVING (willing to pardon others)
Source
See https://dataverse.harvard.edu/dataverse/pdsl for the raw YouGov and/or Qualtrics data.
References
Stillwell, David, and Michal Kosinski. 2007. "myPersonality Project." https://sites.google.com/michalkosinski.com/mypersonality
Schwartz, Shalom H. "Universals in the content and structure of values: Theoretical advances and empirical tests in 20 countries." Advances in experimental social psychology. Vol. 25. Academic Press, 1992. 1-65.
See Also
Systemizing Quotient Cat Object
Description
Cat object containing item parameters for graded response model fit with responses to the 40-item Systemizing Quotient personality inventory
Usage
data(systemizing_cat)
Format
An object of class Cat of length 1.
Details
Cat object containing item parameters for graded response model fit with 13,256 response profiles collected by the Open Source Psychometrics Project in 2012, 3050 response profiles collected by Qualtrics in June 2018, and 1500 response profiles collected by YouGov in June 2018. The sample from the Open Source Psychometrics Project was a convenience sample, and the respondents from YouGov were matched to a sampling frame on gender, age, race, and education.
See Cat-class for details regarding the Cat object structure.
See grmCat for details regarding the graded response model.
A normal prior was chosen with mean from the theta estimates from the YouGov sample (.033) and a standard deviation (1.4) wide enough to envelope the range of estimated theta values across both samples.
Note that due to how the item parameters were estimated, large, positive values indicate "more" of the latent trait.
Response options are 1=Strongly disagree; 2=Slightly disagree; 3=Slightly agree; 4=Strongly agree
The wording of the question items:
q1When I listen to a piece of music, I always notice the way it's structured.
q4I prefer to read non-fiction than fiction.
q5If I were buying a car, I would want to obtain specific information about its engine capacity.
q6When I look at a painting, I do not usually think about the technique involved in making it.
q7If there was a problem with the electrical wiring in my home, I'd be able to fix it myself.
q11I rarely read articles or webpages about new technology.
q12I do not enjoy games that involve a high degree of strategy.
q13I am fascinated by how machines work.
q15In math, I am intrigued by the rules and patterns governing numbers.
q18I find it difficult to understand instruction manuals for putting appliances together.
q19When I look at an animal, I like to know the precise species it belongs to.
q20If I were buying a computer, I would want to know exact details about its hard drive capacity and processor speed.
q23When I cook, I do not think about exactly how different methods and ingredients contribute to the final product.
q24I find it difficult to read and understand maps.
q25If I had a collection (e.g. CDs, coins, stamps), it would be highly organized.
q26When I look at a piece of furniture, I do not notice the details of how it was constructed.
q28When I learn about historical events, I do not focus on exact dates.
q29When I read the newspaper, I am drawn to tables of information, such as football league scores or stock market indices.
q30When I learn a language, I become intrigued by its grammatical rules.
q31I find it difficult to learn my way around a new city.
q32I do not tend to watch science documentaries on television or read articles about science and nature.
q33If I were buying a stereo, I would want to know about its precise technical features.
q34I find it easy to grasp exactly how odds work in betting.
q35I am not very meticulous when I carry out D.I.Y.
q37When I look at a building, I am curious about the precise way it was constructed.
q38When an election is being held, I am not interested in the results for each constituency.
q40I find it difficult to understand information the bank sends me on different investment and saving systems.
q41When traveling by train, I often wonder exactly how the rail networks are coordinated.
q42When I buy a new appliance, I do not read the instruction manual very thoroughly.
q43If I were buying a camera, I would not look carefully into the quality of the lens.
q44When I read something, I always notice whether it is grammatically correct.
q45When I hear the weather forecast, I am not very interested in the meteorological patterns.
q48When I look at a mountain, I think about how precisely it was formed.
q49I can easily visualize how the highways in my region link up.
q51When I'm in a plane, I do not think about the aerodynamics.
q53When I am walking in the country, I am curious about how the various kinds of trees differ.
q55I am interested in knowing the path a river takes from its source to the sea.
q56I do not read legal documents very carefully.
q57I am not interested in understanding how wireless communication works.
q60I do not care to know the names of the plants I see.
Source
See https://dataverse.harvard.edu/dataverse/pdsl for the raw YouGov and/or Qualtrics data.
See https://openpsychometrics.org/_rawdata/, maintained by Eric Jorgenson, for the raw Open Source Psychometrics Project site data.
References
Baron-Cohen, Simon, Jennifer Richler, Dheraj Bisarya, Nhishanth Gurunathan, and Sally Wheelwright. "The systemizing quotient: an investigation of adults with Asperger syndrome or high-functioning autism, and normal sex differences." Philosophical Transactions of the Royal Society of London. Series B: Biological Sciences 358, no. 1430 (2003): 361-374.
Open Source Psychometrics Project. https://openpsychometrics.org/_rawdata/
See Also
Convert Cat object to JSON
Description
This function object of class Cat.
Usage
## S4 method for signature 'Cat'
toJSONCat(catObj)
Arguments
catObj |
A |
Value
The function toJSONCat returns a JSON object with list elements corresponding to information stored in the catObj.
See Cat-class for required Cat object slots.
Author(s)
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil
See Also
Computerized Adaptive Testing Birnbaum's Three Parameter Model
Description
This function fits Birnbaum's three parameter model for binary data and populates the fitted values for discrimination, difficulty, and guessing parameters to an object of class Cat.
Usage
## S4 method for signature 'data.frame'
tpmCat(data, quadraturePoints = 21, ...)
## S4 method for signature 'tpm'
tpmCat(data, quadraturePoints = NULL, ...)
Arguments
data |
A data frame of manifest variables or an object of class |
quadraturePoints |
A numeric to be passed into the |
... |
arguments to be passed to methods. For more details about the arguments, see |
Details
The data argument of the function tpmCat is either a data frame or an object of class tpm 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 tpm, it is output from the tpm function in the ltm package.
The quadraturePoints argument of the function tpmCat is used only when the data argument is a data frame. quadraturePoints is then passed to the tpm function from the ltm package when fitting Birnbaum's three parameter model to the data and is used when approximating the value of integrals.
Value
The function tpmCat returns an object of class Cat with changes to the following slots:
-
difficultyA vector consisting of difficulty parameters for each item. -
discriminationA vector consisting of discrimination parameters for each item. -
modelThe string"tpm", indicating thisCatobject corresponds to Birnbaum's three parameter model.
See Cat-class for default values of Cat object slots. See Examples and setters for example code to change slot values.
Note
In case the Hessian matrix at convergence is not positive definite try to use start.val = "random".
Author(s)
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil
References
Baker, Frank B. and Seock-Ho Kim. 2004. Item Response Theory: Parameter Estimation Techniques. New York: Marcel Dekker.
Birnbaum, Allan. 1968. Some Latent Trait Models and their Use in Inferring an Examinee's Ability. In F. M. Lord and M. R. Novick (Eds.), Statistical Theories of Mental Test Scores, 397-479. Reading, MA: Addison-Wesley.
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, ltmCat, polknowMT, probability
Examples
## Creating Cat objects from large datasets is computationally expensive
## Load the Cat object created from the above code
data(tpm_cat)
## Slots that have changed from default values
getModel(tpm_cat)
getDifficulty(tpm_cat)
getDiscrimination(tpm_cat)
## Changing slots from default values
setEstimation(tpm_cat) <- "MLE"
setSelection(tpm_cat) <- "MFI"
tpm Cat Object
Description
An object of class Cat created using the tpmCat function with the first twenty questions of the polknowMT dataset.
Usage
data(tpm_cat)
Format
An object of class Cat. See Cat-class for more details.
See Also
Examples
## Not run:
## How this Cat object was created
data(polknowMT)
tpm_cat <- tpmCat(polknowMT[,1:20], quadraturePoints = 100, start.val = "random")
## End(Not run)
## How to load this Cat object for usage
data(tpm_cat)