|
|
@ -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))
|
|
|
|
nbitems <- sum(sapply(1:20,function(x) paste0('item',x)) %in% colnames(df))
|
|
|
|
resp <- df[,sapply(seq(1,nbitems),function(x) paste0('item',x))]
|
|
|
|
resp <- df[,sapply(seq(1,nbitems),function(x) paste0('item',x))]
|
|
|
|
if (method=='MML') {
|
|
|
|
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') {
|
|
|
|
if (method=='JML') {
|
|
|
|
tam1 <- tam.jml(resp=resp,group=1+df[,treatment])
|
|
|
|
tam1 <- tam.jml(resp=resp,group=1+df[,treatment])
|
|
|
|