Skip to content

Commit fa2be59

Browse files
committed
add option
1 parent 70b0f2d commit fa2be59

File tree

5 files changed

+21
-4
lines changed

5 files changed

+21
-4
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: mirt
2-
Version: 1.44.5
2+
Version: 1.44.6
33
Type: Package
44
Title: Multidimensional Item Response Theory
55
Authors@R: c( person("Phil", family="Chalmers", email =

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changes in mirt 1.45
22

3+
- Added argument `fscores(..., expected.info = FALSE)` to allow computation of the
4+
expected vs observed information
5+
36
- Fixed extraction bug in `randef()` when `lr.random` structures were used
47

58
- `extract.item()` and `extract.group()` now support objects

R/fscores.R

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@
6767
#' \item \code{"classify"} for the posteriori classification probabilities (only
6868
#' applicable when the input model was of class \code{MixtureClass})
6969
#' }
70+
#' @param expected.info logical; instead of using the observed information when
71+
#' \code{method = 'ML'} or \code{method = 'WLE'} use the expected information computed via
72+
#' \code{\link{testinfo}}? Only currently supported for unidimensional models
7073
#' @param quadpts number of quadrature to use per dimension. If not specified, a suitable
7174
#' one will be created which decreases as the number of dimensions increases
7275
#' (and therefore for estimates such as EAP, will be less accurate). This is determined from
@@ -280,9 +283,13 @@ fscores <- function(object, method = "EAP", full.scores = TRUE, rotate = 'oblimi
280283
return.acov = FALSE, mean = NULL, cov = NULL, covdata = NULL,
281284
verbose = TRUE, full.scores.SE = FALSE, theta_lim = c(-6,6), MI = 0,
282285
use_dentype_estimate=FALSE, QMC = FALSE, custom_den = NULL,
283-
custom_theta = NULL, min_expected = 1, max_theta = 20, start = NULL, ...)
286+
custom_theta = NULL, expected.info=FALSE,
287+
min_expected = 1, max_theta = 20, start = NULL, ...)
284288
{
285289
if(method == 'WML') method <- 'WLE'
290+
if(expected.info)
291+
stopifnot("expected.info only currently supported unidimensional models"=
292+
extract.mirt(object, 'nfact') == 1)
286293
if(!is(object, 'DiscreteClass')){
287294
if(QMC && is.null(quadpts)) quadpts <- 5000
288295
if(is.null(quadpts))
@@ -333,7 +340,7 @@ fscores <- function(object, method = "EAP", full.scores = TRUE, rotate = 'oblimi
333340
plausible.draws = plausible.draws, custom_den=custom_den,
334341
custom_theta=custom_theta, Target=Target, min_expected=min_expected,
335342
plausible.type=plausible.type, max_theta=max_theta, start=start,
336-
use_dentype_estimate=use_dentype_estimate,
343+
use_dentype_estimate=use_dentype_estimate, expected.info=expected.info,
337344
append_response.pattern=append_response.pattern, ...)
338345
ret
339346
}

R/fscores.internal.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ setMethod(
1010
plausible.draws, full.scores.SE, return.acov = FALSE,
1111
QMC, custom_den = NULL, custom_theta = NULL,
1212
min_expected, plausible.type, start, EAPsum.scores,
13-
use_dentype_estimate, leave_missing = FALSE, ...)
13+
use_dentype_estimate, leave_missing = FALSE, expected.info, ...)
1414
{
1515
den_fun <- mirt_dmvnorm
1616
item_weights_long <- rep(item_weights, extract.mirt(object, "K"))
@@ -391,6 +391,8 @@ setMethod(
391391
if(any(is.na(scores) & !is.nan(scores)))
392392
warning('NAs returned for response patterns with no data. Consider removing',
393393
call.=FALSE)
394+
if(expected.info)
395+
SEscores[is.finite(scores)] <- 1/sqrt(testinfo(object, scores[is.finite(scores)]))
394396
if (full.scores){
395397
if(USETABDATA){
396398
tabdata2 <- object@Data$tabdata[keep, , drop=FALSE]

man/fscores.Rd

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)