diff --git "a/Data\\scenario_1A.csv" "b/Data\\scenario_1A.csv" new file mode 100644 index 0000000..a7d066d --- /dev/null +++ "b/Data\\scenario_1A.csv" @@ -0,0 +1,201 @@ +id,lt1,item1,item2,item3,item4,TT,replication +1,.17644101,0,0,0,1,0,1 +2,1.1119704,0,1,1,1,0,1 +3,-.46370447,0,1,0,1,0,1 +4,-1.0415101,1,0,1,0,0,1 +5,-1.2738965,1,0,0,0,0,1 +6,-.085420959,1,1,0,1,0,1 +7,1.1056501,1,1,1,1,0,1 +8,-.32086244,1,0,1,0,0,1 +9,.54192197,1,0,0,0,0,1 +10,.49705315,1,1,0,1,0,1 +11,-.64607531,1,1,0,1,0,1 +12,.51508766,0,1,1,0,0,1 +13,.2836611,0,0,0,1,0,1 +14,-.63813239,1,1,1,0,0,1 +15,1.4577918,1,1,1,1,0,1 +16,-.9888711,1,0,1,0,0,1 +17,-1.8077854,1,0,0,0,0,1 +18,-.36925948,1,0,0,0,0,1 +19,.17932144,1,0,0,0,0,1 +20,-.63588434,0,1,0,1,0,1 +21,.86244547,0,0,0,0,0,1 +22,-.44217664,1,0,0,0,0,1 +23,-.38870588,1,1,1,0,0,1 +24,.95358348,1,1,0,0,0,1 +25,-.36753294,1,0,1,0,0,1 +26,-.63655686,0,0,0,0,0,1 +27,-.012073237,1,1,1,0,0,1 +28,-.13124834,1,0,1,0,0,1 +29,-.14458376,1,0,1,0,0,1 +30,-.25078735,1,1,0,0,0,1 +31,-.16138455,1,1,1,0,0,1 +32,.75585234,1,0,1,1,0,1 +33,-.60850286,1,0,1,0,0,1 +34,.79716212,1,0,1,0,0,1 +35,.45342034,1,1,1,0,0,1 +36,-2.1057169,0,0,0,0,0,1 +37,.79157275,1,0,0,1,0,1 +38,-.66571254,0,1,0,0,0,1 +39,-.097855851,1,1,0,1,0,1 +40,1.0418533,1,0,1,1,0,1 +41,-.46935579,0,0,0,0,0,1 +42,.63163638,1,1,0,0,0,1 +43,.085910544,0,1,1,1,0,1 +44,.83931607,1,0,0,0,0,1 +45,.50145197,1,1,1,0,0,1 +46,2.5159037,0,1,1,1,0,1 +47,-.29928276,1,1,0,0,0,1 +48,-.52162999,1,1,0,1,0,1 +49,1.7009553,1,1,1,1,0,1 +50,-.44088203,1,0,1,0,0,1 +51,1.5880907,1,1,0,0,0,1 +52,-.47029325,0,0,0,0,0,1 +53,1.2277231,1,1,0,1,0,1 +54,.42639166,1,0,1,1,0,1 +55,-.95310265,0,0,0,0,0,1 +56,.64398259,1,0,1,1,0,1 +57,.18478298,1,1,0,1,0,1 +58,.82810265,1,0,1,1,0,1 +59,-.33021048,1,0,0,0,0,1 +60,-3.170429,0,0,0,0,0,1 +61,-1.1574296,0,1,1,0,0,1 +62,1.8837459,1,1,0,0,0,1 +63,-1.2181894,0,0,0,0,0,1 +64,1.2980061,1,1,1,1,0,1 +65,-.32206535,1,1,0,0,0,1 +66,-.42526674,0,0,0,0,0,1 +67,1.3604238,0,1,0,1,0,1 +68,-1.6900293,0,0,0,0,0,1 +69,.46790454,0,0,1,1,0,1 +70,.46692941,0,0,0,0,0,1 +71,-1.4733744,1,0,0,0,0,1 +72,-.20302044,0,1,1,1,0,1 +73,-.48481002,0,0,0,0,0,1 +74,.18501657,0,0,1,0,0,1 +75,-1.5757569,1,0,0,0,0,1 +76,.225288,0,0,0,0,0,1 +77,.40944499,0,1,1,1,0,1 +78,.03514893,1,1,0,1,0,1 +79,-2.0809295,0,0,1,0,0,1 +80,.89514649,1,1,1,0,0,1 +81,-1.3915017,1,0,0,1,0,1 +82,.11379968,1,1,0,0,0,1 +83,1.5646211,1,1,1,1,0,1 +84,-.31079024,1,0,1,0,0,1 +85,1.2880181,1,1,1,1,0,1 +86,-.16200012,1,0,1,0,0,1 +87,-.26236823,0,1,1,0,0,1 +88,-.17450906,1,1,0,0,0,1 +89,-1.8440282,0,0,1,0,0,1 +90,-.13284066,0,1,0,0,0,1 +91,1.5515995,1,1,1,1,0,1 +92,-.78718334,1,0,0,0,0,1 +93,-.28649214,1,0,1,1,0,1 +94,.65451664,1,1,0,0,0,1 +95,.26079011,0,0,0,1,0,1 +96,1.4207528,1,1,1,0,0,1 +97,-.36326984,0,1,0,0,0,1 +98,-.0092543131,1,1,0,1,0,1 +99,.73671579,0,1,1,1,0,1 +100,.078362353,1,0,0,1,0,1 +101,-.24513553,1,1,0,0,1,1 +102,-.85109341,1,1,1,0,1,1 +103,-2.2168906,1,0,0,0,1,1 +104,-.65738457,0,1,0,0,1,1 +105,.00074740726,1,0,0,1,1,1 +106,1.204085,1,1,1,1,1,1 +107,.74587023,1,1,1,0,1,1 +108,1.8170407,1,1,1,0,1,1 +109,-.35072035,1,1,1,0,1,1 +110,-.14632735,1,1,0,0,1,1 +111,1.0549366,1,1,1,1,1,1 +112,-.011479022,0,0,1,0,1,1 +113,.62853611,1,0,1,1,1,1 +114,-.33840579,1,0,1,0,1,1 +115,-.72323412,1,0,0,1,1,1 +116,2.2091029,0,1,0,0,1,1 +117,.21428454,1,0,1,0,1,1 +118,.66688836,1,1,0,0,1,1 +119,-.73199588,1,1,1,0,1,1 +120,-.30729398,1,1,0,1,1,1 +121,.37092265,0,1,1,1,1,1 +122,.6029672,1,1,1,1,1,1 +123,.46125323,1,0,0,1,1,1 +124,-1.2180696,0,0,0,0,1,1 +125,-.51291251,1,1,1,0,1,1 +126,-.17254806,1,0,0,0,1,1 +127,.46708295,1,1,0,0,1,1 +128,-1.153928,1,1,0,0,1,1 +129,1.4594103,1,0,0,0,1,1 +130,-.45216542,1,0,0,0,1,1 +131,.090173036,1,1,0,0,1,1 +132,-.25163296,1,0,0,0,1,1 +133,.99079025,1,0,1,0,1,1 +134,1.9550312,1,1,1,1,1,1 +135,-.74238241,1,0,0,0,1,1 +136,2.4380329,1,1,1,1,1,1 +137,-2.5176644,0,0,0,0,1,1 +138,-1.2309995,1,0,0,0,1,1 +139,-.90618628,1,0,1,0,1,1 +140,-1.6482364,0,0,0,0,1,1 +141,-.66502756,1,0,0,0,1,1 +142,1.2219602,1,0,1,1,1,1 +143,.51810169,0,1,1,1,1,1 +144,.33138105,1,0,1,1,1,1 +145,.92467684,1,1,1,0,1,1 +146,-.47461674,0,0,1,1,1,1 +147,1.2050171,1,1,0,0,1,1 +148,1.5156882,1,1,0,0,1,1 +149,1.5499333,1,1,1,1,1,1 +150,-.063660748,1,0,1,1,1,1 +151,.27926692,0,0,1,1,1,1 +152,1.800284,1,1,1,1,1,1 +153,-2.4724929,0,0,0,0,1,1 +154,1.4980674,1,1,1,1,1,1 +155,1.0834401,1,0,1,0,1,1 +156,-.73209035,0,1,0,0,1,1 +157,.10514933,1,1,1,1,1,1 +158,1.4848051,1,1,1,0,1,1 +159,.48073712,0,1,0,1,1,1 +160,-1.1459501,1,1,1,0,1,1 +161,1.3261594,1,1,0,1,1,1 +162,.45268533,0,1,0,1,1,1 +163,-2.1466103,0,0,0,1,1,1 +164,.036299877,1,0,1,1,1,1 +165,1.132494,1,1,0,1,1,1 +166,-.74459684,1,1,0,0,1,1 +167,-1.3133749,0,0,1,0,1,1 +168,.24529886,0,0,0,0,1,1 +169,-.047662795,1,1,0,0,1,1 +170,1.426119,1,1,1,1,1,1 +171,-1.6673079,0,0,0,0,1,1 +172,-.47215554,0,0,1,0,1,1 +173,-1.1029931,0,1,0,0,1,1 +174,.02064253,0,1,0,1,1,1 +175,-.7602495,1,1,0,0,1,1 +176,-1.225958,1,0,0,0,1,1 +177,.062465422,1,1,1,0,1,1 +178,-1.7623961,0,0,0,0,1,1 +179,-.12828347,1,0,1,0,1,1 +180,1.4514505,1,1,1,1,1,1 +181,-.80989766,1,0,1,0,1,1 +182,.18102278,1,1,1,1,1,1 +183,-.89957333,1,1,0,1,1,1 +184,1.1199794,1,1,0,1,1,1 +185,-.45701504,1,0,1,1,1,1 +186,.75216359,1,1,0,0,1,1 +187,-1.0642035,1,1,1,0,1,1 +188,-.297575,1,1,1,1,1,1 +189,1.432634,1,1,1,1,1,1 +190,.59969848,1,1,1,0,1,1 +191,.38591364,0,0,0,1,1,1 +192,-.17246659,0,1,0,0,1,1 +193,.024799852,1,1,1,0,1,1 +194,-.86773324,1,0,1,0,1,1 +195,-1.3454363,0,0,0,0,1,1 +196,.60606623,1,1,0,1,1,1 +197,1.3981689,1,1,1,1,1,1 +198,-.22852357,1,1,0,0,1,1 +199,-1.6954113,1,0,0,0,1,1 +200,-.48686084,0,1,1,0,1,1 diff --git a/Modules/simirt.ado b/Modules/simirt.ado index f42892f..6168d6f 100644 --- a/Modules/simirt.ado +++ b/Modules/simirt.ado @@ -49,7 +49,7 @@ program define simirt , rclass version 8.0 -syntax [, NBObs(integer 2000) Dim(string) MU(string) COV(string) COVMatrix(string) DISc(string) DIFf(string) PMIN(string) PMAX(string) ACC(string) clear STOre(string) REPlace PREFix(string) DRAW drawall ICC GRoup(real 0) noRANDom DELtagroup(real 0) rsm1(string) rsm2(string) THReshold TITle(string) PCM(string) id(string) GENProba GENIcc] +syntax [, NBObs(integer 2000) Dim(string) MU(string) COV(string) COVMatrix(string) DISc(string) DIFf(string) PMIN(string) PMAX(string) ACC(string) clear STOre(string) REPlace PREFix(string) DRAW drawall ICC GRoup(real 0) noRANDom DELtagroup(real 0) rsm1(string) rsm2(string) THReshold TITle(string) PCM(string) id(string) GENProba GENIcc] /******************************************************************************** @@ -112,12 +112,6 @@ if "`dim'"!="" { local nbdiff:word count `diff' } } - - - - - - else if "`dim'"==""{ if "`diff'"==""&"`pcm'"=="" { di in red "{p 0 0 0}You must indicate the number of items to simulate with the {hi:dim}, the {hi:pcm} or the {hi:diff} option(s)." @@ -151,8 +145,6 @@ if (`group'!=0|`deltagroup'!=0)&`dim'!=1 { exit } - - if "`prefix'"=="" { local prefix item } @@ -174,17 +166,6 @@ else { local prefix`d' `prefix'`tmp' } } - - - - - - - - - - - if "`covmatrix'"=="" { tempname covmatrix2 local nbcov:word count `cov' @@ -204,15 +185,6 @@ if "`covmatrix'"=="" { } matrix `covmatrix2'=(`cov') } - - - - - - - - - else if `dim'==2 { if `nbcov'!=3&`nbcov'>0 { di in red "You simulate two dimensions. You must indicate exactly 3 values in the {hi:cov} option (Variance of the first simulated latent trait, Variance of the second simulated latent trait, Covariance between the two simulated latent traits)." @@ -244,13 +216,6 @@ if "`covmatrix'"=="" { local covmatrix `covmatrix2' } - - - - - - - local nbmu:word count `mu' if `nbmu'!=`dim'&`nbmu'!=0 { di in red "You must indicate as many values in the {hi:mu} option as the number of dimension(s) (`dim')" @@ -345,10 +310,6 @@ while $seed>2^31-1 { qui set seed $seed - - - - if "`typediff'"=="uniform" { if `nbdiff'==`=`dim'*2+1' { local min`d':word `=(`d'-1)*2+2' of `diff' @@ -369,14 +330,6 @@ if "`typediff'"=="uniform" { } } } - - - - - - - - else if "`typediff'"=="gauss" { if `nbdiff'==`=`dim'*2+1' { forvalues d=1/`dim' { @@ -404,12 +357,6 @@ else if "`typediff'"=="gauss" { } } - - - - - - forvalues d=1/`dim' { if "`rsm`d''"!="" { local nbrsm`d':word count `rsm`d'' @@ -452,21 +399,6 @@ forvalues i=1/`nbitems'{ } } - - - - - - - - - - - - - - - if "`pcm'"==""|"`rsm1'"!="" { tempname pcm if "`rsm1'"=="" { @@ -497,7 +429,7 @@ if "`pcm'"==""|"`rsm1'"!="" { local tmp:word `j' of `rsm2' matrix `pcm'[`i',`=1+`j'']=`pcm'[`i',1]+`tmp' } - } + } } } } @@ -544,7 +476,7 @@ forvalues i=1/`nbitems' { } if "`covmatrix'"=="" { - tempname covmatrix + tempname covmatrix if `nbcov'==1 { matrix `covmatrix'=(`cov') } @@ -582,7 +514,7 @@ local names forvalues d=1/`dim' { qui gen x`d'=invnorm(uniform()) qui compress - local names `names' lt`d' /*En R: names <- c(names,paste('lt',d)) */ + local names `names' lt`d' } matrix Chol=cholesky(corr(`covmatrix')) @@ -598,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'"=="" { @@ -742,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' /******************************************************************************** diff --git a/Scripts/R/generate_item_difficulties.R b/Scripts/R/generate_item_difficulties.R index dfdb477..ca53b8c 100644 --- a/Scripts/R/generate_item_difficulties.R +++ b/Scripts/R/generate_item_difficulties.R @@ -19,11 +19,13 @@ generate_diff_irt <- function(J=7,M=4) { for (j in 1:J){ difficulties[j,1] = qnorm(j/(J+1)) } + if (M>2) { for (j in 1:J){ for (m in 2:(M-1)){ difficulties[j,m]= difficulties[j,1]+(m-1)*2/(M-2) } } + } difficulties = difficulties-mean(difficulties) return(difficulties) } @@ -36,4 +38,9 @@ generate_diff_irt <- function(J=7,M=4) { # GENERATE MATRIX FOR SIMULATION ################################################### +generate_diff_irt(J=4,M=2) +generate_diff_irt(J=4,M=4) +generate_diff_irt(J=7,M=2) +generate_diff_irt(J=7,M=4) + diff --git a/Scripts/Scenarios/NoDIF/scenarios_noDIF_baseline.do b/Scripts/Scenarios/NoDIF/scenarios_noDIF_baseline.do index 80a16ac..2a91f8b 100644 --- a/Scripts/Scenarios/NoDIF/scenarios_noDIF_baseline.do +++ b/Scripts/Scenarios/NoDIF/scenarios_noDIF_baseline.do @@ -6,7 +6,7 @@ * * ado-files needed : - simirt (version 4.3 August 29, 2019, available on OSF) * -* outputs : TBA + * outputs : scenario_1,scenario_2,scenario_3,scenario_4, for N=100/200/300 * * * Warning : To obtain reproduce the data obtained in the .csv files in this repository, use 'simirt_setseed.ado' instead of 'simirt.ado' @@ -15,53 +15,258 @@ *================================================================================================================================================ * Load simirt.ado -adopath+"/home/corentin/Documents/These/Recherche/Simulations/Modules/simirt.ado" +adopath+"/home/corentin/Documents/These/Recherche/Simulations/Modules/" * Set data output folder path -local path = "/home/corentin/Documents/These/Recherche/Simulations/Data" +local path = "/home/corentin/Documents/These/Recherche/Simulations/Data/NoDIF" -* Scenarios with : n = 800 +* Scenarios with : n = 100 *========================== -* Scenario No. 7 : J = 4 items + C1 et C2 not correlated +local path = "/home/corentin/Documents/These/Recherche/Simulations/Data/NoDIF/N100" +local Nn = 100 -forvalues replication = 1/500 { +** Scenario 1: J = 4 items / M = 2 modalities / N=100 per group / TT=treatment variable + +* Scenario 1A : H_0 is TRUE + +forvalues replication = 1/1000 { + di "replication = `replication'" + mat D= (-0.84 \ -0.25 \ 0.25 \ 0.84) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + mat D= (-0.84 \ -0.25 \ 0.25 \ 0.84) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_1A_100.csv", replace + + + * Scenario 1B : H_0 is FALSE / Effect size = 0.2 + + forvalues replication = 1/1000 { + di "replication = `replication'" + mat D= (-0.84 \ -0.25 \ 0.25 \ 0.84) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + mat D= (-0.84 \ -0.25 \ 0.25 \ 0.84) + qui simirt, nbobs(Nn) mu(0.2) cov(1) dim(4) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_1B_100.csv", replace + +* Scenario 1C : H_0 is FALSE / Effect size = 0.4 + + forvalues replication = 1/1000 { + di "replication = `replication'" + mat D= (-0.84 \ -0.25 \ 0.25 \ 0.84) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + mat D= (-0.84 \ -0.25 \ 0.25 \ 0.84) + qui simirt, nbobs(Nn) mu(0.4) cov(1) dim(4) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_1C_100.csv", replace + + +**------------------------------------------------------------------------------------** + + +** Scenario 2: J = 4 items / M = 4 modalities / N=100 per group / TT=treatment variable + + * Scenario 2A : H_0 is TRUE + + forvalues replication = 1/1000 { + di "replication = `replication'" + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_2A_100.csv", replace + + + * Scenario 2B : H_0 is FALSE / Effect size = 0.2 + + forvalues replication = 1/1000 { + di "replication = `replication'" + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(Nn) mu(0.2) cov(1) dim(4) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_2B_100.csv", replace + + * Scenario 2C : H_0 is FALSE / Effect size = 0.4 + + forvalues replication = 1/1000 { + di "replication = `replication'" + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(Nn) mu(0.4) cov(1) dim(4) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_2C_100.csv", replace + + +**------------------------------------------------------------------------------------** + + +** Scenario 3: J = 7 items / M = 2 modalities / N=100 per group / TT=treatment variable + +* Scenario 3A : H_0 is TRUE + +forvalues replication = 1/1000 { di "replication = `replication'" - mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75\-0.75,0.25,1.25 \-0.16,0.84,1.84) - qui simirt, nbobs(200) mu(0) cov(1) dim(4) pcm(D) clear - qui gen C1 = 0 - qui gen C2 = 0 - tempfile grp00 - qui save `grp00',replace - - mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75\-0.75,0.25,1.25 \-0.16,0.84,1.84) - qui simirt, nbobs(200) mu(0) cov(1) dim(4) pcm(D) clear - qui gen C1 = 1 - qui gen C2 = 0 - tempfile grp10 - qui save `grp10',replace - - mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75\-0.75,0.25,1.25 \-0.16,0.84,1.84) - qui simirt, nbobs(200) mu(0) cov(1) dim(4) pcm(D) clear - qui gen C1 = 0 - qui gen C2 = 1 - tempfile grp01 - qui save `grp01',replace - - mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75\-0.75,0.25,1.25 \-0.16,0.84,1.84) - qui simirt, nbobs(200) mu(0) cov(1) dim(4) pcm(D) clear - qui gen C1 = 1 - qui gen C2 = 1 - tempfile grp11 - qui save `grp11',replace + mat D= (-1.15 \ -0.67 \ -0.32 \ 0 \ 0.32 \ 0.67 \ 1.15) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(7) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + mat D= (-1.15 \ -0.67 \ -0.32 \ 0 \ 0.32 \ 0.67 \ 1.15) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(7) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace clear - use `grp00' - qui append using `grp10' - qui append using `grp01' - qui append using `grp11' + use `grp0' + qui append using `grp1' drop id qui gen id = _n order(id) @@ -75,4 +280,1116 @@ forvalues replication = 1/500 { qui save `data',replace } } - export delimited using "`path'\Scenario7.csv", replace + export delimited using "`path'/scenario_3A_100.csv", replace + + + * Scenario 3B : H_0 is FALSE / Effect size = 0.2 + + forvalues replication = 1/1000 { + di "replication = `replication'" + mat D= (-1.15 \ -0.67 \ -0.32 \ 0 \ 0.32 \ 0.67 \ 1.15) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(7) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + mat D= (-1.15 \ -0.67 \ -0.32 \ 0 \ 0.32 \ 0.67 \ 1.15) + qui simirt, nbobs(Nn) mu(0.2) cov(1) dim(7) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_3B_100.csv", replace + +* Scenario 3C : H_0 is FALSE / Effect size = 0.4 + + forvalues replication = 1/1000 { + di "replication = `replication'" + mat D= (-1.15 \ -0.67 \ -0.32 \ 0 \ 0.32 \ 0.67 \ 1.15) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(7) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + mat D= (-1.15 \ -0.67 \ -0.32 \ 0 \ 0.32 \ 0.67 \ 1.15) + qui simirt, nbobs(Nn) mu(0.4) cov(1) dim(7) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_3C_100.csv", replace + + +**------------------------------------------------------------------------------------** + + +** Scenario 4: J = 7 items / M = 4 modalities / N=100 per group / TT=treatment variable + + * Scenario 4A : H_0 is TRUE + + forvalues replication = 1/1000 { + di "replication = `replication'" + mat D= (-2.15,-1.15,-0.15 \ -1.67,-0.67,0.33 \ -1.32,-0.32,0.68 \ -1,0,1 \ -0.68,0.32,1.32 \ -0.33,0.67,1.67 \ 0.15,1.15,2.15) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(7) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + mat D= (-2.15,-1.15,-0.15 \ -1.67,-0.67,0.33 \ -1.32,-0.32,0.68 \ -1,0,1 \ -0.68,0.32,1.32 \ -0.33,0.67,1.67 \ 0.15,1.15,2.15) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(7) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_4A_100.csv", replace + + + * Scenario 4B : H_0 is FALSE / Effect size = 0.2 + + forvalues replication = 1/1000 { + di "replication = `replication'" + mat D= (-2.15,-1.15,-0.15 \ -1.67,-0.67,0.33 \ -1.32,-0.32,0.68 \ -1,0,1 \ -0.68,0.32,1.32 \ -0.33,0.67,1.67 \ 0.15,1.15,2.15) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(7) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + mat D= (-2.15,-1.15,-0.15 \ -1.67,-0.67,0.33 \ -1.32,-0.32,0.68 \ -1,0,1 \ -0.68,0.32,1.32 \ -0.33,0.67,1.67 \ 0.15,1.15,2.15) + qui simirt, nbobs(Nn) mu(0.2) cov(1) dim(7) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_4B_100.csv", replace + + * Scenario 4C : H_0 is FALSE / Effect size = 0.4 + + forvalues replication = 1/1000 { + di "replication = `replication'" + mat D= (-2.15,-1.15,-0.15 \ -1.67,-0.67,0.33 \ -1.32,-0.32,0.68 \ -1,0,1 \ -0.68,0.32,1.32 \ -0.33,0.67,1.67 \ 0.15,1.15,2.15) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(7) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + mat D= (-2.15,-1.15,-0.15 \ -1.67,-0.67,0.33 \ -1.32,-0.32,0.68 \ -1,0,1 \ -0.68,0.32,1.32 \ -0.33,0.67,1.67 \ 0.15,1.15,2.15) + qui simirt, nbobs(Nn) mu(0.4) cov(1) dim(7) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_4C_100.csv", replace + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +* Scenarios with : n = 200 +*========================== + +local path = "/home/corentin/Documents/These/Recherche/Simulations/Data/NoDIF/N200" +local Nn = 200 + +** Scenario 1: J = 4 items / M = 2 modalities / N=100 per group / TT=treatment variable + + * Scenario 1A : H_0 is TRUE + + forvalues replication = 1/1000 { + di "replication = `replication'" + mat D= (-0.84 \ -0.25 \ 0.25 \ 0.84) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + mat D= (-0.84 \ -0.25 \ 0.25 \ 0.84) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_1A_200.csv", replace + + + * Scenario 1B : H_0 is FALSE / Effect size = 0.2 + + forvalues replication = 1/1000 { + di "replication = `replication'" + mat D= (-0.84 \ -0.25 \ 0.25 \ 0.84) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + mat D= (-0.84 \ -0.25 \ 0.25 \ 0.84) + qui simirt, nbobs(Nn) mu(0.2) cov(1) dim(4) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_1B_200.csv", replace + + * Scenario 1C : H_0 is FALSE / Effect size = 0.4 + + forvalues replication = 1/1000 { + di "replication = `replication'" + mat D= (-0.84 \ -0.25 \ 0.25 \ 0.84) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + mat D= (-0.84 \ -0.25 \ 0.25 \ 0.84) + qui simirt, nbobs(Nn) mu(0.4) cov(1) dim(4) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_1C_200.csv", replace + + +**------------------------------------------------------------------------------------** + + +** Scenario 2: J = 4 items / M = 4 modalities / N=100 per group / TT=treatment variable + + * Scenario 2A : H_0 is TRUE + + forvalues replication = 1/1000 { + di "replication = `replication'" + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_2A_200.csv", replace + + + * Scenario 2B : H_0 is FALSE / Effect size = 0.2 + + forvalues replication = 1/1000 { + di "replication = `replication'" + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(Nn) mu(0.2) cov(1) dim(4) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_2B_200.csv", replace + + * Scenario 2C : H_0 is FALSE / Effect size = 0.4 + + forvalues replication = 1/1000 { + di "replication = `replication'" + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(Nn) mu(0.4) cov(1) dim(4) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_2C_200.csv", replace + + +**------------------------------------------------------------------------------------** + + +** Scenario 3: J = 7 items / M = 2 modalities / N=100 per group / TT=treatment variable + + * Scenario 3A : H_0 is TRUE + + forvalues replication = 1/1000 { + di "replication = `replication'" + mat D= (-1.15 \ -0.67 \ -0.32 \ 0 \ 0.32 \ 0.67 \ 1.15) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(7) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + mat D= (-1.15 \ -0.67 \ -0.32 \ 0 \ 0.32 \ 0.67 \ 1.15) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(7) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_3A_200.csv", replace + + + * Scenario 3B : H_0 is FALSE / Effect size = 0.2 + + forvalues replication = 1/1000 { + di "replication = `replication'" + mat D= (-1.15 \ -0.67 \ -0.32 \ 0 \ 0.32 \ 0.67 \ 1.15) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(7) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + mat D= (-1.15 \ -0.67 \ -0.32 \ 0 \ 0.32 \ 0.67 \ 1.15) + qui simirt, nbobs(Nn) mu(0.2) cov(1) dim(7) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_3B_200.csv", replace + + * Scenario 3C : H_0 is FALSE / Effect size = 0.4 + + forvalues replication = 1/1000 { + di "replication = `replication'" + mat D= (-1.15 \ -0.67 \ -0.32 \ 0 \ 0.32 \ 0.67 \ 1.15) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(7) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + mat D= (-1.15 \ -0.67 \ -0.32 \ 0 \ 0.32 \ 0.67 \ 1.15) + qui simirt, nbobs(Nn) mu(0.4) cov(1) dim(7) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_3C_200.csv", replace + + +**------------------------------------------------------------------------------------** + + +** Scenario 4: J = 7 items / M = 4 modalities / N=100 per group / TT=treatment variable + + * Scenario 4A : H_0 is TRUE + + forvalues replication = 1/1000 { + di "replication = `replication'" + mat D= (-2.15,-1.15,-0.15 \ -1.67,-0.67,0.33 \ -1.32,-0.32,0.68 \ -1,0,1 \ -0.68,0.32,1.32 \ -0.33,0.67,1.67 \ 0.15,1.15,2.15) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(7) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + mat D= (-2.15,-1.15,-0.15 \ -1.67,-0.67,0.33 \ -1.32,-0.32,0.68 \ -1,0,1 \ -0.68,0.32,1.32 \ -0.33,0.67,1.67 \ 0.15,1.15,2.15) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(7) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_4A_200.csv", replace + + + * Scenario 4B : H_0 is FALSE / Effect size = 0.2 + + forvalues replication = 1/1000 { + di "replication = `replication'" + mat D= (-2.15,-1.15,-0.15 \ -1.67,-0.67,0.33 \ -1.32,-0.32,0.68 \ -1,0,1 \ -0.68,0.32,1.32 \ -0.33,0.67,1.67 \ 0.15,1.15,2.15) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(7) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + mat D= (-2.15,-1.15,-0.15 \ -1.67,-0.67,0.33 \ -1.32,-0.32,0.68 \ -1,0,1 \ -0.68,0.32,1.32 \ -0.33,0.67,1.67 \ 0.15,1.15,2.15) + qui simirt, nbobs(Nn) mu(0.2) cov(1) dim(7) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_4B_200.csv", replace + + * Scenario 4C : H_0 is FALSE / Effect size = 0.4 + + forvalues replication = 1/1000 { + di "replication = `replication'" + mat D= (-2.15,-1.15,-0.15 \ -1.67,-0.67,0.33 \ -1.32,-0.32,0.68 \ -1,0,1 \ -0.68,0.32,1.32 \ -0.33,0.67,1.67 \ 0.15,1.15,2.15) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(7) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + mat D= (-2.15,-1.15,-0.15 \ -1.67,-0.67,0.33 \ -1.32,-0.32,0.68 \ -1,0,1 \ -0.68,0.32,1.32 \ -0.33,0.67,1.67 \ 0.15,1.15,2.15) + qui simirt, nbobs(Nn) mu(0.4) cov(1) dim(7) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_4C_200.csv", replace + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +* Scenarios with : n = 300 +*========================== + +local path = "/home/corentin/Documents/These/Recherche/Simulations/Data/NoDIF/N300" +local Nn = 300 + +** Scenario 1: J = 4 items / M = 2 modalities / N=100 per group / TT=treatment variable + + * Scenario 1A : H_0 is TRUE + + forvalues replication = 1/1000 { + di "replication = `replication'" + mat D= (-0.84 \ -0.25 \ 0.25 \ 0.84) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + mat D= (-0.84 \ -0.25 \ 0.25 \ 0.84) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_1A_300.csv", replace + + + * Scenario 1B : H_0 is FALSE / Effect size = 0.2 + + forvalues replication = 1/1000 { + di "replication = `replication'" + mat D= (-0.84 \ -0.25 \ 0.25 \ 0.84) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + mat D= (-0.84 \ -0.25 \ 0.25 \ 0.84) + qui simirt, nbobs(Nn) mu(0.2) cov(1) dim(4) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_1B_300.csv", replace + + * Scenario 1C : H_0 is FALSE / Effect size = 0.4 + + forvalues replication = 1/1000 { + di "replication = `replication'" + mat D= (-0.84 \ -0.25 \ 0.25 \ 0.84) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + mat D= (-0.84 \ -0.25 \ 0.25 \ 0.84) + qui simirt, nbobs(Nn) mu(0.4) cov(1) dim(4) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_1C_300.csv", replace + + +**------------------------------------------------------------------------------------** + + +** Scenario 2: J = 4 items / M = 4 modalities / N=100 per group / TT=treatment variable + + * Scenario 2A : H_0 is TRUE + + forvalues replication = 1/1000 { + di "replication = `replication'" + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_2A_300.csv", replace + + + * Scenario 2B : H_0 is FALSE / Effect size = 0.2 + + forvalues replication = 1/1000 { + di "replication = `replication'" + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(Nn) mu(0.2) cov(1) dim(4) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_2B_300.csv", replace + + * Scenario 2C : H_0 is FALSE / Effect size = 0.4 + + forvalues replication = 1/1000 { + di "replication = `replication'" + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(Nn) mu(0.4) cov(1) dim(4) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_2C_300.csv", replace + + +**------------------------------------------------------------------------------------** + + +** Scenario 3: J = 7 items / M = 2 modalities / N=100 per group / TT=treatment variable + + * Scenario 3A : H_0 is TRUE + + forvalues replication = 1/1000 { + di "replication = `replication'" + mat D= (-1.15 \ -0.67 \ -0.32 \ 0 \ 0.32 \ 0.67 \ 1.15) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(7) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + mat D= (-1.15 \ -0.67 \ -0.32 \ 0 \ 0.32 \ 0.67 \ 1.15) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(7) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_3A_300.csv", replace + + + * Scenario 3B : H_0 is FALSE / Effect size = 0.2 + + forvalues replication = 1/1000 { + di "replication = `replication'" + mat D= (-1.15 \ -0.67 \ -0.32 \ 0 \ 0.32 \ 0.67 \ 1.15) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(7) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + mat D= (-1.15 \ -0.67 \ -0.32 \ 0 \ 0.32 \ 0.67 \ 1.15) + qui simirt, nbobs(Nn) mu(0.2) cov(1) dim(7) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_3B_300.csv", replace + + * Scenario 3C : H_0 is FALSE / Effect size = 0.4 + + forvalues replication = 1/1000 { + di "replication = `replication'" + mat D= (-1.15 \ -0.67 \ -0.32 \ 0 \ 0.32 \ 0.67 \ 1.15) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(7) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + mat D= (-1.15 \ -0.67 \ -0.32 \ 0 \ 0.32 \ 0.67 \ 1.15) + qui simirt, nbobs(Nn) mu(0.4) cov(1) dim(7) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_3C_300.csv", replace + + +**------------------------------------------------------------------------------------** + + +** Scenario 4: J = 7 items / M = 4 modalities / N=100 per group / TT=treatment variable + + * Scenario 4A : H_0 is TRUE + + forvalues replication = 1/1000 { + di "replication = `replication'" + mat D= (-2.15,-1.15,-0.15 \ -1.67,-0.67,0.33 \ -1.32,-0.32,0.68 \ -1,0,1 \ -0.68,0.32,1.32 \ -0.33,0.67,1.67 \ 0.15,1.15,2.15) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(7) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + mat D= (-2.15,-1.15,-0.15 \ -1.67,-0.67,0.33 \ -1.32,-0.32,0.68 \ -1,0,1 \ -0.68,0.32,1.32 \ -0.33,0.67,1.67 \ 0.15,1.15,2.15) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(7) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_4A_300.csv", replace + + + * Scenario 4B : H_0 is FALSE / Effect size = 0.2 + + forvalues replication = 1/1000 { + di "replication = `replication'" + mat D= (-2.15,-1.15,-0.15 \ -1.67,-0.67,0.33 \ -1.32,-0.32,0.68 \ -1,0,1 \ -0.68,0.32,1.32 \ -0.33,0.67,1.67 \ 0.15,1.15,2.15) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(7) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + mat D= (-2.15,-1.15,-0.15 \ -1.67,-0.67,0.33 \ -1.32,-0.32,0.68 \ -1,0,1 \ -0.68,0.32,1.32 \ -0.33,0.67,1.67 \ 0.15,1.15,2.15) + qui simirt, nbobs(Nn) mu(0.2) cov(1) dim(7) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_4B_300.csv", replace + + * Scenario 4C : H_0 is FALSE / Effect size = 0.4 + + forvalues replication = 1/1000 { + di "replication = `replication'" + mat D= (-2.15,-1.15,-0.15 \ -1.67,-0.67,0.33 \ -1.32,-0.32,0.68 \ -1,0,1 \ -0.68,0.32,1.32 \ -0.33,0.67,1.67 \ 0.15,1.15,2.15) + qui simirt, nbobs(Nn) mu(0) cov(1) dim(7) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + mat D= (-2.15,-1.15,-0.15 \ -1.67,-0.67,0.33 \ -1.32,-0.32,0.68 \ -1,0,1 \ -0.68,0.32,1.32 \ -0.33,0.67,1.67 \ 0.15,1.15,2.15) + qui simirt, nbobs(Nn) mu(0.4) cov(1) dim(7) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_4C_300.csv", replace