Dear Dr. Phil,
I'm trying to use ggplot to plot a DIF analysis I conducted with my dataset (two groups: male and females). I've found your code
here and it helped me a lot. Unfortunately, I'm afraid I could not use this script to plot DIF analysis when I have two groups (That is my case). Could you please help me (and, probably, other mirt users) ?
I want to transform this output:
plot(mod_metric, type='info')
To something like this output
plt <- plot(mod_metric, type='info') #store the object
plt$panel.args
pltdata <- data.frame(lapply(plt$panel.args, function(x) do.call(cbind, x))[[1]])
ggplot(pltdata, aes(x, y)) +
geom_line(size = 1.5) +
labs(x="ability", y="I(Theta)")
I know this question is much more a programming question than a mirt question, but I've tried to ask on stackoverflow and they did not accepted it.
Thanks.