Learn R Programming

ltbayes (version 0.3)

patterns: Response Patterns for Given Total Score(s)

Description

patterns determines the response patterns that yield one or one of several total scores.

Usage

patterns(m, r, total)

Arguments

m
Number of items.
r
Number of response categories.
total
Vector of total score or scores. Note that item responses are assumed to be integer-valued from 0 to r-1, so total scores should be between 0 and m(r-1).

Value

y
Matrix of size s by m of the s response patterns that would yield (one of) the total score(s) in total.

Details

This is essentially a utility function to be used to prepare input for postsamp, postmode, posttrace, profileci, or information.

See Also

postsamp, postmode, posttrace, profileci, information

Examples

Run this code
# response patterns for five binary items that
# yield a total score of 3

y <- patterns(5, 2, 3)

# response patterns for 3 5-category items that
# yield a total score of at least 3

y <- patterns(3, 5, c(3:12))

Run the code above in your browser using DataLab