Description Usage Arguments Value Author(s) References See Also Examples
This function applies likelihood ratio tests between one reference model (object) and some competing models.
1 2 3 4 5 6 7 |
object |
An object of class |
... |
Objects of class |
The function returns a matrix with the following values
-2 loglikelihood difference |
This is the difference of every submitted model vs. the reference model (object). |
degrees of freedom difference |
This is the difference in df between the reference model and the other models. |
p-value |
The resulting p-value whoch depends on the particular likelihood and the df difference. |
Manuel Reif
Holland, P. W., & Wainer, H. (1993). Differential item functioning. Hillsdale, NJ: Lawrence Erlbaum.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | ## Too long for R CMD check :-(
## Not run:
## NUMBER OF ITEMS
nit <- 3
set.seed(2046)
x1 <- rnorm(nit*5,0,1.7)
zeta <- tapply(x1,rep(1:nit,each=5), function(x) round(x - mean(x),3))
# lambda parameters
x2 <- rnorm(nit*5,0,1.1)
lam <- tapply(x2,rep(1:nit,each=5), function(x)
{
sort(round(x - mean(x),3),decreasing=FALSE)
})
# create a parlist as a first step
ParList <- mapply(function(one,two)
{
x1 <- c(one,two)
names(x1) <- paste0(rep(c("zeta","lam"),each=length(one)),1:length(one))
return(x1)
},one=zeta,two=lam,SIMPLIFY=FALSE)
## NUMBER OF RESPONDENTS
nper <- 2000
names(ParList) <- paste0("item",1:length(ParList))
perp1 <- rnorm(nper,0,1)
perp2 <- rnorm(nper,0.3,1)
simdat1 <- NRM.sim(ParList,perp1)
simdat2 <- NRM.sim(ParList,perp2)
simdatall <- rbind(simdat1,simdat2)
simdatallg <- data.frame(GROUP=factor(rep(c("A","B"),each=nper)),simdatall)
my_resh <- reshMG(simdatallg,items=2:(nit+1),groups=1,correct=rep(3,nit),echo=FALSE)
est1 <- nrm(my_resh)
des2 <- designTemp(ngru=2,nit=nit,TYPE="NRM")
des2[[1]][2,1] <- 2
my_resh2 <- reshMG(simdatallg,items=2:(nit+1),groups=1,correct=rep(3,nit),echo=FALSE,design=des2)
est2 <- nrm(my_resh2)
### LIKELIHOOD RATIO TEST
lrt(est1,est2)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.