Created difficulty matrix generation R script + initial scenarios
This commit is contained in:
78
Scripts/Scenarios/NoDIF/scenarios_noDIF_baseline.do
Normal file
78
Scripts/Scenarios/NoDIF/scenarios_noDIF_baseline.do
Normal file
@ -0,0 +1,78 @@
|
||||
*=================================================================================================================================================
|
||||
* 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 : TBA
|
||||
*
|
||||
*
|
||||
* 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/simirt.ado"
|
||||
|
||||
* Set data output folder path
|
||||
local path = "/home/corentin/Documents/These/Recherche/Simulations/Data"
|
||||
|
||||
|
||||
|
||||
* Scenarios with : n = 800
|
||||
*==========================
|
||||
|
||||
* Scenario No. 7 : J = 4 items + C1 et C2 not correlated
|
||||
|
||||
forvalues replication = 1/500 {
|
||||
di "replication = `replication'"
|
||||
mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75\-0.75,0.25,1.25 \-0.16,0.84,1.84)
|
||||
qui simirt, nbobs(200) mu(0) cov(1) dim(4) pcm(D) clear
|
||||
qui gen C1 = 0
|
||||
qui gen C2 = 0
|
||||
tempfile grp00
|
||||
qui save `grp00',replace
|
||||
|
||||
mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75\-0.75,0.25,1.25 \-0.16,0.84,1.84)
|
||||
qui simirt, nbobs(200) mu(0) cov(1) dim(4) pcm(D) clear
|
||||
qui gen C1 = 1
|
||||
qui gen C2 = 0
|
||||
tempfile grp10
|
||||
qui save `grp10',replace
|
||||
|
||||
mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75\-0.75,0.25,1.25 \-0.16,0.84,1.84)
|
||||
qui simirt, nbobs(200) mu(0) cov(1) dim(4) pcm(D) clear
|
||||
qui gen C1 = 0
|
||||
qui gen C2 = 1
|
||||
tempfile grp01
|
||||
qui save `grp01',replace
|
||||
|
||||
mat D= (-1.84,-0.84,0.16 \ -1.25,-0.25,0.75\-0.75,0.25,1.25 \-0.16,0.84,1.84)
|
||||
qui simirt, nbobs(200) mu(0) cov(1) dim(4) pcm(D) clear
|
||||
qui gen C1 = 1
|
||||
qui gen C2 = 1
|
||||
tempfile grp11
|
||||
qui save `grp11',replace
|
||||
|
||||
clear
|
||||
use `grp00'
|
||||
qui append using `grp10'
|
||||
qui append using `grp01'
|
||||
qui append using `grp11'
|
||||
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'\Scenario7.csv", replace
|
Reference in New Issue
Block a user