Updated r script for analysis
This commit is contained in:
@ -24,7 +24,7 @@ pcm_analysis <- function(df=NULL,treatment='TT',irtmodel='PCM2',method='MML') {
|
||||
nbitems <- sum(sapply(1:20,function(x) paste0('item',x)) %in% colnames(df))
|
||||
resp <- df[,sapply(seq(1,nbitems),function(x) paste0('item',x))]
|
||||
if (method=='MML') {
|
||||
tam1 <- tam.mml.mfr(resp=resp,Y=df[,treatment],irtmodel = irtmodel,est.variance = T,verbose=F)
|
||||
tam1 <- tam.mml(resp=resp,Y=df[,treatment],irtmodel = irtmodel,est.variance = T,verbose=F)
|
||||
}
|
||||
if (method=='JML') {
|
||||
tam1 <- tam.jml(resp=resp,group=1+df[,treatment])
|
||||
|
@ -1,15 +1,15 @@
|
||||
*=================================================================================================================================================
|
||||
* Date : 2024-01-23
|
||||
* Stata version : Stata 18 SE
|
||||
*
|
||||
* This program analyses simulated data without DIF through a partial credit model
|
||||
*
|
||||
* ado-files needed : - pcm (version 5.5 October 25, 2023, available on gitea)
|
||||
*
|
||||
* outputs : for N=100
|
||||
*
|
||||
*
|
||||
*================================================================================================================================================
|
||||
*=================================================================================================================================================
|
||||
* Date : 2024-01-23
|
||||
* Stata version : Stata 18 SE
|
||||
*
|
||||
* This program analyses simulated data accounting for DIF through a partial credit model
|
||||
*
|
||||
* ado-files needed : - pcm (version 5.5 October 25, 2023, available on gitea)
|
||||
*
|
||||
* outputs : for N=100
|
||||
*
|
||||
*
|
||||
*================================================================================================================================================
|
||||
|
||||
* Load pcm.ado
|
||||
adopath+"/home/corentin/Documents/These/Recherche/Simulations/Modules/"
|
||||
@ -41,7 +41,7 @@
|
||||
* Créer une deuxième matrice et faire de même pour les std error
|
||||
gsem (1.item1<-THETA@1)///
|
||||
(1.item2<-THETA@1 tt)///
|
||||
(1.item3<-THETA@1)///
|
||||
(1.item3<-THETA@1 )///
|
||||
(1.item4<-THETA@1)///
|
||||
(THETA<-tt), mlogit tol(0.01) iterate(500) latent(THETA) nocapslatent
|
||||
mat V=r(table)
|
||||
@ -51,4 +51,5 @@
|
||||
* log close
|
||||
|
||||
|
||||
|
||||
pcm item1 item2 item3 item4, categorical(tt)
|
||||
|
Reference in New Issue
Block a user