library("psychotools")
o <- options(digits = 3)
## load verbal aggression data
data("VerbalAggression", package = "psychotools")
## fit a Rasch model to dichotomized verbal aggression data and
ram <- raschmodel(VerbalAggression$resp2)
## extract person parameters
## (= parameters of the underlying ability distribution)
rap <- personpar(ram)
rapItem response person parameters (RM):
1 2 3 4 5 6 7 8 9 10
-3.6185 -2.8441 -2.3552 -1.9815 -1.6694 -1.3947 -1.1444 -0.9104 -0.6872 -0.4708
11 12 13 14 15 16 17 18 19 20
-0.2581 -0.0464 0.1670 0.3845 0.6090 0.8438 1.0931 1.3629 1.6616 2.0035
21 22 23
2.4140 2.9489 3.7813
1 2 3 4 5 6 7 8 9 10 11 12 13
1.039 0.763 0.647 0.581 0.539 0.511 0.491 0.477 0.468 0.463 0.460 0.461 0.464
14 15 16 17 18 19 20 21 22 23
0.470 0.479 0.491 0.508 0.531 0.563 0.609 0.677 0.796 1.070
## Wald confidence intervals
confint(rap) 2.5 % 97.5 %
1 -5.6555 -1.5814
2 -4.3397 -1.3485
3 -3.6224 -1.0880
4 -3.1200 -0.8430
5 -2.7259 -0.6128
6 -2.3957 -0.3937
7 -2.1068 -0.1820
8 -1.8459 0.0252
9 -1.6048 0.2304
10 -1.3776 0.4359
11 -1.1601 0.6439
12 -0.9491 0.8564
13 -0.7418 1.0758
14 -0.5359 1.3049
15 -0.3290 1.5470
16 -0.1189 1.8065
17 0.0969 2.0894
18 0.3212 2.4045
19 0.5576 2.7657
20 0.8106 3.1963
21 1.0861 3.7418
22 1.3885 4.5093
23 1.6838 5.8789
## now match each person to person parameter with the corresponding raw score
personpar(ram, personwise = TRUE)[1:6] 1 2 3 4 5 6
-0.687 -3.618 -0.471 0.385 -0.471 -0.258
[,1] [,2]
1 -3.7657 -3.7851
2 -3.0721 -3.0866
3 -2.6623 -2.6730
4 -2.3672 -2.3749
5 -2.1338 -2.1392
6 -1.9390 -1.9424
7 -1.7701 -1.7721
8 -1.6200 -1.6208
9 -1.4837 -1.4837
10 -1.3583 -1.3574
11 -1.2412 -1.2398
12 -1.1309 -1.1291
13 -1.0260 -1.0239
14 -0.9256 -0.9232
15 -0.8287 -0.8262
16 -0.7348 -0.7322
17 -0.6433 -0.6407
18 -0.5537 -0.5511
19 -0.4657 -0.4631
20 -0.3787 -0.3762
21 -0.2926 -0.2902
22 -0.2069 -0.2047
23 -0.1215 -0.1195
24 -0.0360 -0.0343
25 0.0499 0.0513
26 0.1363 0.1374
27 0.2237 0.2244
28 0.3122 0.3125
29 0.4023 0.4021
30 0.4942 0.4934
31 0.5883 0.5870
32 0.6851 0.6833
33 0.7850 0.7826
34 0.8887 0.8857
35 0.9968 0.9933
36 1.1103 1.1063
37 1.2300 1.2257
38 1.3575 1.3530
39 1.4945 1.4900
40 1.6432 1.6391
41 1.8071 1.8038
42 1.9907 1.9889
43 2.2013 2.2021
44 2.4512 2.4556
45 2.7629 2.7727
46 3.1880 3.2054
47 3.8932 3.9209
if(requireNamespace("mirt")) {
## fit a 2PL accounting for gender impact and
twoplm <- nplmodel(VerbalAggression$resp2, impact = VerbalAggression$gender)
## extract the person parameters
## (= mean/variance parameters from the normal ability distribution)
twoplp <- personpar(twoplm)
twoplp
## extract the standard errors
sqrt(diag(vcov(twoplp)))
## Wald confidence intervals
confint(twoplp)
## now look at the individual person parameters
## (integrated out over the normal ability distribution)
personpar(twoplm, personwise = TRUE)[1:6]
} 1 2 3 4 5 6
-0.351 -1.695 -0.134 0.472 -0.172 -0.125
options(digits = o$digits)