Error: $ operator not defined for this S4 class

723 views
Skip to first unread message

Spike

unread,
Sep 24, 2018, 8:06:58 AM9/24/18
to mirt-package
Hello,

I have tried to get the parameters of a mirt model on a test of 75 items with a sample size of 15,000. And naturally I used coef(object), which returned "Error: $ operator not defined for this S4 class"

Here is my sample code:

test_structure <- F1 = 1 - 25
                   F2 = 26 - 50
                   F3 = 51 - 75
                   COV = F1*F2, F2*F3, F1*F3'

dim_structure <- mirt::mirt.model(test_structure)

MOD2 <- mirt::mirt(dat, dim_structure, itemtype = '2PL', method = 'MHRM')

out <- coef(MOD2)

Does anyone have an opinion on the issue?

Phil Chalmers

unread,
Sep 24, 2018, 9:52:45 AM9/24/18
to KMug...@gmail.com, mirt-package
This looks like pretty standard syntax, so I don't see why there would be a problem. Can you provide a reproducible example with these code?

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.

TingJhen Jiang

unread,
Apr 25, 2020, 6:03:51 AM4/25/20
to mirt-package
I have the same issue.
And after examination, I find out that it is because while I did not include library(mirt) before, I in fact called stats::coef instead of mirt::coef by calling coef().
Only mirt::coef works.

Spike於 2018年9月24日星期一 UTC+8下午8時06分58秒寫道:
Reply all
Reply to author
Forward
0 new messages