Computed theoretical power for N=100 and N=200 scenarios
This commit is contained in:
Modules/ado
personal
_
a
b
bidonc
calcscore.adocalcul.adocfa.adocheckfor2.adocheckfor2.hlpcheckvars.adocheckvars.hlpclv.adoclv.sthlpclv212.adoclv214.adoclv215.adoclv216.adoclv27.adoclv29.adocompart.adocompart2.adoconc.adoconvdiv.ado
d
dege.adodelta.adodescitems.adodescscale.adodescscalev1.1.adodescscalev1.adodetect.adodetect.hlpdetect2.adodropmissing.ado
e
files
Pop8204Dep.dtacantons.dtacommpct.dtacommunes.dtacommze.dtadccentre8002.dtadcfrance8002.dtanais8003.dtarpf829099.dtarph829099.dtarphf829099.dta
g
gammasym.adogammasym.hlpgausshermite.adogausshermite.hlpgausshermite1.adogausshermite2.adogausshermite3.adogeekel2d.adogeekel2d.hlpgeekel2d4.adogengroup.adogengroup.hlpgengutt.adogenscore.adogenscore.hlpguttmax.adoguttmax1.ado
grec
h
i
imputeitems - Copie.adoimputeitems v2.4.adoimputeitems.adoimputeitems.hlpimputeitems.txtimputeitems2.adoimputeitems_1.adoimputemok.adoimputemok.hlpimputerasch.adoimputerasch.hlpirtpoly.adoisvar.ado
k
l
loevH7.adoloevH72.adoloevH73.adoloevH73.hlploevHv1.hlploevh - Copie au 17 juin 2017.adoloevh v8.2.adoloevh.adoloevh.hlploevh8-1-3.adoloevh8.adoloevh81.adoloevh812.ziploevh813.adoloevh82.adolstrfun.ado
m
Multirsoort_indicefit.adomatrixlisthtml.adomdreplace.adomi_twoway.adomi_twoway.hlpmmsrm.adommsrm.hlpmmsrm2.adomsp.adomsp.hlpmsp66.adomsp66.hlpmsp82.ado
n
p
pcm - Copie.adopcm 3.4.adopcm 4.0.adopcm 4.1.adopcm 4.2 sauv le 8nov2019.adopcm 4.2.adopcm 5.1.adopcm 5.2.adopcm 5.3.adopcm 5.4.adopcm.adopcm.sthlppcm.zippcm21.adopcm22.adopcm23.adopcm3.2.adopcm3.3.adopcm3.adopcm44.adopcm5.adopcmodel.hlppcmodel.sthlppcmodel22.adopcmodel_v.adopcmodelplus.adopcmold.adopcmtest.adopcmtest.hlppcmtest.sthlppredraschwlm.ado
qualmosta
r
old
raschfit2.adoraschfit31.adoraschpower - Copie version SIM.adoraschpower1.5.adoraschpower1.adoraschpowerpcm.adoraschpowers.hlpraschtest2.adoraschtest82.adoraschtest83.adoraschtestv7732.adoraschtestv7761.adoraschtestv7762.adoraschtestv78 avant COVARIABLES.adoraschtestv782.adoraschtestv785.adoraschtestv7jf.adorsoort.dorsoort1 (2).adorsoort1.ado
raschfit.adoraschfit.hlpraschlong.adoraschlongitudinal2.adoraschpce.adoraschpower.adoraschpower.hlpraschpower33.adoraschpower4.adoraschpower5.adoraschpower51.adoraschpower511.adoraschpower52.adoraschpower53.adoraschpower54.adoraschpower55.adoraschpower56.adoraschpower58.adoraschpower59.adoraschres.adoraschres.hlpraschtest v8.10.1.adoraschtest.adoraschtest.hlpraschtestv7.adoraschtestv7.hlpraschtestv787.adoraschtestv7v8.10.1.adoraschtestv7v8.10.adoraschtestv7v88.adoraschtestv8.10.adoraschtestv86.adorel.adorepet.adorosali.adorosali.sthlprosali22.adorosali22.sthlprosali23.adorsbynpirt.adorsoort.adorsoort.hlprsoort11.ziprsoort12.adorsoort13.adorsoortBP.ados
old
sascfa.adosenspescore.adosf36fr v1.6.adosf36fr v1.7.adosf36fr.adosf36fr.hlpsf36fr.zipsf36fr1.4.adosf36fr1.5.adosf36frv13.adosimirt - Copie.adosimirt v4.1.adosimirt v4.2.adosimirt v4.3.adosimirt v4.4.adosimirt.adosimirt.hlpsimirt.zipt
tcm.adotestclv.adotodate.adotorumm.adotosas.adotraces v4.adotraces v5 avec items numeric ne marche pas - Copie.adotraces.adotraces.hlptraces3.adotraces32.adotraces33.adotri.adotrouve.ado
v
valid.adovalid.dlgvalid.hlpvalidscale.adovalidscale.ado (old)validscale.dlgvalidscale.hlpvalidscale.sthlpvalidscaleXX.ado
w
zip
backrasch2.zipclv214.zipdetect31.zipgammasym.zipgammasym22.zipgausshermite1.zipgeekel2d43.zipgengroup12.ziphcavar32.zipimputeitems.zipimputeitems24.zipimputemok21.zipimputerasch2.ziploevH.ziploevh8.zipmmsrm4.zipmohand.zipmsp.zipmsp81.zipnpirt.zipraschfit4.zipraschpower1.4.zipraschpower1.5.zipraschpower1.zipraschpower2.zipraschpower32.zipraschtest.zipraschtest8.zipraschtest86.zipraschtest87.zipraschtestv7.zipsf36fr13.zipsimirt.zipsimirt34.zipsimirt35.ziptraces33.zip
plus
_
_eststo.ado_eststo.hlp_get_mlogit_bv.ado_get_mlogit_bvecv.ado_peabbv.ado_pebase.ado_pebase.hlp_pecats.ado_pecats.hlp_peciboot.ado_peciboot.hlp_pecidelta.ado_pecidelta.hlp_peciml.ado_pecmdcheck.ado_pecollect.ado_pecollect.hlp_pedum.ado_pedum.hlp_peife.ado_peife.hlp_pemarg.ado_pemarg.hlp_penocon.ado_penocon.hlp_pepred.ado_pepred.hlp_perhs.ado_perhs.hlp_pesum.ado_pesum.hlp_petrap.ado_petrap.hlp_peunvec.ado_peunvec.hlp_pexstring.ado
a
b
bagroup.adobagroup.hlpbamat.adobamat.hlpbaplot.adobaplot.hlpbatplot.adobatplot.hlpbinolist.adobinolist.hlpblandaltman.adobollenstine.adobollenstine.sthlpbothlist.adobothlist.hlpbrant.adobrant.hlp
backup.trkc
caplog.adocaplog.hlpcase2alt.adocase2alt.hlpcfa1.adocfa1.hlpcfa1_lf.adocheckfor2.adocheckfor2.hlpchoplist.adochoplist.hlpcmdchk.adocollist.adocollist.hlpconcord.adoconcord.dlgconcord.hlpconfa.adoconfa.mataconfa.sthlpconfa_estat.adoconfa_estat.sthlpconfa_lf.adoconfa_lfm.adoconfa_p.adoconfirmdir.adoconfirmdir.hlpconvlist.adoconvlist.hlpcountfit.adocountfit.hlpcseplist.adocseplist.hlpcvarlist.adocvarlist.hlp
d
dellist.adodellist.hlpdelta.adodelta.hlpdifflist.adodifflist.hlpdiscrim2.adodiscrim2.hlpdropvars.adodropvars.hlp
e
elapse.adoelapse.hlpeq_g.hlpeqlist.adoeqlist.hlpespoisson.adoespoisson.hlpespoisson_ll.adoespoisson_p.adoestadd.adoestadd.hlpestout.adoestout.hlpestpost.adoestpost.hlpeststo.adoeststo.hlpesttab.adoesttab.hlpexspoisson.adoexspoisson_ll.adoexspoisson_p.ado
f
g
galbr.adogalbr.dlggalbr.hlpghquad.adoghquadm.adoghquadm.hlpgllam_ll.adogllamm.adogllamm.hlpgllapred.adogllapred.hlpgllarob.adogllas_yu.adogllasim.adogllasim.hlp
h
i
i2ci.adoicc23.adoicc23.hlpiccconf.adoiccconf.hlpice.adoice.hlpiclassr.adoiclassr.hlpiclassr2.adoiclassr2.hlpimputeitems.adoimputeitems.hlpinslist.adoinslist.hlpisvar.adoisvar.hlp
j
l
l1way.adol1way.hlplabbe.adolabbe.dlglabbe.hlplclist.adolclist.hlplconfa.mlibleastlikely.adoleastlikely.hlplistblck.adolistblck.hlplistcoef.adolistcoef.hlplistutil.hlplog2html.adolog2html.hlplog2html7.adolog2html7.hlplogout.adologout.hlp
m
maplist.adomaplist.hlpmeta.dlgmeta_dialog.hlpmetabias.adometabias.dlgmetabias.hlpmetacum.dlgmetafunnel.adometafunnel.dlgmetafunnel.hlpmetainf.adometainf.dlgmetainf.hlpmetan.adometan.dlgmetan.hlpmetan7.adometan7.dlgmetan7.hlpmetan_examples.adometaninf.adometaninf.dlgmetaninf.hlpmetannt.adometannt.dlgmetannt.hlpmetap.dlgmetareg.adometareg.dlgmetareg.hlpmetareg_ll.adometareg_p.adometareg_pm.adometatrim.dlgmhplot.adomicombine.adomicombine.hlpmijoin.adomijoin.hlpmisplit.adomisplit.hlpmisschk.adomisschk.sthlpmlogplot.adomlogplot.hlpmlogtest.adomlogtest.sthlpmlogview.adomlogview.hlpmnthlist.adomnthlist.hlpmvtab1.adomvtab1.hlp
n
nct.adonct.hlpnct2.adonct2.hlpnct2inv.adonct2inv.hlpnctinv.adonctinv.hlpnctn.adonctn.hlpnctncp.adonctncp.hlpnctprob.adonctprob.hlpnicenum.adonmlab.adonmlab.hlp
o
p
polych_ll.adopolychoric.adopolychoric.hlppolychoric.zippolychoricpca.adopolychoricpca.hlppolychoricpca.zippolyser_ll.adoposlist.adoposlist.hlppostlist.adopostlist.hlppraccum.adopraccum.hlpprchange.adoprchange.hlpprcounts.adoprcounts.hlpprdc.adoprdc.hlpprelist.adoprelist.hlpprgen.adoprgen.hlpprodlist.adoprodlist.hlpprtab.adoprtab.hlpprvalue.adoprvalue.hlpprwhich.ado
r
remcor.adoreop_ll.adoreopc_ll.adoreoprob.adoreoprob.hlpreplist.adoreplist.hlprevlist.adorevlist.hlprfpr_ll1.adorfprobit.adorfprobit.hlprotlist.adorotlist.hlp
s
sasexe.adosaswrapper.adosaswrapper.hlpsavasas.adosavasas.hlpsavastata.sassdpair.adosdpair.hlpseeout.adoseeout.hlpsellist.adosellist.hlpseqlist.adoseqlist.hlpshellout.adoshellout.hlpshortdir.adoshortdir.hlpsjlatex.adosjlatex.hlpsjlog.adosjlog.hlpsjlog_7.adosortlist.adosortlist.hlpspex.adospex.hlpspost.hlpspost_footer.ihlpspostupdate.adosublist.adosublist.hlpsumlist.adosumlist.hlp
stata.trkt
takelist.adotakelist.hlptmpdir.adotmpdir.hlptorumm.adotorumm.hlptraces.adotraces.hlptraj.adotraj.hlptraj.plugintrajplot.adotrajplot.hlptrnclist.adotrnclist.hlp
u
v
w
x
RProject
346
Modules/ado/personal/t/traces v4.ado
Normal file
346
Modules/ado/personal/t/traces v4.ado
Normal file
@ -0,0 +1,346 @@
|
||||
*! Version 4 22January2015
|
||||
************************************************************************************************************
|
||||
* Traces: Traces of items
|
||||
* Version 4: January 22, 2015 /*ICC*/
|
||||
*
|
||||
* Historic:
|
||||
* Version 1 (2003-06-29): Jean-Benoit Hardouin
|
||||
* Version 2 (2003-07-04): Jean-Benoit Hardouin
|
||||
* version 3 (2003-07-09): Jean-Benoit Hardouin
|
||||
* Version 3.1 (2005-06-07): Jean-Benoit Hardouin /*small modifications*/
|
||||
* Version 3.2: May 27, 2007 /*onlyone option*/
|
||||
* Version 3.3: October 16, 2012 /*minor modifications*/
|
||||
*
|
||||
* Jean-benoit Hardouin, phD, Assistant Professor
|
||||
* Team of Biostatistics, Clinical Research and Subjective Measures in Health Sciences
|
||||
* University of Nantes - Faculty of Pharmaceutical Sciences
|
||||
* France
|
||||
* jean-benoit.hardouin@anaqol.org
|
||||
*
|
||||
* News about this program :http://www.anaqol.org
|
||||
* FreeIRT Project website : http://www.freeirt.org
|
||||
*
|
||||
* Copyright 2003, 2005, 2007, 2012, 2015 Jean-Benoit Hardouin
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
************************************************************************************************************
|
||||
|
||||
program define traces, rclass
|
||||
version 8.0
|
||||
syntax varlist(numeric min=2) [, COMPare(varlist min=2 max=2) ICC SAVeicc noGraph Score Test Restscore Logistic CI CUMulative REPFiles(string) SCOREFiles(string) RESTSCOREFiles(string) LOGISTICFile(string) noDraw noDRAWComb REPlace ONLYone(string) THResholds(string) Black]
|
||||
|
||||
local nbitems : word count `varlist'
|
||||
tokenize `varlist'
|
||||
|
||||
if "`onlyone'"!=""&"`drawcomb'"!="" {
|
||||
local drawcomb
|
||||
}
|
||||
|
||||
tempvar varscore
|
||||
qui gen `varscore'=0
|
||||
label variable `varscore' "Total score"
|
||||
local scoremax=0
|
||||
local flag=0
|
||||
|
||||
if "`score'"==""&"`restscore'"==""&&"`logistic'"=="" {
|
||||
local score="score"
|
||||
}
|
||||
|
||||
local modamax=0
|
||||
forvalues i=1/`nbitems' {
|
||||
qui replace `varscore'=`varscore'+``i''
|
||||
qui su ``i''
|
||||
local modamax`i'=r(max)
|
||||
if r(min)!=0 {
|
||||
local flag=1
|
||||
}
|
||||
local scoremax=`scoremax'+`modamax`i''
|
||||
if `modamax`i''!=1 {
|
||||
local flagbin=0
|
||||
}
|
||||
if `modamax`i''>`modamax' {
|
||||
local modamax=`modamax`i''
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if `flag'==1 {
|
||||
di as error "The lower modality of the item must be 0"
|
||||
exit
|
||||
}
|
||||
if "`flagbin'"!=""&"`logistic'"!="" {
|
||||
di as error "The logistic option is not possible with polytomous items"
|
||||
exit
|
||||
}
|
||||
|
||||
qui su `varscore'
|
||||
local maxscore=r(max)
|
||||
|
||||
forvalues i=0/`maxscore' {
|
||||
qui count if `varscore'==`i'
|
||||
local nscore`i'=r(N)
|
||||
}
|
||||
|
||||
|
||||
global score
|
||||
global restscore
|
||||
global logistic
|
||||
qui count
|
||||
local N=r(N)
|
||||
if `c(matsize)'<`N'&"`saveicc'"!="" {
|
||||
set matsize `N'
|
||||
}
|
||||
|
||||
|
||||
if "`score'"!="" {
|
||||
if "`thresholds'"!="" {
|
||||
* set trace on
|
||||
local nbth:word count `thresholds'
|
||||
forvalues t=1/`nbth' {
|
||||
local th`t':word `t' of `thresholds'
|
||||
}
|
||||
tempname label
|
||||
local recode 0/`th1'=1 `=`th`nbth''+1'/max=`=`nbth'+1'
|
||||
qui label define `label' 1 "0/`th1'",add
|
||||
qui label define `label' `=`nbth'+1' "`=`th`nbth''+1'/max",add
|
||||
forvalues j=2/`nbth' {
|
||||
local recode `recode' `=`th`=`j'-1''+1'/`th`j''=`j'
|
||||
qui label define `label' `j' "`=`th`=`j'-1''+1'/`th`j''",add
|
||||
}
|
||||
tempname varscore2
|
||||
qui gen `varscore2'=`varscore'
|
||||
qui recode `varscore' `recode'
|
||||
qui label values `varscore' `label'
|
||||
local nbgroups=`nbth'+1
|
||||
local minimum=1
|
||||
}
|
||||
else {
|
||||
local nbgroups=`maxscore'
|
||||
local minimum=0
|
||||
}
|
||||
local listicc
|
||||
|
||||
forvalues i=1/`nbitems' {
|
||||
local y`i'
|
||||
tempvar icc``i''
|
||||
gen `icc``i'''=0
|
||||
local listicc `listicc' `icc``i'''
|
||||
forvalues k=1/`modamax`i'' {
|
||||
tempvar propscore`i'`k' tmp
|
||||
if "`cumulative'"!="" {
|
||||
qui gen `tmp'=``i''>=`k'&``i''!=.
|
||||
bysort `varscore' : egen `propscore`i'`k''=mean(`tmp')
|
||||
label variable `propscore`i'`k'' "Item ``i''>=`k'"
|
||||
}
|
||||
else {
|
||||
qui gen `tmp'=``i''==`k'&``i''!=.
|
||||
bysort `varscore' : egen `propscore`i'`k''=mean(`tmp')
|
||||
label variable `propscore`i'`k'' "Item ``i''=`k'"
|
||||
*di "replace icc``i''=icc``i''+`k'*`propscore`i'`k''"
|
||||
qui replace `icc``i'''=`icc``i'''+`k'*`propscore`i'`k''
|
||||
}
|
||||
local y`i'="`y`i'' `propscore`i'`k''"
|
||||
local style="solid"
|
||||
local color="black"
|
||||
local width="medthick"
|
||||
if `modamax`i''==1&"`ci'"!="" {
|
||||
tempvar icscoreminus icscoreplus
|
||||
forvalues l=1/`maxscore' {
|
||||
qui count if `varscore'==`l'
|
||||
local nscore`l'=r(N)
|
||||
}
|
||||
qui gen `icscoreminus'=`propscore`i'1'-1.96*sqrt(`propscore`i'1'*(1-`propscore`i'1')/`nscore1')
|
||||
qui gen `icscoreplus'=`propscore`i'1'+1.96*sqrt(`propscore`i'1'*(1-`propscore`i'1')/`nscore1')
|
||||
label variable `icscoreminus' "Lower 95% confidence interval"
|
||||
label variable `icscoreplus' "Upper 95% confidence interval"
|
||||
local y`i'="`icscoreminus' `icscoreplus' `propscore`i'1'"
|
||||
local style="dash dash solid"
|
||||
local color="red red black"
|
||||
local width="thin thin medthick"
|
||||
}
|
||||
if `modamax`i''==1&"`test'"!="" {
|
||||
qui regress `propscore`i'1' `varscore'
|
||||
local p=Fden(e(df_m),e(df_r),e(F))
|
||||
if `p'<0.0001 {
|
||||
local note="Test: slope=0, p<0.0001"
|
||||
}
|
||||
else {
|
||||
local p=substr("`p'",1,6)
|
||||
local note="Test: slope=0, p=`p'"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ("``i''"=="`onlyone'"|"`onlyone'"=="")&"`nograph'"=="" {
|
||||
qui graph twoway (line `y`i'' `varscore', clpattern(`style') clcolor(`color') clwidth(`width')) if `varscore'!=0&`varscore'!=`maxscore' , note("`note'") ylabel(0(.25)1) xlabel(`minimum'(1)`nbgroups',valuelabel) name(score`i',replace) title("Trace of the item ``i'' as a function of the score") ytitle("Rate of positive response") `draw' /*areastyle(none)*/
|
||||
}
|
||||
if ("``i''"=="`onlyone'"|"`onlyone'"=="")&"`icc'"!=""&"`nograph'"!=""{
|
||||
qui graph twoway (line `icc``i''' `varscore', clpattern(`style') clcolor(`color') clwidth(`width')) if `varscore'!=0&`varscore'!=`maxscore' , ylabel(0(.5)`modamax`i'') xlabel(`minimum'(1)`nbgroups',valuelabel) name(icc`i',replace) title("Approximate ICC of the item ``i'' as a function of the score") ytitle("Mean response") `draw' /*areastyle(none)*/
|
||||
}
|
||||
global score "$score score`i'"
|
||||
if "`scorefiles'"!="" {
|
||||
graph save score`i' `repfiles'\\`scorefiles'``i'' ,`replace'
|
||||
}
|
||||
}
|
||||
if "`saveicc'"!="" {
|
||||
local listicc `listicc' `varscore'
|
||||
tempname matscore
|
||||
mkmat `listicc',matrix(`matscore')
|
||||
}
|
||||
if "`thresholds'"!="" {
|
||||
qui replace `varscore'=`varscore2'
|
||||
}
|
||||
}
|
||||
if "`compare'"!=""&"`nograph'"!="" {
|
||||
local tmp1 : word 1 of `compare'
|
||||
local tmp2 : word 2 of `compare'
|
||||
di "compare `compare' tmp1 `tmp1' tmp2 `tmp2'"
|
||||
label variable `icc`tmp1'' `tmp1'
|
||||
label variable `icc`tmp2'' `tmp2'
|
||||
di "qui graph twoway (line `icc`tmp1'' `varscore', clpattern(`style') clcolor(`color') clwidth(`width')) (line `icc`tmp2'' `varscore', clpattern(`style') clcolor(`color') clwidth(`width')) if `varscore'!=0&`varscore'!=`maxscore' , ylabel(0(.5)`modamax') xlabel(`minimum'(1)`nbgroups',valuelabel) name(score`i',replace) title(Comparison of the ICC of the items `tmp1' and `tmp2') `draw' /*areastyle(none)*/"
|
||||
qui graph twoway (line `icc`tmp1'' `varscore', clpattern(`style') clcolor(blue red) clwidth(`width')) (line `icc`tmp2'' `varscore', clpattern(`style') clcolor(`color') clwidth(`width')) if `varscore'!=0&`varscore'!=`maxscore' , ylabel(0(.5)`modamax') xlabel(`minimum'(1)`nbgroups',valuelabel) /*name(score`i',replace)*/ title("Comparison of the ICC of the items `tmp1' and `tmp2'") ytitle("Mean response") /*areastyle(none)*/
|
||||
}
|
||||
if "`restscore'"!="" {
|
||||
forvalues i=1/`nbitems' {
|
||||
local y`i'
|
||||
tempvar restscore`i'
|
||||
qui gen `restscore`i''=`varscore'-``i''
|
||||
label variable `restscore`i'' "Rest score with respect to the item ``i''"
|
||||
if "`thresholds'"!="" {
|
||||
* set trace on
|
||||
local nbth:word count `thresholds'
|
||||
forvalues t=1/`nbth' {
|
||||
local th`t':word `t' of `thresholds'
|
||||
}
|
||||
tempname label
|
||||
local recode 0/`th1'=1 `=`th`nbth''+1'/max=`=`nbth'+1'
|
||||
qui label define `label' 1 "0/`th1'",add
|
||||
qui label define `label' `=`nbth'+1' "`=`th`nbth''+1'/max",add
|
||||
forvalues j=2/`nbth' {
|
||||
local recode `recode' `=`th`=`j'-1''+1'/`th`j''=`j'
|
||||
qui label define `label' `j' "`=`th`=`j'-1''+1'/`th`j''",add
|
||||
}
|
||||
|
||||
*di "recode `restscore`i'' `recode'"
|
||||
qui recode `restscore`i'' `recode'
|
||||
qui label values `restscore`i'' `label'
|
||||
local nbgroups=`nbth'+1
|
||||
local minimum=1
|
||||
}
|
||||
else {
|
||||
local nbgroups=`maxscore'
|
||||
local minimum=0
|
||||
}
|
||||
|
||||
forvalues k=1/`modamax`i'' {
|
||||
tempvar rtmp proprestscore`i'`k'
|
||||
if "`cumulative'"!="" {
|
||||
qui gen `rtmp'=``i''>=`k'&``i''!=.
|
||||
bysort `restscore`i'': egen `proprestscore`i'`k''=mean(`rtmp')
|
||||
label variable `proprestscore`i'`k'' "Item ``i''>=`k'"
|
||||
}
|
||||
else {
|
||||
qui gen `rtmp'=``i''==`k'&``i''!=.
|
||||
bysort `restscore`i'': egen `proprestscore`i'`k''=mean(`rtmp')
|
||||
label variable `proprestscore`i'`k'' "Item ``i''=`k'"
|
||||
}
|
||||
local y`i'="`y`i'' `proprestscore`i'`k''"
|
||||
local style="solid"
|
||||
local color="black"
|
||||
local width="medthick"
|
||||
if `modamax`i''==1&"`ci'"!="" {
|
||||
tempvar icrestscoreminus icrestscoreplus
|
||||
qui su `restscore`i''
|
||||
local maxrestscore=r(max)
|
||||
forvalues l=1/`maxrestscore' {
|
||||
qui count if `restscore`i''==`l'
|
||||
local nrestscore`i'=r(N)
|
||||
}
|
||||
qui gen `icrestscoreminus'=`proprestscore`i'1'-1.96*sqrt(`proprestscore`i'1'*(1-`proprestscore`i'1')/`nrestscore`i'')
|
||||
qui gen `icrestscoreplus'=`proprestscore`i'1'+1.96*sqrt(`proprestscore`i'1'*(1-`proprestscore`i'1')/`nrestscore`i'')
|
||||
label variable `icrestscoreminus' "Lower 95% confidence interval"
|
||||
label variable `icrestscoreplus' "Upper 95% confidence interval"
|
||||
local y`i'="`icrestscoreminus' `icrestscoreplus' `proprestscore`i'1'"
|
||||
local style="dash dash solid"
|
||||
local color="red red black"
|
||||
local width="thin thin medthick"
|
||||
}
|
||||
if `modamax`i''==1&"`test'"!="" {
|
||||
qui regress `proprestscore`i'1' `varscore'
|
||||
local p=Fden(e(df_m),e(df_r),e(F))
|
||||
if `p'<0.0001 {
|
||||
local note="Test: slope=0, p<0.0001"
|
||||
}
|
||||
else {
|
||||
local p=substr("`p'",1,6)
|
||||
local note="Test: slope=0, p=`p'"
|
||||
}
|
||||
}
|
||||
}
|
||||
local restscoremax=`scoremax'-`modamax`i''
|
||||
if ("``i''"=="`onlyone'"|"`onlyone'"=="")&"`nograph'"!="" {
|
||||
*tab `proprestscore`i'1' `restscore`i''
|
||||
qui graph twoway (line `y`i'' `restscore`i'', clpattern(`style') clcolor(`color') clwidth(`width')), note("`note'") ylabel(0(0.25)1) xlabel(`minimum'(1)`nbgroups',valuelabel) name(restscore`i',replace) title("Trace of the item ``i'' as a function of the restscore") ytitle("Rate of positive response") `draw'
|
||||
}
|
||||
global restscore "$restscore restscore`i'"
|
||||
if "`restscorefiles'"!="" {
|
||||
graph save restscore`i' `repfiles'\\`restscorefiles'``i'' ,`replace'
|
||||
}
|
||||
}
|
||||
}
|
||||
if "logistic"!="" {
|
||||
forvalues i=1/`nbitems' {
|
||||
qui logistic ``i'' `varscore'
|
||||
tempname coef
|
||||
matrix `coef'=e(b)
|
||||
local pente`i'=`coef'[1,1]
|
||||
local intercept`i'=`coef'[1,2]
|
||||
tempvar logit`i'
|
||||
qui gen `logit`i''=exp(`intercept`i''+`pente`i''*`varscore')/(1+exp(`intercept`i''+`pente`i''*`varscore'))
|
||||
label variable `logit`i'' "Item ``i''"
|
||||
sort `varscore'
|
||||
global logistic "$logistic `logit`i''"
|
||||
}
|
||||
}
|
||||
if "`drawcomb'"!="" {
|
||||
local drawcomb="nodraw"
|
||||
}
|
||||
|
||||
if ("`score'"!=""&"`onlyone'"=="")&"`nograph'"!="" {
|
||||
graph combine $score , title("Trace of the items as a function of the score") name(score,replace) `drawcomb'
|
||||
if "`scorefiles'"!="" {
|
||||
graph save score `repfiles'\\`scorefiles' ,`replace'
|
||||
}
|
||||
}
|
||||
|
||||
if ("`restscore'"!=""&"`onlyone'"=="")&"`nograph'"!="" {
|
||||
graph combine $restscore , title("Trace of the items as a function of the restscores") name(restscore,replace) `drawcomb'
|
||||
if "`restscorefiles'"!="" {
|
||||
graph save restscore `repfiles'\\`restscorefiles' ,`replace'
|
||||
}
|
||||
}
|
||||
if ("`logistic'"!="")&"`nograph'"!="" {
|
||||
graph twoway (line $logistic `varscore'), ylabel(0(0.25)1) xlabel(0(1)`nbitems') title("Logistic traces") ytitle("") name(logistic,replace) `drawcomb'
|
||||
if "`logisticfile'"!="" {
|
||||
graph save logistic `repfiles'\\`logisticfile' ,`replace'
|
||||
}
|
||||
}
|
||||
if "`saveicc'"!="" {
|
||||
return matrix matscore=`matscore'
|
||||
}
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user