From b87f107009fa72fd7e4b5d9d920416f53a6132bc Mon Sep 17 00:00:00 2001 From: corentinchoisy Date: Thu, 18 Apr 2024 17:49:30 +0200 Subject: [PATCH] ROSALI and RESALI scripts updated --- .../Analysis/DIF-RESIDUS/pcm_dif_residus.do | 2 +- Scripts/Analysis/DIF-ROSALI/pcm_dif_rosali.do | 20 ++++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Scripts/Analysis/DIF-RESIDUS/pcm_dif_residus.do b/Scripts/Analysis/DIF-RESIDUS/pcm_dif_residus.do index 12ea978..707054f 100644 --- a/Scripts/Analysis/DIF-RESIDUS/pcm_dif_residus.do +++ b/Scripts/Analysis/DIF-RESIDUS/pcm_dif_residus.do @@ -342,7 +342,7 @@ local N = "50 100 200 300" } mat outmat[`k',colnumb(outmat,"dif_detect_`u'")] = `j' if (mod(`s',2)==0) { - mat outmat[`k',colnumb(outmat,"dif_detect_unif_`u'")] = `unif_`j'' + mat outmat[`k',colnumb(outmat,"dif_detect_unif_`u'")] = `unif_`u'' } } * Stocker les items de DIF originaux diff --git a/Scripts/Analysis/DIF-ROSALI/pcm_dif_rosali.do b/Scripts/Analysis/DIF-ROSALI/pcm_dif_rosali.do index 901a9f6..b37b45e 100644 --- a/Scripts/Analysis/DIF-ROSALI/pcm_dif_rosali.do +++ b/Scripts/Analysis/DIF-ROSALI/pcm_dif_rosali.do @@ -61,6 +61,9 @@ local N = "50 100 200 300" } * taillemat = Maximum J*M cases pour les items par et J*M cases pour les dif par + J cases pour les DIF detect + nbdif cases pour dif réel local taillemat=2*`nbitems'*`nbmoda'+`nbitems'+`nbdif'+2 + if (mod(`s',2)==0) { + local taillemat=2*`nbitems'*`nbmoda'+`nbitems'+`nbitems'+`nbdif'+2 + } local colna="" forvalues i=1/`nbitems' { forvalues z=1/`nbmoda' { @@ -69,7 +72,12 @@ local N = "50 100 200 300" } } forvalues i=1/`nbitems' { - local colna = "`colna'"+"dif_detect_`i' " + if (mod(`s',2)==1) { + local colna = "`colna'"+"dif_detect_`i' " + } + if (mod(`s',2)==0) { + local colna = "`colna'"+"dif_detect_`i' "+"dif_detect_unif_`i' " + } } forvalues i=1/`nbdif' { @@ -213,7 +221,7 @@ local N = "50 100 200 300" local checker2: word 2 of `val' local checker3: word 3 of `val' local nummoda=r(r) - local nbmoda_`j'=`nummoda' + local nbmoda_`j'=`nummoda'-1 if (`nummoda'==2) { qui recode item`j' (`checker'=0) (`checker2'=1) } @@ -301,11 +309,14 @@ local N = "50 100 200 300" local mod = "`mod'"+"(2.item`v'<-THETA@2 tt)" } local w= 100+`u' + local unif_`u'=0 if (resmat[1,`nbitems'+`v']!=testm[1,1] & `nbmoda_`v''==3) { local conformula = "`conformula'" + "`u' " + "`w' " + local unif_`u'=1 } else if (resmat[1,`nbitems'+`v']!=testm[1,1] & `nbmoda_`v''==2) { local conformula = "`conformula'" + "`u' " + local unif_`u'=1 } } if ("`conformula'" != "") { @@ -330,7 +341,10 @@ local N = "50 100 200 300" local j=`difitems`u'' forvalues z=1/`nbmoda_`j'' { mat outmat[`k',colnumb(outmat,"dif_`u'_`z'")] = W[1,colnumb(W,"`z'.item`j':tt")] - mat outmat[`k',colnumb(outmat,"dif_detect_`u'")] = `j' + } + mat outmat[`k',colnumb(outmat,"dif_detect_`u'")] = `j' + if (mod(`s',2)==0) { + mat outmat[`k',colnumb(outmat,"dif_detect_unif_`u'")] = `unif_`u'' } }