Computed theoretical power for N=100 and N=200 scenarios

This commit is contained in:
2024-02-19 18:35:26 +01:00
parent ac9189d26a
commit 238852b08b
704 changed files with 261610 additions and 187 deletions

View File

@ -0,0 +1,36 @@
program define raschres,rclass
syntax varlist [, resname(string)]
tempname diff theta
matrix `diff'=r(beta)
matrix `theta'=r(theta)
if "`resname'"=="" {
local resname=res
}
tokenize `varlist'
local nbitems: word count `varlist'
tempname score lt
genscore `varlist',score(`score')
gen `lt'=.
forvalues i=0/`nbitems' {
replace `lt'=`theta'[1,`i'] if `score'==`i'
}
forvalues i=1/`nbitems'{
tempname p`i' res`i'
gen `p`i''=exp(`lt'-`diff'[1,`i'])/(1+exp(`lt'-`diff'[1,`i'])
gen `resname'`i'=(1-`p`i'')/sqrt(`p`i''*(1-`p`i''))
}
pca `resname'*
end