From 128263655296ab5308db0e0940a4c7b43714aadb Mon Sep 17 00:00:00 2001 From: corentinchoisy Date: Wed, 27 Dec 2023 09:37:33 +0100 Subject: [PATCH] Progress on simirt.R --- Modules/simirt.R | 32 ++++++++++++++++++++++++++++---- Modules/simirt.ado | 15 +++++++++++++++ 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/Modules/simirt.R b/Modules/simirt.R index fea4fef..babf68c 100644 --- a/Modules/simirt.R +++ b/Modules/simirt.R @@ -235,13 +235,37 @@ else if (typediff=='gauss') { } -for - - - +nbrsm <- c() +for (d in 1:2) { + if (!is.null(get(paste0('RSM',d)))) { + nbrsm[d] <- length(get(paste0('RSM',d))) + for (i in seq(2,nbrsm[d]+1)) { + rsm[[d]][i] <- get(paste0("RSM",d))[i-1] # RSM doit etre une liste de vecteurs + if (!is.null(THR) & rsm[[d]][i]<0) { + stop('Error 198: With the THR option, the numbers defined in RSM1 and RSM2 must nonnegative') + } + } + } +} +if (!is.null(DIF) & is.null(PCM)) { + PCM <- as.matrix(DIF) +} +matdiff <- as.matrix(rep(0,nbitems)) +matdisc <- as.matrix(rep(0,nbitems)) +matpmin <- as.matrix(rep(0,nbitems)) +matpmax <- as.matrix(rep(0,nbitems)) +matacc <- as.matrix(rep(0,nbitems)) +matmu <- as.matrix(rep(0,length(DIM))) +matmu <- as.matrix(rep(0,(length(DIM)+1)*length(DIM)/2 )) +if (nbdisc !=0) { + matdisc <- as.matrix(DISC) +} +else { + matdisc <- rep(1,nbitems) +} diff --git a/Modules/simirt.ado b/Modules/simirt.ado index 2d0c984..f42892f 100644 --- a/Modules/simirt.ado +++ b/Modules/simirt.ado @@ -452,6 +452,21 @@ forvalues i=1/`nbitems'{ } } + + + + + + + + + + + + + + + if "`pcm'"==""|"`rsm1'"!="" { tempname pcm if "`rsm1'"=="" {