View source: R/generate_item_parameters.R
generate_intercepts | R Documentation |
Function generates a matrix of items' intercept (thresholds/difficulties) parameters.
generate_intercepts(
nItems,
scoringMatrix,
FUNd,
argsd = NULL,
FUNt = NULL,
argst = NULL
)
nItems |
the number of items for which intercepts will be generated |
scoringMatrix |
a scoring matrix that will be used for the
generated items, specifically generated with
|
FUNd |
a function that will be used to generate item difficulties,h
typically |
argsd |
a list of arguments to be passed to |
FUNt |
optionally a function that will be used to generate item
thresholds (i.e. difficulties of categories relative to difficulty of the
whole item), assuming gpcm item responding process;
typically |
argst |
optionally a list of arguments to be passed to |
Assuming irtree response process:
Assuming irtree response process test item must be characterized by a set of intercept parameters describing individual thresholds of binary pseudo-items modeling consecutive decisions in the assumed sequence of responding process. In such a case:
argument FUNd
provides a function that will be used to
generate thresholds for each of the pseudo-items
;
argument argsd
provides arguments that will be passed to the
function provided by FUNd
; elements of this list should rather
be named; each element of the list should be a vector (typically
a numeric one, but can be also a list of matrices) with only one
element or as many elements, as the number of columns in the
scoringMatrix
- in this latter case consecutive elements of
(each) vector will be passed to separate calls of the FUNd
generating thresholds for respective pseudo-items across all
the items;
arguments FUNt
and argst
are not used.
Assuming GPCM response process:
Assuming GPCM response process test item must be characterized
by a set of intercept parameters describing relative frequency of
specific categories of the response scale. However, it is convenient to
define model parameters in another parameterisation, in which item
thresholds describe difficulty of switching between consecutive
categories of the response scale, and only then transform these
thresholds to intercepts. Function follows this approach and:
1) first generates general difficulties of the whole items, then
2) for each item generates values of thresholds relatively to the item
difficulty
, imposing identifiability assumption that these values must
sum up to 0, and finally 3) computes intercepts given values of parameters
generated in the previous steps. Consequently in such a case:
argument FUNd
provides a function that will be used to
generate general difficulties
of items;
argument argsd
provides arguments that will be passed to the
function provided by FUNd
; elements of this list should rather
be named; each element of the list should be a vector of length of
one;
argument FUNt
provides a function that will be used to
generate values of thresholds - generated values will be then sorted
(descending - due to the parameterization that is used within
generate_test_responses
) and centered - consequently it
is assumed that they are interpreted relatively to the general item
difficulty;
argument argst
provides arguments that should be passed to the
function provided by FUNt
; elements of this list should rather
be named; each element of the list should be a vector of length of
one or of the length of nItems
; in this latter case
consecutive elements of (each) vector will be passed to separate
calls of the FUNt
generating thresholds for consecutive items;
Returned intercepts are computed by summing general item difficulty and values of the relative thresholds generated for a given item and then computing cumulative sum of this vector.
A matrix of nItems
rows and number of columns equal to the
number of intercepts. Be aware that these are intercepts and
not thresholds what are returned (and intercept for a category
g is a sum of thresholds from the first category up to the
category g minus minus item difficulty).
generate_slopes
, make_test
,
thresholds2intercepts
, intercepts2thresholds
# 5 items with 5-point response scale assuming IRTree item response
# process with "pseudo-items" intercepts sampled from a uniform distribution
# with limits +-1.5
sM <- make_scoring_matrix_aem(5, sequence = "mae")
generate_intercepts(5, sM, runif, list(min = -1.5, max = 1.5))
# 10 items with 5-point response scale assuming IRTree item response
# process with "pseudo-items" intercepts sampled from a normal distribution
# with the mean of 0 and the standard deviation of 1.5
sM <- make_scoring_matrix_aem(5, sequence = "mae")
generate_intercepts(5, sM, rnorm, list(mean = 0, sd = 1))
# 10 items with 5-point response scale assuming IRTree item response
# process with "pseudo-items" intercepts sampled from a uniform distribution
# with limits set to:
# trait 'm' (i.e. the first column in the scoring matrix): from -3 to -1
# trait 'a' (i.e. the second column in the scoring matrix): from -1 to 1
# trait 'e' (i.e. the third column in the scoring matrix): from 1 to 3
sM <- make_scoring_matrix_aem(5, sequence = "mae")
generate_intercepts(10, sM, runif,
list(min = c(-3, -1, 1),
max = c(-1, 1, 3)))
# 10 items with 6-point response scale assuming GPCM item response
# process with items difficulties sampled from a normal distribution with
# the mean of 0 and the standard deviation of 1.5 and thresholds relative
# to the items difficulties sampled from a uniform distribution with
# the limits of +-2
sM <- make_scoring_matrix_aem(6, sequence = "gpcm")
generate_intercepts(10, sM,
FUNd = rnorm, argsd = list(mean = 0, sd = 1.5),
FUNt = runif, argst = list(min = -2, max = 2))
# 5 items with 6-point response scale assuming GPCM item response
# process with items difficulties sampled from a uniform distribution with
# the limits of +-2 and thresholds relative to the items difficulties sampled
# from a normal distribution with the mean of 0 and the standard deviation
# defined individually for each item
# the limits of +-2
sM <- make_scoring_matrix_aem(6, sequence = "gpcm")
generate_intercepts(5, sM,
FUNd = runif, argsd = list(min = -2, max = 2),
FUNt = rnorm, argst = list(mean = 0,
sd = c(1, 1.2, 1.4, 1.6, 1.9)))
# 20 items with 5-point response scale assuming GPCM item response
# process with items difficulties sampled from a uniform distribution with
# the limits of +-2 and thresholds relative to the items difficulties
# generated deterministically as a sequence of 4 regularly spaced values
# from 0.9 to -0.9
sM <- make_scoring_matrix_aem(5, sequence = "gpcm")
generate_intercepts(20, sM,
FUNd = runif, argsd = list(min = -2, max = 2),
FUNt = seq, argst = list(from = 0.9,
to = -0.9,
length.out = 4))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.