library("psychotools")
o <- options(digits = 4)
## load verbal aggression data
data("VerbalAggression", package = "psychotools")
## fit Rasch model to verbal aggression data
rmod <- raschmodel(VerbalAggression$resp2)
## extract the discrimination parameters
dp1 <- discrpar(rmod)
## extract the standard errors
sqrt(diag(vcov(dp1)))S1WantCurse S1DoCurse S1WantScold S1DoScold S1WantShout S1DoShout
0 0 0 0 0 0
S2WantCurse S2DoCurse S2WantScold S2DoScold S2WantShout S2DoShout
0 0 0 0 0 0
S3WantCurse S3DoCurse S3WantScold S3DoScold S3WantShout S3DoShout
0 0 0 0 0 0
S4WantCurse S4DoCurse S4WantScold S4DoScold S4WantShout S4DoShout
0 0 0 0 0 0
if(requireNamespace("mirt")) {
## fit 2PL to verbal aggression data
twoplmod <- nplmodel(VerbalAggression$resp2)
## extract the discrimination parameters
dp2 <- discrpar(twoplmod)
## this time with the first discrimination parameter being the reference
discrpar(twoplmod, ref = 1)
## extract the standard errors
sqrt(diag(vcov(dp2)))
}S1WantCurse S1DoCurse S1WantScold S1DoScold S1WantShout S1DoShout
0.2275 0.2688 0.2364 0.3494 0.2107 0.2226
S2WantCurse S2DoCurse S2WantScold S2DoScold S2WantShout S2DoShout
0.2580 0.2343 0.2455 0.2963 0.2017 0.2610
S3WantCurse S3DoCurse S3WantScold S3DoScold S3WantShout S3DoShout
0.1666 0.1837 0.2201 0.2244 0.1798 0.2483
S4WantCurse S4DoCurse S4WantScold S4DoScold S4WantShout S4DoShout
0.1990 0.2202 0.2408 0.2238 0.1774 0.2194
options(digits = o$digits)