diff --git a/Scripts/Scenarios/DIF/scenarios_DIF_baseline_100.do b/Scripts/Scenarios/DIF/scenarios_DIF_baseline_100.do index daa6e06..c40bdd3 100644 --- a/Scripts/Scenarios/DIF/scenarios_DIF_baseline_100.do +++ b/Scripts/Scenarios/DIF/scenarios_DIF_baseline_100.do @@ -890,7 +890,7 @@ forvalues replication = 1/1000 { if `difi'==1 { - mat D= (-1.04,-0.04,0.96 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) } if `difi'==2 { mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) @@ -943,7 +943,7 @@ forvalues replication = 1/1000 { if `difi'==1 { - mat D= (-1.04,-0.04,0.96 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) } if `difi'==2 { mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) @@ -989,7 +989,7 @@ forvalues replication = 1/1000 { qui local difi = runiformint(1,4) if `difi'==1 { - mat D= (-1.04,-0.04,0.96 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) } if `difi'==2 { mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) @@ -1049,7 +1049,7 @@ forvalues replication = 1/1000 { if `difi'==1 { - mat D= (-1.04,-0.04,0.96 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) } if `difi'==2 { mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) @@ -1095,7 +1095,7 @@ forvalues replication = 1/1000 { qui local difi = runiformint(1,4) if `difi'==1 { - mat D= (-1.04,-0.04,0.96 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) } if `difi'==2 { mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) @@ -1136,3 +1136,2724 @@ forvalues replication = 1/1000 { } } export delimited using "`path'/scenario_8E_100.csv", replace + + + + + + + + + + + + + + +************** Scenarios with : DIF on 2 items ************** + +**** Scenarios with : DIF size 0.3 **** + +** Scenario 9: J = 4 items / M = 2 modalities / DIF SIZE = 0.3 + +* Scenario 9A : H_0 is TRUE / DIF on treatment x 2 + +di "Scenario 9A - N=100" + +forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + 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 + + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.54 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 1.14) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 1.14) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 1.14) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 1.14) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 1.14) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 1.14) + } + } + 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_9A_100.csv", replace + + + * Scenario 9B : H_1 is TRUE / Effect size 0.2 / DIF on treatment x2 + + di "Scenario 9B - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + 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 + + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.54 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 1.14) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 1.14) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 1.14) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 1.14) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 1.14) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 1.14) + } + } + 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_9B_100.csv", replace + +* Scenario 9C : H_1 is TRUE / Effect size 0.2 / DIF on control x2 + + di "Scenario 9C - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.54 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 1.14) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 1.14) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 1.14) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 1.14) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 1.14) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 1.14) + } + } + 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_9C_100.csv", replace + + +* Scenario 9D : H_1 is TRUE / Effect size 0.4 / DIF on treatment x2 + + di "Scenario 9D - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + 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 + + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.54 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 1.14) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 1.14) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 1.14) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 1.14) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 1.14) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 1.14) + } + } + 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_9D_100.csv", replace + +* Scenario 9E : H_1 is TRUE / Effect size 0.4 / DIF on control x2 + + di "Scenario 9E - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.54 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 1.14) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 1.14) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 1.14) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 1.14) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 1.14) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 1.14) + } + } + 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_9E_100.csv", replace + + +* Scenario 9F : H_0 is TRUE / DIF on treatment + DIF on control (other item) + +di "Scenario 9F - N=100" + +forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + while `difi'==`difj' { + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + } + + if `difi'==1 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 0.84) + } + if `difi'==2 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 0.84) + } + if `difi'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 0.84) + } + if `difi'==4 { + mat D= (-0.84 \ -0.25 \ 0.25 \ 1.14) + } + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + if `difj'==1 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 0.84) + } + if `difj'==2 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==4 { + mat D= (-0.84 \ -0.25 \ 0.25 \ 1.14) + } + 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_9F_100.csv", replace + + +* Scenario 9G : H_1 is TRUE / Effect size 0.2 / DIF on treatment + DIF on control (other item) + + di "Scenario 9G - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + while `difi'==`difj' { + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + } + + if `difi'==1 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 0.84) + } + if `difi'==2 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 0.84) + } + if `difi'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 0.84) + } + if `difi'==4 { + mat D= (-0.84 \ -0.25 \ 0.25 \ 1.14) + } + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + if `difj'==1 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 0.84) + } + if `difj'==2 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==4 { + mat D= (-0.84 \ -0.25 \ 0.25 \ 1.14) + } + 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_9G_100.csv", replace + +* Scenario 9H : H_1 is TRUE / Effect size 0.4 / DIF on treatment + DIF on control (other item) + + di "Scenario 9H - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + while `difi'==`difj' { + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + } + + if `difi'==1 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 0.84) + } + if `difi'==2 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 0.84) + } + if `difi'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 0.84) + } + if `difi'==4 { + mat D= (-0.84 \ -0.25 \ 0.25 \ 1.14) + } + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + if `difj'==1 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 0.84) + } + if `difj'==2 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==4 { + mat D= (-0.84 \ -0.25 \ 0.25 \ 1.14) + } + 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_9H_100.csv", replace + + + + + + + + + +** Scenario 10: J = 4 items / M = 4 modalities / DIF SIZE = 0.3 + +* Scenario 10A : H_0 is TRUE / DIF on treatment x 2 + +di "Scenario 10A - N=100" + +forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + 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 + + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.46,1.14,2.14) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.46,1.14,2.14) + } + } + 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_10A_100.csv", replace + + + * Scenario 10B : H_1 is TRUE / Effect size 0.2 / DIF on treatment x2 + + di "Scenario 10B - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + 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 + + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.46,1.14,2.14) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.46,1.14,2.14) + } + } + 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_10B_100.csv", replace + +* Scenario 10C : H_1 is TRUE / Effect size 0.2 / DIF on control x2 + + di "Scenario 10C - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.46,1.14,2.14) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.46,1.14,2.14) + } + } + 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_10C_100.csv", replace + + +* Scenario 10D : H_1 is TRUE / Effect size 0.4 / DIF on treatment x2 + + di "Scenario 10D - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + 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 + + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.46,1.14,2.14) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.46,1.14,2.14) + } + } + 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_10D_100.csv", replace + +* Scenario 10E : H_1 is TRUE / Effect size 0.4 / DIF on control x2 + + di "Scenario 10E - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.46,1.14,2.14) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.46,1.14,2.14) + } + } + 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_10E_100.csv", replace + + +* Scenario 10F : H_0 is TRUE / DIF on treatment + DIF on control (other item) + +di "Scenario 10F - N=100" + +forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + while `difi'==`difj' { + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + } + + if `difi'==1 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difi'==2 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difi'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55 \ 0.16,0.84,1.84) + } + if `difi'==4 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + if `difj'==1 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==2 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55 \ 0.16,0.84,1.84) + } + if `difj'==4 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + 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_10F_100.csv", replace + + +* Scenario 10G : H_1 is TRUE / Effect size 0.2 / DIF on treatment + DIF on control (other item) + + di "Scenario 10G - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + while `difi'==`difj' { + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + } + + if `difi'==1 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difi'==2 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difi'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55 \ 0.16,0.84,1.84) + } + if `difi'==4 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + if `difj'==1 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==2 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55 \ 0.16,0.84,1.84) + } + if `difj'==4 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + 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_10G_100.csv", replace + +* Scenario 10H : H_1 is TRUE / Effect size 0.4 / DIF on treatment + DIF on control (other item) + + di "Scenario 10H - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + while `difi'==`difj' { + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + } + + if `difi'==1 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difi'==2 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difi'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55 \ 0.16,0.84,1.84) + } + if `difi'==4 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + if `difj'==1 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==2 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55 \ 0.16,0.84,1.84) + } + if `difj'==4 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + 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_10H_100.csv", replace + + + + + + + + +**** Scenarios with : DIF size 0.5 **** + +** Scenario 11: J = 4 items / M = 2 modalities / DIF SIZE = 0.5 + +* Scenario 11A : H_0 is TRUE / DIF on treatment x 2 + +di "Scenario 11A - N=100" + +forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + 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 + + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.34 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 1.34) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 1.34) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 1.34) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 1.34) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 1.34) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 1.34) + } + } + 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_11A_100.csv", replace + + + * Scenario 11B : H_1 is TRUE / Effect size 0.2 / DIF on treatment x2 + + di "Scenario 11B - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + 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 + + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.34 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 1.34) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 1.34) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 1.34) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 1.34) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 1.34) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 1.34) + } + } + 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_11B_100.csv", replace + +* Scenario 11C : H_1 is TRUE / Effect size 0.2 / DIF on control x2 + + di "Scenario 11C - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.34 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 1.34) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 1.34) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 1.34) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 1.34) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 1.34) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 1.34) + } + } + 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_11C_100.csv", replace + + +* Scenario 11D : H_1 is TRUE / Effect size 0.4 / DIF on treatment x2 + + di "Scenario 11D - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + 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 + + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.34 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 1.34) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 1.34) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 1.34) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 1.34) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 1.34) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 1.34) + } + } + 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_11D_100.csv", replace + +* Scenario 11E : H_1 is TRUE / Effect size 0.4 / DIF on control x2 + + di "Scenario 11E - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.34 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 1.34) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 1.34) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 1.34) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 1.34) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 1.34) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 1.34) + } + } + 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_11E_100.csv", replace + + +* Scenario 11F : H_0 is TRUE / DIF on treatment + DIF on control (other item) + +di "Scenario 11F - N=100" + +forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + while `difi'==`difj' { + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + } + + if `difi'==1 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 0.84) + } + if `difi'==2 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 0.84) + } + if `difi'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 0.84) + } + if `difi'==4 { + mat D= (-0.84 \ -0.25 \ 0.25 \ 1.34) + } + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + if `difj'==1 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 0.84) + } + if `difj'==2 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==4 { + mat D= (-0.84 \ -0.25 \ 0.25 \ 1.34) + } + 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_11F_100.csv", replace + + +* Scenario 11G : H_1 is TRUE / Effect size 0.2 / DIF on treatment + DIF on control (other item) + + di "Scenario 11G - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + while `difi'==`difj' { + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + } + + if `difi'==1 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 0.84) + } + if `difi'==2 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 0.84) + } + if `difi'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 0.84) + } + if `difi'==4 { + mat D= (-0.84 \ -0.25 \ 0.25 \ 1.34) + } + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + if `difj'==1 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 0.84) + } + if `difj'==2 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==4 { + mat D= (-0.84 \ -0.25 \ 0.25 \ 1.34) + } + 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_11G_100.csv", replace + +* Scenario 11H : H_1 is TRUE / Effect size 0.4 / DIF on treatment + DIF on control (other item) + + di "Scenario 11H - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + while `difi'==`difj' { + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + } + + if `difi'==1 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 0.84) + } + if `difi'==2 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 0.84) + } + if `difi'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 0.84) + } + if `difi'==4 { + mat D= (-0.84 \ -0.25 \ 0.25 \ 1.34) + } + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + if `difj'==1 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 0.84) + } + if `difj'==2 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==4 { + mat D= (-0.84 \ -0.25 \ 0.25 \ 1.34) + } + 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_11H_100.csv", replace + + + + + + + + + +** Scenario 12: J = 4 items / M = 4 modalities / DIF SIZE = 0.5 + +* Scenario 12A : H_0 is TRUE / DIF on treatment x 2 + +di "Scenario 12A - N=100" + +forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + 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 + + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.66,1.34,2.34) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.66,1.34,2.34) + } + } + 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_12A_100.csv", replace + + + * Scenario 12B : H_1 is TRUE / Effect size 0.2 / DIF on treatment x2 + + di "Scenario 12B - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + 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 + + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.66,1.34,2.34) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.66,1.34,2.34) + } + } + 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_12B_100.csv", replace + +* Scenario 12C : H_1 is TRUE / Effect size 0.2 / DIF on control x2 + + di "Scenario 12C - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.66,1.34,2.34) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.66,1.34,2.34) + } + } + 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_12C_100.csv", replace + + +* Scenario 12D : H_1 is TRUE / Effect size 0.4 / DIF on treatment x2 + + di "Scenario 12D - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + 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 + + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.66,1.34,2.34) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.66,1.34,2.34) + } + } + 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_12D_100.csv", replace + +* Scenario 12E : H_1 is TRUE / Effect size 0.4 / DIF on control x2 + + di "Scenario 12E - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.66,1.34,2.34) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.66,1.34,2.34) + } + } + 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_12E_100.csv", replace + + +* Scenario 12F : H_0 is TRUE / DIF on treatment + DIF on control (other item) + +di "Scenario 12F - N=100" + +forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + while `difi'==`difj' { + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + } + + if `difi'==1 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difi'==2 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difi'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difi'==4 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + if `difj'==1 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==2 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==4 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + 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_12F_100.csv", replace + + +* Scenario 12G : H_1 is TRUE / Effect size 0.2 / DIF on treatment + DIF on control (other item) + + di "Scenario 12G - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + while `difi'==`difj' { + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + } + + if `difi'==1 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difi'==2 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difi'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difi'==4 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + if `difj'==1 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==2 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==4 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + 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_12G_100.csv", replace + +* Scenario 12H : H_1 is TRUE / Effect size 0.4 / DIF on treatment + DIF on control (other item) + + di "Scenario 12H - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + while `difi'==`difj' { + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + } + + if `difi'==1 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difi'==2 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difi'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difi'==4 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + if `difj'==1 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==2 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==4 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + 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_12H_100.csv", replace + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +*========================== +* Scenarios with : J=7 +*========================== + +************** Scenarios with : DIF on 2 items ************** + +**** Scenarios with : DIF size 0.3 **** diff --git a/Scripts/Scenarios/DIF/scenarios_DIF_baseline_200.do b/Scripts/Scenarios/DIF/scenarios_DIF_baseline_200.do index 682b662..b095902 100644 --- a/Scripts/Scenarios/DIF/scenarios_DIF_baseline_200.do +++ b/Scripts/Scenarios/DIF/scenarios_DIF_baseline_200.do @@ -6,7 +6,7 @@ * * ado-files needed : - simirt (version 4.3 August 29, 2019, available on OSF) * - * outputs : scenario_1,scenario_2,scenario_3,scenario_5, for N=200/200/300 + * outputs : scenario_1,scenario_2,scenario_3,scenario_5, 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' @@ -19,7 +19,7 @@ adopath+"/home/corentin/Documents/These/Recherche/Simulations/Modules/" * Set data output folder path -local path = "/home/corentin/Documents/These/Recherche/Simulations/Data/DIF/N200" +local path = "/home/corentin/Documents/These/Recherche/Simulations/Data/DIF/N100" local Nn = 200 @@ -37,7 +37,7 @@ local Nn = 200 * Scenario 5A : H_0 is TRUE / DIF on treatment -di "Scenario 5A - N=200" +di "Scenario 5A - N=100" forvalues replication = 1/1000 { if mod(`replication',10)==0 { @@ -86,12 +86,12 @@ forvalues replication = 1/1000 { qui save `data',replace } } - export delimited using "`path'/scenario_5A_200.csv", replace + export delimited using "`path'/scenario_5A_100.csv", replace * Scenario 5B : H_1 is TRUE / Effect size 0.2 / DIF on treatment - di "Scenario 5B - N=200" + di "Scenario 5B - N=100" forvalues replication = 1/1000 { if mod(`replication',10)==0 { @@ -140,11 +140,11 @@ forvalues replication = 1/1000 { qui save `data',replace } } - export delimited using "`path'/scenario_5B_200.csv", replace + export delimited using "`path'/scenario_5B_100.csv", replace * Scenario 5C : H_1 is TRUE / Effect size 0.2 / DIF on control - di "Scenario 5C - N=200" + di "Scenario 5C - N=100" forvalues replication = 1/1000 { if mod(`replication',10)==0 { @@ -193,12 +193,12 @@ forvalues replication = 1/1000 { qui save `data',replace } } - export delimited using "`path'/scenario_5C_200.csv", replace + export delimited using "`path'/scenario_5C_100.csv", replace * Scenario 5D : H_1 is TRUE / Effect size 0.4 / DIF on treatment - di "Scenario 5D - N=200" + di "Scenario 5D - N=100" forvalues replication = 1/1000 { if mod(`replication',10)==0 { @@ -247,11 +247,11 @@ forvalues replication = 1/1000 { qui save `data',replace } } - export delimited using "`path'/scenario_5D_200.csv", replace + export delimited using "`path'/scenario_5D_100.csv", replace * Scenario 5E : H_1 is TRUE / Effect size 0.4 / DIF on control - di "Scenario 5E - N=200" + di "Scenario 5E - N=100" forvalues replication = 1/1000 { if mod(`replication',10)==0 { @@ -300,7 +300,7 @@ forvalues replication = 1/1000 { qui save `data',replace } } - export delimited using "`path'/scenario_5E_200.csv", replace + export delimited using "`path'/scenario_5E_100.csv", replace @@ -317,7 +317,7 @@ forvalues replication = 1/1000 { * Scenario 6A : H_0 is TRUE / DIF on treatment -di "Scenario 6A - N=200" +di "Scenario 6A - N=100" forvalues replication = 1/1000 { if mod(`replication',10)==0 { @@ -366,11 +366,11 @@ forvalues replication = 1/1000 { qui save `data',replace } } - export delimited using "`path'/scenario_6A_200.csv", replace + export delimited using "`path'/scenario_6A_100.csv", replace * Scenario 6B : H_1 is TRUE / Effect size 0.2 / DIF on treatment - di "Scenario 6B - N=200" + di "Scenario 6B - N=100" forvalues replication = 1/1000 { if mod(`replication',10)==0 { @@ -419,11 +419,11 @@ forvalues replication = 1/1000 { qui save `data',replace } } - export delimited using "`path'/scenario_6B_200.csv", replace + export delimited using "`path'/scenario_6B_100.csv", replace * Scenario 6C : H_1 is TRUE / Effect size 0.2 / DIF on control - di "Scenario 6C - N=200" + di "Scenario 6C - N=100" forvalues replication = 1/1000 { if mod(`replication',10)==0 { @@ -472,11 +472,11 @@ forvalues replication = 1/1000 { qui save `data',replace } } - export delimited using "`path'/scenario_6C_200.csv", replace + export delimited using "`path'/scenario_6C_100.csv", replace * Scenario 6D : H_1 is TRUE / Effect size 0.4 / DIF on treatment - di "Scenario 6D - N=200" + di "Scenario 6D - N=100" forvalues replication = 1/1000 { if mod(`replication',10)==0 { @@ -525,11 +525,11 @@ forvalues replication = 1/1000 { qui save `data',replace } } - export delimited using "`path'/scenario_6D_200.csv", replace + export delimited using "`path'/scenario_6D_100.csv", replace * Scenario 6E : H_1 is TRUE / Effect size 0.4 / DIF on control - di "Scenario 6E - N=200" + di "Scenario 6E - N=100" forvalues replication = 1/1000 { if mod(`replication',10)==0 { @@ -578,7 +578,7 @@ forvalues replication = 1/1000 { qui save `data',replace } } - export delimited using "`path'/scenario_6E_200.csv", replace + export delimited using "`path'/scenario_6E_100.csv", replace @@ -594,7 +594,7 @@ forvalues replication = 1/1000 { * Scenario 7A : H_0 is TRUE / DIF on treatment -di "Scenario 7A - N=200" +di "Scenario 7A - N=100" forvalues replication = 1/1000 { if mod(`replication',10)==0 { @@ -643,12 +643,12 @@ forvalues replication = 1/1000 { qui save `data',replace } } - export delimited using "`path'/scenario_7A_200.csv", replace + export delimited using "`path'/scenario_7A_100.csv", replace * Scenario 7B : H_1 is TRUE / Effect size 0.2 / DIF on treatment - di "Scenario 7B - N=200" + di "Scenario 7B - N=100" forvalues replication = 1/1000 { if mod(`replication',10)==0 { @@ -697,11 +697,11 @@ forvalues replication = 1/1000 { qui save `data',replace } } - export delimited using "`path'/scenario_7B_200.csv", replace + export delimited using "`path'/scenario_7B_100.csv", replace * Scenario 7C : H_1 is TRUE / Effect size 0.2 / DIF on control - di "Scenario 7C - N=200" + di "Scenario 7C - N=100" forvalues replication = 1/1000 { if mod(`replication',10)==0 { @@ -750,12 +750,12 @@ forvalues replication = 1/1000 { qui save `data',replace } } - export delimited using "`path'/scenario_7C_200.csv", replace + export delimited using "`path'/scenario_7C_100.csv", replace * Scenario 7D : H_1 is TRUE / Effect size 0.4 / DIF on treatment - di "Scenario 7D - N=200" + di "Scenario 7D - N=100" forvalues replication = 1/1000 { if mod(`replication',10)==0 { @@ -804,11 +804,11 @@ forvalues replication = 1/1000 { qui save `data',replace } } - export delimited using "`path'/scenario_7D_200.csv", replace + export delimited using "`path'/scenario_7D_100.csv", replace * Scenario 7E : H_1 is TRUE / Effect size 0.4 / DIF on control - di "Scenario 7E - N=200" + di "Scenario 7E - N=100" forvalues replication = 1/1000 { if mod(`replication',10)==0 { @@ -857,7 +857,7 @@ forvalues replication = 1/1000 { qui save `data',replace } } - export delimited using "`path'/scenario_7E_200.csv", replace + export delimited using "`path'/scenario_7E_100.csv", replace @@ -874,7 +874,7 @@ forvalues replication = 1/1000 { * Scenario 8A : H_0 is TRUE / DIF on treatment -di "Scenario 8A - N=200" +di "Scenario 8A - N=100" forvalues replication = 1/1000 { if mod(`replication',10)==0 { @@ -890,7 +890,7 @@ forvalues replication = 1/1000 { if `difi'==1 { - mat D= (-1.04,-0.04,0.96 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) } if `difi'==2 { mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) @@ -923,11 +923,11 @@ forvalues replication = 1/1000 { qui save `data',replace } } - export delimited using "`path'/scenario_8A_200.csv", replace + export delimited using "`path'/scenario_8A_100.csv", replace * Scenario 8B : H_1 is TRUE / Effect size 0.2 / DIF on treatment - di "Scenario 8B - N=200" + di "Scenario 8B - N=100" forvalues replication = 1/1000 { if mod(`replication',10)==0 { @@ -943,7 +943,7 @@ forvalues replication = 1/1000 { if `difi'==1 { - mat D= (-1.04,-0.04,0.96 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) } if `difi'==2 { mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) @@ -976,11 +976,11 @@ forvalues replication = 1/1000 { qui save `data',replace } } - export delimited using "`path'/scenario_8B_200.csv", replace + export delimited using "`path'/scenario_8B_100.csv", replace * Scenario 8C : H_1 is TRUE / Effect size 0.2 / DIF on control - di "Scenario 8C - N=200" + di "Scenario 8C - N=100" forvalues replication = 1/1000 { if mod(`replication',10)==0 { @@ -989,7 +989,7 @@ forvalues replication = 1/1000 { qui local difi = runiformint(1,4) if `difi'==1 { - mat D= (-1.04,-0.04,0.96 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) } if `difi'==2 { mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) @@ -1029,11 +1029,11 @@ forvalues replication = 1/1000 { qui save `data',replace } } - export delimited using "`path'/scenario_8C_200.csv", replace + export delimited using "`path'/scenario_8C_100.csv", replace * Scenario 8D : H_1 is TRUE / Effect size 0.4 / DIF on treatment - di "Scenario 8D - N=200" + di "Scenario 8D - N=100" forvalues replication = 1/1000 { if mod(`replication',10)==0 { @@ -1049,7 +1049,7 @@ forvalues replication = 1/1000 { if `difi'==1 { - mat D= (-1.04,-0.04,0.96 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) } if `difi'==2 { mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) @@ -1082,11 +1082,11 @@ forvalues replication = 1/1000 { qui save `data',replace } } - export delimited using "`path'/scenario_8D_200.csv", replace + export delimited using "`path'/scenario_8D_100.csv", replace * Scenario 8E : H_1 is TRUE / Effect size 0.4 / DIF on control - di "Scenario 8E - N=200" + di "Scenario 8E - N=100" forvalues replication = 1/1000 { if mod(`replication',10)==0 { @@ -1095,7 +1095,7 @@ forvalues replication = 1/1000 { qui local difi = runiformint(1,4) if `difi'==1 { - mat D= (-1.04,-0.04,0.96 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) } if `difi'==2 { mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) @@ -1135,4 +1135,2725 @@ forvalues replication = 1/1000 { qui save `data',replace } } - export delimited using "`path'/scenario_8E_200.csv", replace + export delimited using "`path'/scenario_8E_100.csv", replace + + + + + + + + + + + + + + +************** Scenarios with : DIF on 2 items ************** + +**** Scenarios with : DIF size 0.3 **** + +** Scenario 9: J = 4 items / M = 2 modalities / DIF SIZE = 0.3 + +* Scenario 9A : H_0 is TRUE / DIF on treatment x 2 + +di "Scenario 9A - N=100" + +forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + 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 + + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.54 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 1.14) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 1.14) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 1.14) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 1.14) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 1.14) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 1.14) + } + } + 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_9A_100.csv", replace + + + * Scenario 9B : H_1 is TRUE / Effect size 0.2 / DIF on treatment x2 + + di "Scenario 9B - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + 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 + + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.54 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 1.14) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 1.14) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 1.14) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 1.14) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 1.14) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 1.14) + } + } + 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_9B_100.csv", replace + +* Scenario 9C : H_1 is TRUE / Effect size 0.2 / DIF on control x2 + + di "Scenario 9C - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.54 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 1.14) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 1.14) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 1.14) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 1.14) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 1.14) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 1.14) + } + } + 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_9C_100.csv", replace + + +* Scenario 9D : H_1 is TRUE / Effect size 0.4 / DIF on treatment x2 + + di "Scenario 9D - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + 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 + + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.54 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 1.14) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 1.14) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 1.14) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 1.14) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 1.14) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 1.14) + } + } + 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_9D_100.csv", replace + +* Scenario 9E : H_1 is TRUE / Effect size 0.4 / DIF on control x2 + + di "Scenario 9E - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.54 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 1.14) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 1.14) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 1.14) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 1.14) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 1.14) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 1.14) + } + } + 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_9E_100.csv", replace + + +* Scenario 9F : H_0 is TRUE / DIF on treatment + DIF on control (other item) + +di "Scenario 9F - N=100" + +forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + while `difi'==`difj' { + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + } + + if `difi'==1 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 0.84) + } + if `difi'==2 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 0.84) + } + if `difi'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 0.84) + } + if `difi'==4 { + mat D= (-0.84 \ -0.25 \ 0.25 \ 1.14) + } + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + if `difj'==1 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 0.84) + } + if `difj'==2 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==4 { + mat D= (-0.84 \ -0.25 \ 0.25 \ 1.14) + } + 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_9F_100.csv", replace + + +* Scenario 9G : H_1 is TRUE / Effect size 0.2 / DIF on treatment + DIF on control (other item) + + di "Scenario 9G - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + while `difi'==`difj' { + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + } + + if `difi'==1 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 0.84) + } + if `difi'==2 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 0.84) + } + if `difi'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 0.84) + } + if `difi'==4 { + mat D= (-0.84 \ -0.25 \ 0.25 \ 1.14) + } + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + if `difj'==1 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 0.84) + } + if `difj'==2 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==4 { + mat D= (-0.84 \ -0.25 \ 0.25 \ 1.14) + } + 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_9G_100.csv", replace + +* Scenario 9H : H_1 is TRUE / Effect size 0.4 / DIF on treatment + DIF on control (other item) + + di "Scenario 9H - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + while `difi'==`difj' { + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + } + + if `difi'==1 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 0.84) + } + if `difi'==2 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 0.84) + } + if `difi'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 0.84) + } + if `difi'==4 { + mat D= (-0.84 \ -0.25 \ 0.25 \ 1.14) + } + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + if `difj'==1 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 0.84) + } + if `difj'==2 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==4 { + mat D= (-0.84 \ -0.25 \ 0.25 \ 1.14) + } + 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_9H_100.csv", replace + + + + + + + + + +** Scenario 10: J = 4 items / M = 4 modalities / DIF SIZE = 0.3 + +* Scenario 10A : H_0 is TRUE / DIF on treatment x 2 + +di "Scenario 10A - N=100" + +forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + 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 + + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.46,1.14,2.14) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.46,1.14,2.14) + } + } + 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_10A_100.csv", replace + + + * Scenario 10B : H_1 is TRUE / Effect size 0.2 / DIF on treatment x2 + + di "Scenario 10B - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + 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 + + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.46,1.14,2.14) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.46,1.14,2.14) + } + } + 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_10B_100.csv", replace + +* Scenario 10C : H_1 is TRUE / Effect size 0.2 / DIF on control x2 + + di "Scenario 10C - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.46,1.14,2.14) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.46,1.14,2.14) + } + } + 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_10C_100.csv", replace + + +* Scenario 10D : H_1 is TRUE / Effect size 0.4 / DIF on treatment x2 + + di "Scenario 10D - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + 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 + + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.46,1.14,2.14) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.46,1.14,2.14) + } + } + 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_10D_100.csv", replace + +* Scenario 10E : H_1 is TRUE / Effect size 0.4 / DIF on control x2 + + di "Scenario 10E - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.46,1.14,2.14) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.46,1.14,2.14) + } + } + 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_10E_100.csv", replace + + +* Scenario 10F : H_0 is TRUE / DIF on treatment + DIF on control (other item) + +di "Scenario 10F - N=100" + +forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + while `difi'==`difj' { + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + } + + if `difi'==1 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difi'==2 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difi'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55 \ 0.16,0.84,1.84) + } + if `difi'==4 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + if `difj'==1 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==2 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55 \ 0.16,0.84,1.84) + } + if `difj'==4 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + 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_10F_100.csv", replace + + +* Scenario 10G : H_1 is TRUE / Effect size 0.2 / DIF on treatment + DIF on control (other item) + + di "Scenario 10G - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + while `difi'==`difj' { + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + } + + if `difi'==1 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difi'==2 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difi'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55 \ 0.16,0.84,1.84) + } + if `difi'==4 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + if `difj'==1 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==2 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55 \ 0.16,0.84,1.84) + } + if `difj'==4 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + 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_10G_100.csv", replace + +* Scenario 10H : H_1 is TRUE / Effect size 0.4 / DIF on treatment + DIF on control (other item) + + di "Scenario 10H - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + while `difi'==`difj' { + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + } + + if `difi'==1 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difi'==2 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difi'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55 \ 0.16,0.84,1.84) + } + if `difi'==4 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + if `difj'==1 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==2 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55 \ 0.16,0.84,1.84) + } + if `difj'==4 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + 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_10H_100.csv", replace + + + + + + + + +**** Scenarios with : DIF size 0.5 **** + +** Scenario 11: J = 4 items / M = 2 modalities / DIF SIZE = 0.5 + +* Scenario 11A : H_0 is TRUE / DIF on treatment x 2 + +di "Scenario 11A - N=100" + +forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + 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 + + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.34 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 1.34) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 1.34) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 1.34) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 1.34) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 1.34) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 1.34) + } + } + 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_11A_100.csv", replace + + + * Scenario 11B : H_1 is TRUE / Effect size 0.2 / DIF on treatment x2 + + di "Scenario 11B - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + 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 + + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.34 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 1.34) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 1.34) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 1.34) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 1.34) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 1.34) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 1.34) + } + } + 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_11B_100.csv", replace + +* Scenario 11C : H_1 is TRUE / Effect size 0.2 / DIF on control x2 + + di "Scenario 11C - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.34 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 1.34) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 1.34) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 1.34) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 1.34) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 1.34) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 1.34) + } + } + 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_11C_100.csv", replace + + +* Scenario 11D : H_1 is TRUE / Effect size 0.4 / DIF on treatment x2 + + di "Scenario 11D - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + 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 + + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.34 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 1.34) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 1.34) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 1.34) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 1.34) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 1.34) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 1.34) + } + } + 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_11D_100.csv", replace + +* Scenario 11E : H_1 is TRUE / Effect size 0.4 / DIF on control x2 + + di "Scenario 11E - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.34 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 1.34) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 1.34) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 1.34) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 1.34) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 1.34) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 1.34) + } + } + 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_11E_100.csv", replace + + +* Scenario 11F : H_0 is TRUE / DIF on treatment + DIF on control (other item) + +di "Scenario 11F - N=100" + +forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + while `difi'==`difj' { + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + } + + if `difi'==1 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 0.84) + } + if `difi'==2 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 0.84) + } + if `difi'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 0.84) + } + if `difi'==4 { + mat D= (-0.84 \ -0.25 \ 0.25 \ 1.34) + } + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + if `difj'==1 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 0.84) + } + if `difj'==2 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==4 { + mat D= (-0.84 \ -0.25 \ 0.25 \ 1.34) + } + 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_11F_100.csv", replace + + +* Scenario 11G : H_1 is TRUE / Effect size 0.2 / DIF on treatment + DIF on control (other item) + + di "Scenario 11G - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + while `difi'==`difj' { + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + } + + if `difi'==1 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 0.84) + } + if `difi'==2 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 0.84) + } + if `difi'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 0.84) + } + if `difi'==4 { + mat D= (-0.84 \ -0.25 \ 0.25 \ 1.34) + } + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + if `difj'==1 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 0.84) + } + if `difj'==2 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==4 { + mat D= (-0.84 \ -0.25 \ 0.25 \ 1.34) + } + 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_11G_100.csv", replace + +* Scenario 11H : H_1 is TRUE / Effect size 0.4 / DIF on treatment + DIF on control (other item) + + di "Scenario 11H - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + while `difi'==`difj' { + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + } + + if `difi'==1 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 0.84) + } + if `difi'==2 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 0.84) + } + if `difi'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 0.84) + } + if `difi'==4 { + mat D= (-0.84 \ -0.25 \ 0.25 \ 1.34) + } + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + if `difj'==1 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 0.84) + } + if `difj'==2 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==4 { + mat D= (-0.84 \ -0.25 \ 0.25 \ 1.34) + } + 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_11H_100.csv", replace + + + + + + + + + +** Scenario 12: J = 4 items / M = 4 modalities / DIF SIZE = 0.5 + +* Scenario 12A : H_0 is TRUE / DIF on treatment x 2 + +di "Scenario 12A - N=100" + +forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + 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 + + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.66,1.34,2.34) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.66,1.34,2.34) + } + } + 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_12A_100.csv", replace + + + * Scenario 12B : H_1 is TRUE / Effect size 0.2 / DIF on treatment x2 + + di "Scenario 12B - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + 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 + + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.66,1.34,2.34) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.66,1.34,2.34) + } + } + 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_12B_100.csv", replace + +* Scenario 12C : H_1 is TRUE / Effect size 0.2 / DIF on control x2 + + di "Scenario 12C - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.66,1.34,2.34) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.66,1.34,2.34) + } + } + 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_12C_100.csv", replace + + +* Scenario 12D : H_1 is TRUE / Effect size 0.4 / DIF on treatment x2 + + di "Scenario 12D - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + 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 + + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.66,1.34,2.34) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.66,1.34,2.34) + } + } + 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_12D_100.csv", replace + +* Scenario 12E : H_1 is TRUE / Effect size 0.4 / DIF on control x2 + + di "Scenario 12E - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.66,1.34,2.34) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.66,1.34,2.34) + } + } + 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_12E_100.csv", replace + + +* Scenario 12F : H_0 is TRUE / DIF on treatment + DIF on control (other item) + +di "Scenario 12F - N=100" + +forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + while `difi'==`difj' { + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + } + + if `difi'==1 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difi'==2 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difi'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difi'==4 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + if `difj'==1 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==2 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==4 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + 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_12F_100.csv", replace + + +* Scenario 12G : H_1 is TRUE / Effect size 0.2 / DIF on treatment + DIF on control (other item) + + di "Scenario 12G - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + while `difi'==`difj' { + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + } + + if `difi'==1 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difi'==2 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difi'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difi'==4 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + if `difj'==1 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==2 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==4 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + 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_12G_100.csv", replace + +* Scenario 12H : H_1 is TRUE / Effect size 0.4 / DIF on treatment + DIF on control (other item) + + di "Scenario 12H - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + while `difi'==`difj' { + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + } + + if `difi'==1 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difi'==2 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difi'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difi'==4 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + if `difj'==1 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==2 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==4 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + 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_12H_100.csv", replace + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +*========================== +* Scenarios with : J=7 +*========================== + +************** Scenarios with : DIF on 2 items ************** + +**** Scenarios with : DIF size 0.3 **** diff --git a/Scripts/Scenarios/DIF/scenarios_DIF_baseline_300.do b/Scripts/Scenarios/DIF/scenarios_DIF_baseline_300.do index d7d4165..d1ce189 100644 --- a/Scripts/Scenarios/DIF/scenarios_DIF_baseline_300.do +++ b/Scripts/Scenarios/DIF/scenarios_DIF_baseline_300.do @@ -19,7 +19,7 @@ adopath+"/home/corentin/Documents/These/Recherche/Simulations/Modules/" * Set data output folder path -local path = "/home/corentin/Documents/These/Recherche/Simulations/Data/DIF/N300" +local path = "/home/corentin/Documents/These/Recherche/Simulations/Data/DIF/N100" local Nn = 300 @@ -890,7 +890,7 @@ forvalues replication = 1/1000 { if `difi'==1 { - mat D= (-1.04,-0.04,0.96 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) } if `difi'==2 { mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) @@ -943,7 +943,7 @@ forvalues replication = 1/1000 { if `difi'==1 { - mat D= (-1.04,-0.04,0.96 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) } if `difi'==2 { mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) @@ -989,7 +989,7 @@ forvalues replication = 1/1000 { qui local difi = runiformint(1,4) if `difi'==1 { - mat D= (-1.04,-0.04,0.96 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) } if `difi'==2 { mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) @@ -1049,7 +1049,7 @@ forvalues replication = 1/1000 { if `difi'==1 { - mat D= (-1.04,-0.04,0.96 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) } if `difi'==2 { mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) @@ -1095,7 +1095,7 @@ forvalues replication = 1/1000 { qui local difi = runiformint(1,4) if `difi'==1 { - mat D= (-1.04,-0.04,0.96 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) } if `difi'==2 { mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) @@ -1136,3 +1136,2724 @@ forvalues replication = 1/1000 { } } export delimited using "`path'/scenario_8E_300.csv", replace + + + + + + + + + + + + + + +************** Scenarios with : DIF on 2 items ************** + +**** Scenarios with : DIF size 0.3 **** + +** Scenario 9: J = 4 items / M = 2 modalities / DIF SIZE = 0.3 + +* Scenario 9A : H_0 is TRUE / DIF on treatment x 2 + +di "Scenario 9A - N=300" + +forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + 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 + + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.54 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 1.14) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 1.14) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 1.14) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 1.14) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 1.14) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 1.14) + } + } + 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_9A_300.csv", replace + + + * Scenario 9B : H_1 is TRUE / Effect size 0.2 / DIF on treatment x2 + + di "Scenario 9B - N=300" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + 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 + + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.54 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 1.14) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 1.14) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 1.14) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 1.14) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 1.14) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 1.14) + } + } + 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_9B_300.csv", replace + +* Scenario 9C : H_1 is TRUE / Effect size 0.2 / DIF on control x2 + + di "Scenario 9C - N=300" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.54 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 1.14) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 1.14) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 1.14) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 1.14) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 1.14) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 1.14) + } + } + 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_9C_300.csv", replace + + +* Scenario 9D : H_1 is TRUE / Effect size 0.4 / DIF on treatment x2 + + di "Scenario 9D - N=300" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + 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 + + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.54 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 1.14) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 1.14) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 1.14) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 1.14) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 1.14) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 1.14) + } + } + 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_9D_300.csv", replace + +* Scenario 9E : H_1 is TRUE / Effect size 0.4 / DIF on control x2 + + di "Scenario 9E - N=300" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.54 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 1.14) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 1.14) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.55 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 1.14) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 1.14) + } + if `difj'==3 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 1.14) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 1.14) + } + } + 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_9E_300.csv", replace + + +* Scenario 9F : H_0 is TRUE / DIF on treatment + DIF on control (other item) + +di "Scenario 9F - N=300" + +forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + while `difi'==`difj' { + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + } + + if `difi'==1 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 0.84) + } + if `difi'==2 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 0.84) + } + if `difi'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 0.84) + } + if `difi'==4 { + mat D= (-0.84 \ -0.25 \ 0.25 \ 1.14) + } + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + if `difj'==1 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 0.84) + } + if `difj'==2 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==4 { + mat D= (-0.84 \ -0.25 \ 0.25 \ 1.14) + } + 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_9F_300.csv", replace + + +* Scenario 9G : H_1 is TRUE / Effect size 0.2 / DIF on treatment + DIF on control (other item) + + di "Scenario 9G - N=300" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + while `difi'==`difj' { + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + } + + if `difi'==1 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 0.84) + } + if `difi'==2 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 0.84) + } + if `difi'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 0.84) + } + if `difi'==4 { + mat D= (-0.84 \ -0.25 \ 0.25 \ 1.14) + } + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + if `difj'==1 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 0.84) + } + if `difj'==2 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==4 { + mat D= (-0.84 \ -0.25 \ 0.25 \ 1.14) + } + 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_9G_300.csv", replace + +* Scenario 9H : H_1 is TRUE / Effect size 0.4 / DIF on treatment + DIF on control (other item) + + di "Scenario 9H - N=300" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + while `difi'==`difj' { + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + } + + if `difi'==1 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 0.84) + } + if `difi'==2 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 0.84) + } + if `difi'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 0.84) + } + if `difi'==4 { + mat D= (-0.84 \ -0.25 \ 0.25 \ 1.14) + } + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + if `difj'==1 { + mat D= (-0.54 \ -0.25 \ 0.25 \ 0.84) + } + if `difj'==2 { + mat D= (-0.84 \ 0.05 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.55 \ 0.84) + } + if `difj'==4 { + mat D= (-0.84 \ -0.25 \ 0.25 \ 1.14) + } + 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_9H_300.csv", replace + + + + + + + + + +** Scenario 10: J = 4 items / M = 4 modalities / DIF SIZE = 0.3 + +* Scenario 10A : H_0 is TRUE / DIF on treatment x 2 + +di "Scenario 10A - N=300" + +forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + 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 + + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.46,1.14,2.14) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.46,1.14,2.14) + } + } + 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_10A_300.csv", replace + + + * Scenario 10B : H_1 is TRUE / Effect size 0.2 / DIF on treatment x2 + + di "Scenario 10B - N=300" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + 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 + + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.46,1.14,2.14) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.46,1.14,2.14) + } + } + 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_10B_300.csv", replace + +* Scenario 10C : H_1 is TRUE / Effect size 0.2 / DIF on control x2 + + di "Scenario 10C - N=300" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.46,1.14,2.14) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.46,1.14,2.14) + } + } + 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_10C_300.csv", replace + + +* Scenario 10D : H_1 is TRUE / Effect size 0.4 / DIF on treatment x2 + + di "Scenario 10D - N=300" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + 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 + + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.46,1.14,2.14) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.46,1.14,2.14) + } + } + 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_10D_300.csv", replace + +* Scenario 10E : H_1 is TRUE / Effect size 0.4 / DIF on control x2 + + di "Scenario 10E - N=300" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.45,0.55,1.55\ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.46,1.14,2.14) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55\ 0.46,1.14,2.14) + } + } + 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_10E_300.csv", replace + + +* Scenario 10F : H_0 is TRUE / DIF on treatment + DIF on control (other item) + +di "Scenario 10F - N=300" + +forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + while `difi'==`difj' { + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + } + + if `difi'==1 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difi'==2 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difi'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55 \ 0.16,0.84,1.84) + } + if `difi'==4 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + if `difj'==1 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==2 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55 \ 0.16,0.84,1.84) + } + if `difj'==4 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + 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_10F_300.csv", replace + + +* Scenario 10G : H_1 is TRUE / Effect size 0.2 / DIF on treatment + DIF on control (other item) + + di "Scenario 10G - N=300" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + while `difi'==`difj' { + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + } + + if `difi'==1 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difi'==2 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difi'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55 \ 0.16,0.84,1.84) + } + if `difi'==4 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + if `difj'==1 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==2 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55 \ 0.16,0.84,1.84) + } + if `difj'==4 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + 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_10G_300.csv", replace + +* Scenario 10H : H_1 is TRUE / Effect size 0.4 / DIF on treatment + DIF on control (other item) + + di "Scenario 10H - N=300" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + while `difi'==`difj' { + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + } + + if `difi'==1 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difi'==2 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difi'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55 \ 0.16,0.84,1.84) + } + if `difi'==4 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + if `difj'==1 { + mat D= (-1.54,-0.54,0.46 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==2 { + mat D= (-1.84,-0.84,0.16 \ -0.95,0.05,1.05 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.45,0.55,1.55 \ 0.16,0.84,1.84) + } + if `difj'==4 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.46,1.14,2.14) + } + 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_10H_300.csv", replace + + + + + + + + +**** Scenarios with : DIF size 0.5 **** + +** Scenario 11: J = 4 items / M = 2 modalities / DIF SIZE = 0.5 + +* Scenario 11A : H_0 is TRUE / DIF on treatment x 2 + +di "Scenario 11A - N=300" + +forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + 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 + + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.34 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 1.34) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 1.34) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 1.34) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 1.34) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 1.34) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 1.34) + } + } + 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_11A_300.csv", replace + + + * Scenario 11B : H_1 is TRUE / Effect size 0.2 / DIF on treatment x2 + + di "Scenario 11B - N=300" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + 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 + + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.34 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 1.34) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 1.34) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 1.34) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 1.34) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 1.34) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 1.34) + } + } + 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_11B_300.csv", replace + +* Scenario 11C : H_1 is TRUE / Effect size 0.2 / DIF on control x2 + + di "Scenario 11C - N=300" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.34 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 1.34) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 1.34) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 1.34) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 1.34) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 1.34) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 1.34) + } + } + 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_11C_300.csv", replace + + +* Scenario 11D : H_1 is TRUE / Effect size 0.4 / DIF on treatment x2 + + di "Scenario 11D - N=300" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + 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 + + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.34 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 1.34) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 1.34) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 1.34) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 1.34) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 1.34) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 1.34) + } + } + 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_11D_300.csv", replace + +* Scenario 11E : H_1 is TRUE / Effect size 0.4 / DIF on control x2 + + di "Scenario 11E - N=300" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.34 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 1.34) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 1.34) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.75 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 1.34) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 1.34) + } + if `difj'==3 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 1.34) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 1.34) + } + } + 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_11E_300.csv", replace + + +* Scenario 11F : H_0 is TRUE / DIF on treatment + DIF on control (other item) + +di "Scenario 11F - N=300" + +forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + while `difi'==`difj' { + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + } + + if `difi'==1 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 0.84) + } + if `difi'==2 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 0.84) + } + if `difi'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 0.84) + } + if `difi'==4 { + mat D= (-0.84 \ -0.25 \ 0.25 \ 1.34) + } + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + if `difj'==1 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 0.84) + } + if `difj'==2 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==4 { + mat D= (-0.84 \ -0.25 \ 0.25 \ 1.34) + } + 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_11F_300.csv", replace + + +* Scenario 11G : H_1 is TRUE / Effect size 0.2 / DIF on treatment + DIF on control (other item) + + di "Scenario 11G - N=300" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + while `difi'==`difj' { + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + } + + if `difi'==1 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 0.84) + } + if `difi'==2 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 0.84) + } + if `difi'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 0.84) + } + if `difi'==4 { + mat D= (-0.84 \ -0.25 \ 0.25 \ 1.34) + } + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + if `difj'==1 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 0.84) + } + if `difj'==2 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==4 { + mat D= (-0.84 \ -0.25 \ 0.25 \ 1.34) + } + 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_11G_300.csv", replace + +* Scenario 11H : H_1 is TRUE / Effect size 0.4 / DIF on treatment + DIF on control (other item) + + di "Scenario 11H - N=300" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + while `difi'==`difj' { + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + } + + if `difi'==1 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 0.84) + } + if `difi'==2 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 0.84) + } + if `difi'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 0.84) + } + if `difi'==4 { + mat D= (-0.84 \ -0.25 \ 0.25 \ 1.34) + } + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + if `difj'==1 { + mat D= (-0.34 \ -0.25 \ 0.25 \ 0.84) + } + if `difj'==2 { + mat D= (-0.84 \ 0.25 \ 0.25 \ 0.84) + } + if `difj'==3 { + mat D= (-0.84 \ -0.25 \ 0.75 \ 0.84) + } + if `difj'==4 { + mat D= (-0.84 \ -0.25 \ 0.25 \ 1.34) + } + 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_11H_300.csv", replace + + + + + + + + + +** Scenario 12: J = 4 items / M = 4 modalities / DIF SIZE = 0.5 + +* Scenario 12A : H_0 is TRUE / DIF on treatment x 2 + +di "Scenario 12A - N=300" + +forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + 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 + + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.66,1.34,2.34) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.66,1.34,2.34) + } + } + 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_12A_300.csv", replace + + + * Scenario 12B : H_1 is TRUE / Effect size 0.2 / DIF on treatment x2 + + di "Scenario 12B - N=300" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + 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 + + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.66,1.34,2.34) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.66,1.34,2.34) + } + } + 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_12B_300.csv", replace + +* Scenario 12C : H_1 is TRUE / Effect size 0.2 / DIF on control x2 + + di "Scenario 12C - N=300" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.66,1.34,2.34) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.66,1.34,2.34) + } + } + 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_12C_300.csv", replace + + +* Scenario 12D : H_1 is TRUE / Effect size 0.4 / DIF on treatment x2 + + di "Scenario 12D - N=300" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + 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 + + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.66,1.34,2.34) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.66,1.34,2.34) + } + } + 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_12D_300.csv", replace + +* Scenario 12E : H_1 is TRUE / Effect size 0.4 / DIF on control x2 + + di "Scenario 12E - N=300" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + if `difi'==1 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + } + if `difi'==2 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + } + if `difi'==3 { + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.66,1.34,2.34) + } + } + if `difi'==4 { + qui local difj = runiformint(2,4) + qui local difj = runiformint(2,4) + if `difj'==2 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.66,1.34,2.34) + } + } + 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_12E_300.csv", replace + + +* Scenario 12F : H_0 is TRUE / DIF on treatment + DIF on control (other item) + +di "Scenario 12F - N=300" + +forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + while `difi'==`difj' { + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + } + + if `difi'==1 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difi'==2 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difi'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difi'==4 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + if `difj'==1 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==2 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==4 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + 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_12F_300.csv", replace + + +* Scenario 12G : H_1 is TRUE / Effect size 0.2 / DIF on treatment + DIF on control (other item) + + di "Scenario 12G - N=300" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + while `difi'==`difj' { + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + } + + if `difi'==1 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difi'==2 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difi'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difi'==4 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + if `difj'==1 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==2 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==4 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + 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_12G_300.csv", replace + +* Scenario 12H : H_1 is TRUE / Effect size 0.4 / DIF on treatment + DIF on control (other item) + + di "Scenario 12H - N=300" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + while `difi'==`difj' { + qui local difi = runiformint(1,4) + qui local difj = runiformint(1,4) + } + + if `difi'==1 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difi'==2 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difi'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difi'==4 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + if `difj'==1 { + mat D= (-1.34,-0.34,0.66 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==2 { + mat D= (-1.84,-0.84,0.16 \ -0.75,0.25,1.25 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + } + if `difj'==3 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.25,0.75,1.75 \ 0.16,0.84,1.84) + } + if `difj'==4 { + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.66,1.34,2.34) + } + 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_12H_300.csv", replace + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +*========================== +* Scenarios with : J=7 +*========================== + +************** Scenarios with : DIF on 2 items ************** + +**** Scenarios with : DIF size 0.3 ****