@ -151,6 +151,8 @@ if (`group'!=0|`deltagroup'!=0)&`dim'!=1 {
exit
exit
}
}
if "`prefix'"=="" {
if "`prefix'"=="" {
local prefix item
local prefix item
}
}
@ -172,6 +174,17 @@ else {
local prefix`d' `prefix'`tmp'
local prefix`d' `prefix'`tmp'
}
}
}
}
if "`covmatrix'"=="" {
if "`covmatrix'"=="" {
tempname covmatrix2
tempname covmatrix2
local nbcov:word count `cov'
local nbcov:word count `cov'
@ -191,6 +204,15 @@ if "`covmatrix'"=="" {
}
}
matrix `covmatrix2'=(`cov')
matrix `covmatrix2'=(`cov')
}
}
else if `dim'==2 {
else if `dim'==2 {
if `nbcov'!=3&`nbcov'>0 {
if `nbcov'!=3&`nbcov'>0 {
di in red "You simulate two dimensions. You must indicate exactly 3 values in the {hi:cov} option (Variance of the first simulated latent trait, Variance of the second simulated latent trait, Covariance between the two simulated latent traits)."
di in red "You simulate two dimensions. You must indicate exactly 3 values in the {hi:cov} option (Variance of the first simulated latent trait, Variance of the second simulated latent trait, Covariance between the two simulated latent traits)."
@ -222,6 +244,13 @@ if "`covmatrix'"=="" {
local covmatrix `covmatrix2'
local covmatrix `covmatrix2'
}
}
local nbmu:word count `mu'
local nbmu:word count `mu'
if `nbmu'!=`dim'&`nbmu'!=0 {
if `nbmu'!=`dim'&`nbmu'!=0 {
di in red "You must indicate as many values in the {hi:mu} option as the number of dimension(s) (`dim')"
di in red "You must indicate as many values in the {hi:mu} option as the number of dimension(s) (`dim')"
@ -316,6 +345,10 @@ while $seed>2^31-1 {
qui set seed $seed
qui set seed $seed
if "`typediff'"=="uniform" {
if "`typediff'"=="uniform" {
if `nbdiff'==`=`dim'*2+1' {
if `nbdiff'==`=`dim'*2+1' {
local min`d':word `=(`d'-1)*2+2' of `diff'
local min`d':word `=(`d'-1)*2+2' of `diff'
@ -336,6 +369,14 @@ if "`typediff'"=="uniform" {
}
}
}
}
}
}
else if "`typediff'"=="gauss" {
else if "`typediff'"=="gauss" {
if `nbdiff'==`=`dim'*2+1' {
if `nbdiff'==`=`dim'*2+1' {
forvalues d=1/`dim' {
forvalues d=1/`dim' {
@ -363,6 +404,12 @@ else if "`typediff'"=="gauss" {