Learn R Programming

catSurv (version 1.5.0)

lookAhead: 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)

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.

Arguments

catObj

An object of class Cat

item

A numeric indicating the question item the respondent is currently answering.

Author

Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil

See Also

selectItem

Examples

Run this code
## 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)


Run the code above in your browser using DataLab