From cae30f1b3e025c0e845f6648e603a1a7d43a4c4c Mon Sep 17 00:00:00 2001 From: philchalmers Date: Sat, 9 Nov 2024 23:31:29 -0500 Subject: [PATCH] fix poly cases --- R/M2.R | 1 + 1 file changed, 1 insertion(+) diff --git a/R/M2.R b/R/M2.R index 4e01a333..fe83ef85 100644 --- a/R/M2.R +++ b/R/M2.R @@ -325,6 +325,7 @@ M2 <- function(obj, type="M2*", calcNull = TRUE, quadpts = NULL, theta_lim = c(- itemloc <- itemloc[-length(itemloc)] was_na <- is.na(extract.mirt(obj, 'data')) fulldata <- obj@Data$fulldata[[1L]] + N <- colSums(!is.na(fulldata))[-itemloc] for(i in 1:(nitems)){ pick <- if(i == nitems) c(itemloc[i], ncol(fulldata)) else c(itemloc[i], itemloc[i+1]-1)