Plot the total information with solid line and expected SEE function (dashed line) in the same graph

67 views
Skip to first unread message

Yuen Wan Ho

unread,
May 6, 2016, 7:50:54 AM5/6/16
to mirt-package
Hi everyone, 

I looked at the manuel for mirt and got some ideas about plotting. What command or script I should type when I wish to plot  the total information with solid line and expected SEE function (dashed line) in the same graph?

Thanks alot!

Yuen Wan

Phil Chalmers

unread,
May 6, 2016, 4:21:57 PM5/6/16
to Yuen Wan Ho, mirt-package
Something like plot(mod, type = 'infoSE')?

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...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Yuen Wan Ho

unread,
May 9, 2016, 12:44:25 AM5/9/16
to mirt-package, spoo...@gmail.com

Hi Phil,

The code that can plot both total information function and expected SEE function (for example, the one as shown in the attachment (Toland, 2014, p.147)

Thanks!
Yuen Wan
Phil Chalmers於 2016年5月7日星期六 UTC+8上午4時21分57秒寫道:
Toland(2014) Journal of Early Adolescence.jpg

Phil Chalmers

unread,
May 9, 2016, 12:50:51 AM5/9/16
to Yuen Wan Ho, mirt-package
You probably can't do this exact plot with the built in plots, but see the lower level components that make them up. E.g., testinfo(). Then just build the plot yourself from the respective pieces. Cheers.

Phil

Yuen Wan Ho

unread,
May 9, 2016, 2:25:48 AM5/9/16
to mirt-package, spoo...@gmail.com
Hi Phil,

Thank you so much for your quick response and advice :)

Yuen Wan

Phil Chalmers於 2016年5月9日星期一 UTC+8下午12時50分51秒寫道:

Phil Chalmers

unread,
May 9, 2016, 8:28:36 AM5/9/16
to Yuen Wan Ho, mirt-package
As a follow up, this seems to be what you are after (minus the legend).

library(mirt)
mod <- mirt(Science, 1)

Theta <- matrix(seq(-3,3,length.out=1000))
d = data.frame(Theta, I=testinfo(mod, Theta))
d$SE <- sqrt(1/d$I)

par(mar = c(5,5,2,5))
with(d, plot(Theta, I, type="l",las=2, lwd=2, xlab = expression(theta),
ylab = expression(Information (theta))))

par(new = T)
with(d, plot(Theta, SE, type = 'l', axes=F, lty=2, ylab=NA, lwd=2))
axis(side = 4, las=2)
mtext(side = 4, line = 3, expression(SEE(theta)))
 

Phil

Phil Chalmers

unread,
May 9, 2016, 8:36:39 AM5/9/16
to Yuen Wan Ho, mirt-package
Updated (xlab was written 2x in last message).

library(mirt)
mod <- mirt(Science, 1)

Theta <- matrix(seq(-3,3,length.out=1000))
d = data.frame(Theta, I=testinfo(mod, Theta))
d$SE <- sqrt(1/d$I)

par(mar = c(5,5,2,5))
with(d, plot(Theta, I, type="l",las=1, lwd=2, xlab = expression(theta),
ylab = expression(Information (theta))))

par(new = T)
with(d, plot(Theta, SE, type = 'l', axes=F, lty=2, ylab=NA, lwd=2, xlab=NA))
axis(side = 4, las=2)
mtext(side = 4, line = 3, expression(SEE(theta)))
 

Phil
Reply all
Reply to author
Forward
0 new messages