diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..afed073 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.csv diff --git a/Scripts/Scenarios/DIF/scenarios_DIF_baseline_100.do b/Scripts/Scenarios/DIF/scenarios_DIF_baseline_100.do new file mode 100644 index 0000000..41605d2 --- /dev/null +++ b/Scripts/Scenarios/DIF/scenarios_DIF_baseline_100.do @@ -0,0 +1,1138 @@ +*================================================================================================================================================= +* Date : 2024-01-04 +* Stata version : Stata 18 SE +* +* This program creates dataset without DIF for a randomized controlled trial scenario +* +* ado-files needed : - simirt (version 4.3 August 29, 2019, available on OSF) +* + * outputs : scenario_1,scenario_2,scenario_3,scenario_4, for N=100/200/300 +* +* +* Warning : To obtain reproduce the data obtained in the .csv files in this repository, use 'simirt_setseed.ado' instead of 'simirt.ado' +* +* +*================================================================================================================================================ + +* Load simirt.ado +adopath+"/home/corentin/Documents/These/Recherche/Simulations/Modules/" + +* Set data output folder path + +local path = "/home/corentin/Documents/These/Recherche/Simulations/Data/DIF/N100" +local Nn = 100 + + + + +*========================== +* Scenarios with : J=4 +*========================== + +************** Scenarios with : DIF on 1 item ************** + +**** Scenarios with : DIF size 0.3 **** + +** Scenario 4: J = 4 items / M = 2 modalities / DIF SIZE = 0.3 + +* Scenario 4A : H_0 is TRUE / DIF on treatment + +di "SCENARIO 4A - 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 { + 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 = 1 + tempfile grp1 + qui save `grp1',replace + + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_4A_100.csv", replace + + + * Scenario 4B : H_1 is TRUE / Effect size 0.2 / DIF on treatment + + di "SCENARIO 4B - 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 { + 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.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_4B_100.csv", replace + +* Scenario 4C : H_1 is TRUE / Effect size 0.2 / DIF on control + + di "SCENARIO 4C - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = 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 + + + 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_4C_100.csv", replace + + +* Scenario 4D : H_1 is TRUE / Effect size 0.4 / DIF on treatment + + di "SCENARIO 4D - 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 { + 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.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_4D_100.csv", replace + +* Scenario 4E : H_1 is TRUE / Effect size 0.4 / DIF on control + + di "SCENARIO 4E - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = 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 + + + 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_4E_100.csv", replace + + + + + + + + + + + + +** Scenario 5: J = 4 items / M = 4 modalities / DIF SIZE = 0.3 + +* Scenario 5A : H_0 is TRUE / DIF on treatment + +di "SCENARIO 5A - N=100" + +forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + 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 = 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_5A_100.csv", replace + +* Scenario 5B : H_1 is TRUE / Effect size 0.2 / DIF on treatment + + di "SCENARIO 5B - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + 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.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_5B_100.csv", replace + +* Scenario 5C : H_1 is TRUE / Effect size 0.2 / DIF on control + + di "SCENARIO 5C - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = 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 + + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(`Nn') mu(0.2) cov(1) dim(4) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_5C_100.csv", replace + +* Scenario 5D : H_1 is TRUE / Effect size 0.4 / DIF on treatment + + di "SCENARIO 5D - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + 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.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_5D_100.csv", replace + +* Scenario 5E : H_1 is TRUE / Effect size 0.4 / DIF on control + + di "SCENARIO 5E - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = 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 + + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(`Nn') mu(0.4) cov(1) dim(4) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_5E_100.csv", replace + + + + +**** ---------------------------------------------------------------------------------------------------------------------------------- **** + + + + +**** Scenarios with : DIF size 0.5 **** + +** Scenario 6: J = 4 items / M = 2 modalities / DIF SIZE = 0.5 + +* Scenario 6A : H_0 is TRUE / DIF on treatment + +di "SCENARIO 6A - 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 { + 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 = 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_6A_100.csv", replace + + + * Scenario 6B : H_1 is TRUE / Effect size 0.2 / DIF on treatment + + di "SCENARIO 6B - 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 { + 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.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_6B_100.csv", replace + +* Scenario 6C : H_1 is TRUE / Effect size 0.2 / DIF on control + + di "SCENARIO 6C - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = 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 + + + 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_6C_100.csv", replace + + +* Scenario 6D : H_1 is TRUE / Effect size 0.4 / DIF on treatment + + di "SCENARIO 6D - 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 { + 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.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_6D_100.csv", replace + +* Scenario 6E : H_1 is TRUE / Effect size 0.4 / DIF on control + + di "SCENARIO 6E - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = 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 + + + 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_6E_100.csv", replace + + + + + + + + + + + + +** Scenario 7: J = 4 items / M = 4 modalities / DIF SIZE = 0.5 + +* Scenario 7A : H_0 is TRUE / DIF on treatment + +di "SCENARIO 7A - N=100" + +forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + 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) + } + 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 = 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_7A_100.csv", replace + +* Scenario 7B : H_1 is TRUE / Effect size 0.2 / DIF on treatment + + di "SCENARIO 7B - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + 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) + } + 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.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_7B_100.csv", replace + +* Scenario 7C : H_1 is TRUE / Effect size 0.2 / DIF on control + + di "SCENARIO 7C - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + 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) + } + 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 + + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(`Nn') mu(0.2) cov(1) dim(4) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_7C_100.csv", replace + +* Scenario 7D : H_1 is TRUE / Effect size 0.4 / DIF on treatment + + di "SCENARIO 7D - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + 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) + } + 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.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_7D_100.csv", replace + +* Scenario 7E : H_1 is TRUE / Effect size 0.4 / DIF on control + + di "SCENARIO 7E - N=100" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + 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) + } + 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 + + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(`Nn') mu(0.4) cov(1) dim(4) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_7E_100.csv", replace diff --git a/Scripts/Scenarios/DIF/scenarios_DIF_baseline_200.do b/Scripts/Scenarios/DIF/scenarios_DIF_baseline_200.do new file mode 100644 index 0000000..ae06492 --- /dev/null +++ b/Scripts/Scenarios/DIF/scenarios_DIF_baseline_200.do @@ -0,0 +1,1138 @@ +*================================================================================================================================================= +* Date : 2024-01-04 +* Stata version : Stata 18 SE +* +* This program creates dataset without DIF for a randomized controlled trial scenario +* +* ado-files needed : - simirt (version 4.3 August 29, 2019, available on OSF) +* + * outputs : scenario_1,scenario_2,scenario_3,scenario_4, for N=200/200/300 +* +* +* Warning : To obtain reproduce the data obtained in the .csv files in this repository, use 'simirt_setseed.ado' instead of 'simirt.ado' +* +* +*================================================================================================================================================ + +* Load simirt.ado +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 Nn = 200 + + + + +*========================== +* Scenarios with : J=4 +*========================== + +************** Scenarios with : DIF on 1 item ************** + +**** Scenarios with : DIF size 0.3 **** + +** Scenario 4: J = 4 items / M = 2 modalities / DIF SIZE = 0.3 + +* Scenario 4A : H_0 is TRUE / DIF on treatment + +di "SCENARIO 4A - N=200" + +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 { + 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 = 1 + tempfile grp1 + qui save `grp1',replace + + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_4A_200.csv", replace + + + * Scenario 4B : H_1 is TRUE / Effect size 0.2 / DIF on treatment + + di "SCENARIO 4B - N=200" + + 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 { + 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.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_4B_200.csv", replace + +* Scenario 4C : H_1 is TRUE / Effect size 0.2 / DIF on control + + di "SCENARIO 4C - N=200" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = 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 + + + 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_4C_200.csv", replace + + +* Scenario 4D : H_1 is TRUE / Effect size 0.4 / DIF on treatment + + di "SCENARIO 4D - N=200" + + 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 { + 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.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_4D_200.csv", replace + +* Scenario 4E : H_1 is TRUE / Effect size 0.4 / DIF on control + + di "SCENARIO 4E - N=200" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = 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 + + + 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_4E_200.csv", replace + + + + + + + + + + + + +** Scenario 5: J = 4 items / M = 4 modalities / DIF SIZE = 0.3 + +* Scenario 5A : H_0 is TRUE / DIF on treatment + +di "SCENARIO 5A - N=200" + +forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + 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 = 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_5A_200.csv", replace + +* Scenario 5B : H_1 is TRUE / Effect size 0.2 / DIF on treatment + + di "SCENARIO 5B - N=200" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + 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.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_5B_200.csv", replace + +* Scenario 5C : H_1 is TRUE / Effect size 0.2 / DIF on control + + di "SCENARIO 5C - N=200" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = 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 + + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(`Nn') mu(0.2) cov(1) dim(4) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_5C_200.csv", replace + +* Scenario 5D : H_1 is TRUE / Effect size 0.4 / DIF on treatment + + di "SCENARIO 5D - N=200" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + 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.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_5D_200.csv", replace + +* Scenario 5E : H_1 is TRUE / Effect size 0.4 / DIF on control + + di "SCENARIO 5E - N=200" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = 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 + + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(`Nn') mu(0.4) cov(1) dim(4) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_5E_200.csv", replace + + + + +**** ---------------------------------------------------------------------------------------------------------------------------------- **** + + + + +**** Scenarios with : DIF size 0.5 **** + +** Scenario 6: J = 4 items / M = 2 modalities / DIF SIZE = 0.5 + +* Scenario 6A : H_0 is TRUE / DIF on treatment + +di "SCENARIO 6A - N=200" + +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 { + 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 = 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_6A_200.csv", replace + + + * Scenario 6B : H_1 is TRUE / Effect size 0.2 / DIF on treatment + + di "SCENARIO 6B - N=200" + + 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 { + 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.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_6B_200.csv", replace + +* Scenario 6C : H_1 is TRUE / Effect size 0.2 / DIF on control + + di "SCENARIO 6C - N=200" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = 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 + + + 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_6C_200.csv", replace + + +* Scenario 6D : H_1 is TRUE / Effect size 0.4 / DIF on treatment + + di "SCENARIO 6D - N=200" + + 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 { + 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.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_6D_200.csv", replace + +* Scenario 6E : H_1 is TRUE / Effect size 0.4 / DIF on control + + di "SCENARIO 6E - N=200" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = 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 + + + 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_6E_200.csv", replace + + + + + + + + + + + + +** Scenario 7: J = 4 items / M = 4 modalities / DIF SIZE = 0.5 + +* Scenario 7A : H_0 is TRUE / DIF on treatment + +di "SCENARIO 7A - N=200" + +forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + 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) + } + 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 = 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_7A_200.csv", replace + +* Scenario 7B : H_1 is TRUE / Effect size 0.2 / DIF on treatment + + di "SCENARIO 7B - N=200" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + 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) + } + 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.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_7B_200.csv", replace + +* Scenario 7C : H_1 is TRUE / Effect size 0.2 / DIF on control + + di "SCENARIO 7C - N=200" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + 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) + } + 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 + + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(`Nn') mu(0.2) cov(1) dim(4) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_7C_200.csv", replace + +* Scenario 7D : H_1 is TRUE / Effect size 0.4 / DIF on treatment + + di "SCENARIO 7D - N=200" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + 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) + } + 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.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_7D_200.csv", replace + +* Scenario 7E : H_1 is TRUE / Effect size 0.4 / DIF on control + + di "SCENARIO 7E - N=200" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + 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) + } + 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 + + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(`Nn') mu(0.4) cov(1) dim(4) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_7E_200.csv", replace diff --git a/Scripts/Scenarios/DIF/scenarios_DIF_baseline_300.do b/Scripts/Scenarios/DIF/scenarios_DIF_baseline_300.do new file mode 100644 index 0000000..caccc0e --- /dev/null +++ b/Scripts/Scenarios/DIF/scenarios_DIF_baseline_300.do @@ -0,0 +1,1138 @@ +*================================================================================================================================================= +* Date : 2024-01-04 +* Stata version : Stata 18 SE +* +* This program creates dataset without DIF for a randomized controlled trial scenario +* +* ado-files needed : - simirt (version 4.3 August 29, 2019, available on OSF) +* + * outputs : scenario_1,scenario_2,scenario_3,scenario_4, for N=300/200/300 +* +* +* Warning : To obtain reproduce the data obtained in the .csv files in this repository, use 'simirt_setseed.ado' instead of 'simirt.ado' +* +* +*================================================================================================================================================ + +* Load simirt.ado +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 Nn = 300 + + + + +*========================== +* Scenarios with : J=4 +*========================== + +************** Scenarios with : DIF on 1 item ************** + +**** Scenarios with : DIF size 0.3 **** + +** Scenario 4: J = 4 items / M = 2 modalities / DIF SIZE = 0.3 + +* Scenario 4A : H_0 is TRUE / DIF on treatment + +di "SCENARIO 4A - 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 { + 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 = 1 + tempfile grp1 + qui save `grp1',replace + + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_4A_300.csv", replace + + + * Scenario 4B : H_1 is TRUE / Effect size 0.2 / DIF on treatment + + di "SCENARIO 4B - 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 { + 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.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_4B_300.csv", replace + +* Scenario 4C : H_1 is TRUE / Effect size 0.2 / DIF on control + + di "SCENARIO 4C - N=300" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = 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 + + + 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_4C_300.csv", replace + + +* Scenario 4D : H_1 is TRUE / Effect size 0.4 / DIF on treatment + + di "SCENARIO 4D - 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 { + 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.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_4D_300.csv", replace + +* Scenario 4E : H_1 is TRUE / Effect size 0.4 / DIF on control + + di "SCENARIO 4E - N=300" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = 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 + + + 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_4E_300.csv", replace + + + + + + + + + + + + +** Scenario 5: J = 4 items / M = 4 modalities / DIF SIZE = 0.3 + +* Scenario 5A : H_0 is TRUE / DIF on treatment + +di "SCENARIO 5A - N=300" + +forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + 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 = 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_5A_300.csv", replace + +* Scenario 5B : H_1 is TRUE / Effect size 0.2 / DIF on treatment + + di "SCENARIO 5B - N=300" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + 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.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_5B_300.csv", replace + +* Scenario 5C : H_1 is TRUE / Effect size 0.2 / DIF on control + + di "SCENARIO 5C - N=300" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = 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 + + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(`Nn') mu(0.2) cov(1) dim(4) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_5C_300.csv", replace + +* Scenario 5D : H_1 is TRUE / Effect size 0.4 / DIF on treatment + + di "SCENARIO 5D - N=300" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + 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.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_5D_300.csv", replace + +* Scenario 5E : H_1 is TRUE / Effect size 0.4 / DIF on control + + di "SCENARIO 5E - N=300" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = 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 + + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(`Nn') mu(0.4) cov(1) dim(4) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_5E_300.csv", replace + + + + +**** ---------------------------------------------------------------------------------------------------------------------------------- **** + + + + +**** Scenarios with : DIF size 0.5 **** + +** Scenario 6: J = 4 items / M = 2 modalities / DIF SIZE = 0.5 + +* Scenario 6A : H_0 is TRUE / DIF on treatment + +di "SCENARIO 6A - 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 { + 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 = 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_6A_300.csv", replace + + + * Scenario 6B : H_1 is TRUE / Effect size 0.2 / DIF on treatment + + di "SCENARIO 6B - 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 { + 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.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_6B_300.csv", replace + +* Scenario 6C : H_1 is TRUE / Effect size 0.2 / DIF on control + + di "SCENARIO 6C - N=300" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = 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 + + + 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_6C_300.csv", replace + + +* Scenario 6D : H_1 is TRUE / Effect size 0.4 / DIF on treatment + + di "SCENARIO 6D - 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 { + 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.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_6D_300.csv", replace + +* Scenario 6E : H_1 is TRUE / Effect size 0.4 / DIF on control + + di "SCENARIO 6E - N=300" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = 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 + + + 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_6E_300.csv", replace + + + + + + + + + + + + +** Scenario 7: J = 4 items / M = 4 modalities / DIF SIZE = 0.5 + +* Scenario 7A : H_0 is TRUE / DIF on treatment + +di "SCENARIO 7A - N=300" + +forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + 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) + } + 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 = 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_7A_300.csv", replace + +* Scenario 7B : H_1 is TRUE / Effect size 0.2 / DIF on treatment + + di "SCENARIO 7B - N=300" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + 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) + } + 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.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_7B_300.csv", replace + +* Scenario 7C : H_1 is TRUE / Effect size 0.2 / DIF on control + + di "SCENARIO 7C - N=300" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + 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) + } + 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 + + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(`Nn') mu(0.2) cov(1) dim(4) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_7C_300.csv", replace + +* Scenario 7D : H_1 is TRUE / Effect size 0.4 / DIF on treatment + + di "SCENARIO 7D - N=300" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + qui local difi = runiformint(1,4) + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear + qui gen TT = 0 + tempfile grp0 + qui save `grp0',replace + + + 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) + } + 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.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_7D_300.csv", replace + +* Scenario 7E : H_1 is TRUE / Effect size 0.4 / DIF on control + + di "SCENARIO 7E - N=300" + + forvalues replication = 1/1000 { + if mod(`replication',10)==0 { + di "replication = `replication'" + } + 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) + } + 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 + + + mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75 \ -0.75,0.25,1.25 \ 0.16,0.84,1.84) + qui simirt, nbobs(`Nn') mu(0.4) cov(1) dim(4) pcm(D) clear + qui gen TT = 1 + tempfile grp1 + qui save `grp1',replace + + + clear + use `grp0' + qui append using `grp1' + drop id + qui gen id = _n + order(id) + qui gen replication = `replication' + if `replication'==1{ + tempfile data + qui save `data' + } + else{ + qui append using `data' + qui save `data',replace + } + } + export delimited using "`path'/scenario_7E_300.csv", replace diff --git a/Scripts/Scenarios/NoDIF/scenarios_noDIF_baseline.do b/Scripts/Scenarios/NoDIF/scenarios_noDIF_baseline.do index d3ab757..7362cb7 100644 --- a/Scripts/Scenarios/NoDIF/scenarios_noDIF_baseline.do +++ b/Scripts/Scenarios/NoDIF/scenarios_noDIF_baseline.do @@ -38,7 +38,6 @@ forvalues replication = 1/1000 { if mod(`replication',10)==0 { di "replication = `replication'" } - di "replication = `replication'" mat D= (-0.84 \ -0.25 \ 0.25 \ 0.84) qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear qui gen TT = 0 diff --git a/Scripts/Scenarios/NoDIF/scenarios_noDIF_baseline_100.do b/Scripts/Scenarios/NoDIF/scenarios_noDIF_baseline_100.do index 39da9b3..65f1502 100644 --- a/Scripts/Scenarios/NoDIF/scenarios_noDIF_baseline_100.do +++ b/Scripts/Scenarios/NoDIF/scenarios_noDIF_baseline_100.do @@ -38,7 +38,6 @@ forvalues replication = 1/1000 { if mod(`replication',10)==0 { di "replication = `replication'" } - di "replication = `replication'" mat D= (-0.84 \ -0.25 \ 0.25 \ 0.84) qui simirt, nbobs(`Nn') mu(0) cov(1) dim(4) pcm(D) clear qui gen TT = 0