Q.generate: Generation of dichotomous Q-matrix

View source: R/Q.generate.R

Q.generateR Documentation

Generation of dichotomous Q-matrix

Description

The function generates a complete Q-matrix based on a pre-specified probability that each q-entry equals 1.

Usage

Q.generate(K, J, p, single.att = TRUE)

Arguments

K

The number of attributes.

J

The number of items.

p

The probability that each q-entry equals 1.

single.att

Whether all the single-attribute patterns are included. If TRUE, the completeness of the Q-matrix is guaranteed.

Value

The function returns a dichotomous Q-matrix. A complete Q-matrix is the default unless single.att = F is specified.

See Also

Q.completeness

Examples

## Not run: 
# Example 1: A complete Q-matrix with items requiring fewer attributes.
Q1 = Q.generate(3, 20, 0.5, single.att = TRUE)

# Example 2: A Q-matrix with items requiring more attributes but completeness is not guaranteed.
Q2 = Q.generate(5, 30, 0.6, single.att = FALSE)

## End(Not run)

NPCDTools documentation built on Sept. 1, 2026, 1:08 a.m.