thresholds_and_intercepts | R Documentation |
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.
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)
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 |
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.
a vector or matrix of thresholds or intercepts
generate_intercepts
# 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, ])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.