thresholds_and_intercepts: Conversion between thresholds and intercepts parametrizations

thresholds_and_interceptsR Documentation

Conversion between thresholds and intercepts parametrizations

Description

Utility functions allowing to covert thresholds (i.e. parameterization convenient to think of item steps difficulty) to intercepts (i.e. parameterization used internally by packages rstyles and mirt) or back forth.

Usage

thresholds2intercepts(thresholds)

## S3 method for class 'data.frame'
thresholds2intercepts(thresholds)

## S3 method for class 'matrix'
thresholds2intercepts(thresholds)

## Default S3 method:
thresholds2intercepts(thresholds)

intercepts2thresholds(intercepts)

## S3 method for class 'data.frame'
intercepts2thresholds(intercepts)

## S3 method for class 'matrix'
intercepts2thresholds(intercepts)

## Default S3 method:
intercepts2thresholds(intercepts)

Arguments

thresholds

a vector or matrix (thresholds in cols, items in rows) of item thresholds

intercepts

a vector or matrix (intercepts in cols, items in rows) of item intercepts

Details

Please note, that intercepts typically are computed by transforming sums of item location parameters (difficulties) and thresholds defined relatively to the item location. Consequently, thresholds returned from such intercepts by the intercepts2thresholds will already include item location. To get thresholds relative to item location one must subtract this values from their mean.

Value

a vector or matrix of thresholds or intercepts

See Also

generate_intercepts

Examples

# 5 items with (general) difficulty evenly spanned between -2 and 2
# and for each item thresholds eveny spanned betwenn -1.5 and 1.5 relatively
# to item difficulty
thresholds <- matrix(rep(seq(-2, 2, by = 1), 4) +
                     rep(seq(-1.5, 1.5, by = 0.75), each = 4),
                     ncol = 4)
(intercepts <- thresholds2intercepts(thresholds))
intercepts2thresholds(intercepts)
# works also for vectors
thresholds2intercepts(thresholds[1, ])
intercepts2thresholds(intercepts[1, ])

tzoltak/rstyles documentation built on Dec. 4, 2024, 5:16 p.m.