Skip to content

Commit d46cc8d

Browse files
committed
Add try around DIF table
1 parent 5ed6d5f commit d46cc8d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

R/itemresponsetheorycommon.R

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -985,8 +985,14 @@
985985
tb$setError(gettext("DIf-analysis not possible: Select at least one parameter to test."))
986986
return()
987987
}
988-
fit <- mirt::multipleGroup(data = state[["items"]], model = 1, itemtype = options[["model"]], group = dataset[[options[["groupingVariable"]]]], SE = FALSE, verbose = FALSE, TOL = options[["emTolerance"]], technical = list(NCYCLES = options[["emIterations"]], set.seed = options[["seed"]]))
989-
dif <- mirt::DIF(fit, which.par = parameters)
988+
result <- try{(
989+
fit <- mirt::multipleGroup(data = state[["items"]], model = 1, itemtype = options[["model"]], group = dataset[[options[["groupingVariable"]]]], SE = FALSE, verbose = FALSE, TOL = options[["emTolerance"]], technical = list(NCYCLES = options[["emIterations"]], set.seed = options[["seed"]]))
990+
dif <- mirt::DIF(fit, which.par = parameters)
991+
)}
992+
if (jaspBase:::isTryError(result)) {
993+
tb$setError(jaspBase:::.extractErrorMessage(result))
994+
return()
995+
}
990996
tb[["item"]] <- options[["items"]]
991997
tb[["aic"]] <- dif[["AIC"]]
992998
tb[["sabic"]] <- dif[["SABIC"]]

0 commit comments

Comments
 (0)