[R] ltm: Simplified approach to bootstrapping 2PL-Models?

Dimitris Rizopoulos d.rizopoulos at erasmusmc.nl
Sun Nov 20 14:54:54 CET 2011


Note that you can also fit 2PL models using the gpcm() function that 
fits the Generalized Partial Credit Model, and therefore you can use the 
GoF.gpcm() function for goodness-of-fit, e.g.,

library(ltm)

fit2PL.1 <- ltm(LSAT ~ z1)
fit2PL.2 <- gpcm(LSAT)

fit2PL.1
fit2PL.2

GoF.gpcm(fit2PL.2, B = 199)


I hope it helps.

Best,
Dimitris


On 11/20/2011 1:16 PM, Christian Montel wrote:
> Dear R-List,
>
> to assess the model fit for 2PL-models, I tried to mimic the
> bootstrap-approach chosen in the GoF.rasch()-function. Not being a
> statistician, I was wondering whether the following simplification
> (omit the "chi-squared-expressed model fit-step") would be appropriate:
>
> GoF.ltm<- function(object, B = 50, ...){
>    liFits<- list()
>    for(i in 1:B){
>      rndDat<- rmvlogis(nrow(object$X), coef(object))
>      liFits[[i]]<- ltm(rndDat ~ z1)
>    }
>    distr<- sort(sapply(liFits, function(x)return(x$log.Lik)))
>    return(max(which(distr<= object$log.Lik))/length(distr))
> }
>
> The rationale behind was to directly use the sorted sequence of
> (log)likelihoods of models fitted to 2PL-fitting-datasets where the
> parameters of<object>  hold. The return value was intented to roughly
> mirror how many 2PL-Datasets which demonstrably fit the model fit
> worse or better than the model in question.
>
> Any comments which may help me figure out whether I'm on the right
> track are greatly appreciated.
>
> Thank you in advance,
> best regards,
> Christian
>
>
> Dr. Christian Montel
> E-Mail: christian.montel at eligo.de
> eligo GmbH -- Büro Berlin		
> Tel.:       +49 (0) 30 695 399 95-2
> Arndtstr. 34				
> Fax:        +49 (0) 30 695 399 95-1
> 10965 Berlin
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
Dimitris Rizopoulos
Assistant Professor
Department of Biostatistics
Erasmus University Medical Center

Address: PO Box 2040, 3000 CA Rotterdam, the Netherlands
Tel: +31/(0)10/7043478
Fax: +31/(0)10/7043014
Web: http://www.erasmusmc.nl/biostatistiek/



More information about the R-help mailing list