From 59bc529e706f1fcad99a02a75a94a64ad05fe483 Mon Sep 17 00:00:00 2001 From: corentinchoisy Date: Tue, 26 Dec 2023 09:10:36 +0100 Subject: [PATCH] Created simirt.R --- Modules/simirt.R | 0 Modules/simirt.ado | 16 ++++++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 Modules/simirt.R diff --git a/Modules/simirt.R b/Modules/simirt.R new file mode 100644 index 0000000..e69de29 diff --git a/Modules/simirt.ado b/Modules/simirt.ado index 6168d6f..491aca8 100644 --- a/Modules/simirt.ado +++ b/Modules/simirt.ado @@ -429,7 +429,7 @@ if "`pcm'"==""|"`rsm1'"!="" { local tmp:word `j' of `rsm2' matrix `pcm'[`i',`=1+`j'']=`pcm'[`i',1]+`tmp' } - } + } } } } @@ -476,7 +476,7 @@ forvalues i=1/`nbitems' { } if "`covmatrix'"=="" { - tempname covmatrix + tempname covmatrix if `nbcov'==1 { matrix `covmatrix'=(`cov') } @@ -514,7 +514,7 @@ local names forvalues d=1/`dim' { qui gen x`d'=invnorm(uniform()) qui compress - local names `names' lt`d' + local names `names' lt`d' /*En R: names <- c(names,paste('lt',d)) */ } matrix Chol=cholesky(corr(`covmatrix')) @@ -530,8 +530,8 @@ forvalues d=1/`dim' { qui replace lt`d'=lt`d'*sqrt(`covmatrix'[`d',`d'])+`matmu'[`d',1] qui compress } -qui replace lt1=_n-`nbobs' if `graphobs' -qui replace lt1=(lt1-1001)/1000*4*sqrt(`covmatrix'[1,1])+`matmu'[1,1] if `graphobs' +qui replace lt1=_n-`nbobs' if `graphobs' +qui replace lt1=(lt1-1001)/1000*4*sqrt(`covmatrix'[1,1])+`matmu'[1,1] if `graphobs' if `dim'==1&`group'!=0 { if "`random'"=="" { @@ -674,14 +674,14 @@ if "`draw'"!=""|"`icc'"!=""|"`drawall'"!="" { else { local title3="`title'" } - graph twoway (line `icc`i'' lt1) if `graphobs', ylabel(0(1)`nbmodas') legend(off) ytitle("Expected response") title("`title3'") name(iccitem`i',replace) + graph twoway (line `icc`i'' lt1) if `graphobs', ylabel(0(1)`nbmodas') legend(off) ytitle("Expected response") title("`title3'") name(iccitem`i',replace) local hicc `hicc' (line `icc`i'' lt1) label variable `icc`i'' "Item `i'" } - graph twoway `hicc' if `graphobs', ylabel(0(1)`nbmodas') legend(on) ytitle("Expected response") title("Item Characteristic Curves") name(icc,replace) + graph twoway `hicc' if `graphobs', ylabel(0(1)`nbmodas') legend(on) ytitle("Expected response") title("Item Characteristic Curves") name(icc,replace) } } -qui drop if `graphobs' +qui drop if `graphobs' /********************************************************************************