Re: mirt: standard error of b parameter

1,318 views
Skip to first unread message

Phil Chalmers

unread,
Jan 30, 2016, 9:38:23 AM1/30/16
to Taeyoung Kim, mirt-package
There is no way to obtain se(b) directly from the package, and I haven't added support for the delta method either. You could build your own IRT model with the createItem() function though and estimate the standard errors that way using a smaller number of criteria (e.g., crossprod will not be available, but the Richardson extrapolation method will). 

The dev version adds less expensive numerical derivatives now as well, including SE.type = 'forward' and SE.type = 'central'.

name <- 'old2PL'
par <- c(a = .5, b = -2)
est <- c(TRUE, TRUE)
P.old2PL <- function(par,Theta, ncat){
    a <- par[1]
    b <- par[2]
    P1 <- 1 / (1 + exp(-1*a*(Theta - b)))
    cbind(1-P1, P1)
}
x <- createItem(name, par=par, est=est, P=P.old2PL)

dat <- expand.table(LSAT7)
mod <- mirt(dat, 1, 'old2PL', customItems=list(old2PL=x), SE=TRUE, SE.type = 'central')
coef(mod)


Phil

On Sat, Jan 30, 2016 at 6:06 AM, Taeyoung Kim <limntoi...@gmail.com> wrote:
Dear Phil Chalmers,

Hello, I am an user of your "mirt" package. When I study, I wanted to get the standard error of b parameter in terms of traditional IRT metric. For your information, I am using unidimensional 2PL model. When I use syntax 

coef(mod1,printSE=T)

it gives me just se of a and d. I know b=-d/a, but I don't know how can I get se(b) using se(a) and se(d).

I tried in another way using syntax

coef(mod1,printSE=T, IRTpars=T)

I can't get se(b) as well. So I would like to ask whether there is a way to get se(b) directly within mirt package without using another approach like delta method.

Sincerely,
Taeyoung Kim 
  

Phil Chalmers

unread,
Mar 15, 2016, 11:49:14 AM3/15/16
to mirt-package
As a follow-up to this message, if you really want the standard errors you can compute them via the delta method like so:

library(mirt)
name <- 'old2PL'
par <- c(a = .5, b = -2)
est <- c(TRUE, TRUE)
P.old2PL <- function(par,Theta, ncat){
    a <- par[1]
    b <- par[2]
    P1 <- 1 / (1 + exp(-1*a*(Theta - b)))
    cbind(1-P1, P1)
}
x <- createItem(name, par=par, est=est, P=P.old2PL)

dat <- expand.table(LSAT7)
mod <- mirt(dat, 1, 'old2PL', customItems=list(old2PL=x), SE=TRUE, SE.type = 'Richardson')
coef(mod, printSE=TRUE)[[5]]

## obtain via the delta method
mod2 <- mirt(dat, 1, SE=TRUE, SE.type = 'Louis')
coef(mod2, simplify=TRUE)$items[5,]
coef(mod2, simplify=TRUE, IRTpars=TRUE)$items[5,]

# extract required terms
parvec <- extract.mirt(mod2, 'parvec')
vcov <- vcov(mod2)
colnames(vcov)
pick <- 9:10
ad <- parvec[pick]
v <- vcov[pick, pick]

library(msm)
SEs <- deltamethod(list(~ x1, ~ -x2/x1), ad, v)
names(SEs) <- c('a', 'b')
SEs
coef(mod, printSE=TRUE)[[5]] #compare

Again, I have little interest in including delta method SEs for reasons that I don't particularly like the classical IRT forms, but you are welcome to obtain these manually if you are so interested. Cheers.

Phil

Oce

unread,
Jul 21, 2016, 10:33:07 PM7/21/16
to mirt-package
Phil, just wondering why you don't particularly like the classical IRT forms... seems a lot of researchers reported them in their papers...

Phil Chalmers

unread,
Jul 22, 2016, 10:13:02 AM7/22/16
to Oce, mirt-package

http://stats.stackexchange.com/questions/169247/meaning-of-large-values-of-parameter-b-b-4-in-irt-theory/169264#169264


--
You received this message because you are subscribed to the Google Groups "mirt-package" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mirt-package...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Oce

unread,
Jul 24, 2016, 9:52:53 PM7/24/16
to mirt-package, oce....@gmail.com
thanks!

Alvin Vista

unread,
Sep 22, 2016, 7:44:51 AM9/22/16
to mirt-package, limntoi...@gmail.com
Hi Phil, can the standard errors be computed from the confidence intervals derived from "PLCI.mirt"?
If yes, what is the method used to compute the confidence intervals -- is it the same as what the user specified in "SE.type"?

Phil Chalmers

unread,
Sep 22, 2016, 9:17:43 AM9/22/16
to Alvin Vista, mirt-package
Hi Alvin,

No, this function does not compute SEs of any kind, and unfortunately back transforming from PLCIs to some SE estimate isn't really kosher. Sorry.

Phil

--
You received this message because you are subscribed to the Google Groups "mirt-package" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mirt-package+unsubscribe@googlegroups.com.

Alvin

unread,
Sep 22, 2016, 10:28:37 AM9/22/16
to mirt-package, alv...@gmail.com
Thanks Phil, that's really helpful information -- I missed that this function is based on profile likelihood :)
Is there a reason why the SEs can't be obtained directly given the SEs can be estimated and SE.type defined?

Phil

To unsubscribe from this group and stop receiving emails from it, send an email to mirt-package...@googlegroups.com.

Phil Chalmers

unread,
Sep 22, 2016, 10:31:10 AM9/22/16
to Alvin, mirt-package
Sorry, I don't understand your question. Can you rephrase it (or can I at least buy a vowel)? 

Phil

To unsubscribe from this group and stop receiving emails from it, send an email to mirt-package+unsubscribe@googlegroups.com.

Alvin

unread,
Sep 22, 2016, 10:43:49 AM9/22/16
to mirt-package, alv...@gmail.com
Sorry, this is probably a stupid question... I guess I'm confused what standard errors are estimated in the argument "mirt(data, SE=TRUE)", and why standard errors can't be obtained for some parameters directly from the package (if they are already estimated by SE=TRUE).

Phil Chalmers

unread,
Sep 22, 2016, 10:49:28 AM9/22/16
to Alvin, mirt-package
Ah I see. The problem is that the methods required to compute the SEs often require information from the estimation itself. So like SE.type = 'SEM' requires the (accelerated) EM iteration history, as well as the complete data information matrix, neither of which are stored in the returned objects (and the functions try to accelerate the EM by default). So to be consistent the estimation functions control all of the internal mechanisms required.

It's not that hard to get them though, just pass the parameter estimates back from a previously converged model, like so:

> library(mirt)
> mod <- mirt(Science, 1)
Iteration: 36, Log-Lik: -1608.870, Max-Change: 0.00010
> modSE <- mirt(Science, 1, pars=mod2values(mod), TOL=NA, SE=TRUE)


Calculating information matrix...
> coef(modSE)
$Comfort
           a1    d1    d2     d3
par     1.042 4.864 2.640 -1.466
CI_2.5  0.718 3.774 2.221 -1.773
CI_97.5 1.365 5.954 3.059 -1.159

$Work
           a1    d1    d2     d3
par     1.226 2.924 0.901 -2.267
CI_2.5  0.857 2.448 0.623 -2.693
CI_97.5 1.595 3.400 1.179 -1.840

$Future
           a1    d1    d2     d3
par     2.293 5.234 2.214 -1.964
CI_2.5  1.313 3.860 1.484 -2.604
CI_97.5 3.274 6.608 2.943 -1.323

$Benefit
           a1    d1    d2     d3
par     1.095 3.348 0.992 -1.688
CI_2.5  0.774 2.798 0.719 -2.021
CI_97.5 1.416 3.898 1.264 -1.356

$GroupPars
        MEAN_1 COV_11
par          0      1
CI_2.5      NA     NA
CI_97.5     NA     NA

HTH.

Phil

To unsubscribe from this group and stop receiving emails from it, send an email to mirt-package+unsubscribe@googlegroups.com.

Alvin

unread,
Sep 22, 2016, 10:52:59 AM9/22/16
to mirt-package, alv...@gmail.com
Thanks Phil, this is fantastic. And thanks for your patience...
Reply all
Reply to author
Forward
0 new messages