# loading required packages
library(ltm)
library(psych)
library(CTT)
library(itemanalysis)

# read in data file
data("dichotomous")
dat <- dichotomous
options(scipen = 999)

# Math subscale
math <- dat[,1:10]

# Check cases with missing data
sum(is.na(math))
## [1] 526
# removing case with missing data
math.no.na <- na.omit(math)

# Scoring multiple-choice items to generate dichotomous data
key <- c("A","D","C","B","C","B","C","D","A","D")

scored <- CTT::score(math.no.na, key, output.scored=TRUE)

# Extract dichotomous responses
math.dich <- as.data.frame(scored$scored)

# Compute total score
math.dich$total <- apply(math.dich, 1, sum)

# Item analysis
psych::alpha(math.dich[,1:10])
## 
## Reliability analysis   
## Call: psych::alpha(x = math.dich[, 1:10])
## 
##   raw_alpha std.alpha G6(smc) average_r S/N    ase mean   sd median_r
##       0.63      0.65    0.63      0.15 1.8 0.0074 0.68 0.21     0.15
## 
##     95% confidence boundaries 
##          lower alpha upper
## Feldt     0.61  0.63  0.64
## Duhachek  0.61  0.63  0.64
## 
##  Reliability if an item is dropped:
##        raw_alpha std.alpha G6(smc) average_r S/N alpha se  var.r med.r
## item1       0.60      0.63    0.60      0.16 1.7   0.0079 0.0036  0.15
## item2       0.62      0.64    0.62      0.16 1.8   0.0075 0.0030  0.15
## item3       0.58      0.60    0.57      0.14 1.5   0.0083 0.0023  0.14
## item4       0.62      0.64    0.61      0.16 1.7   0.0076 0.0034  0.15
## item5       0.61      0.63    0.61      0.16 1.7   0.0077 0.0032  0.15
## item6       0.59      0.62    0.59      0.15 1.6   0.0080 0.0032  0.15
## item7       0.61      0.63    0.61      0.16 1.7   0.0077 0.0035  0.15
## item8       0.59      0.60    0.58      0.14 1.5   0.0082 0.0024  0.14
## item9       0.61      0.63    0.61      0.16 1.7   0.0077 0.0034  0.15
## item10      0.58      0.60    0.58      0.14 1.5   0.0083 0.0023  0.14
## 
##  Item statistics 
##           n raw.r std.r r.cor r.drop mean   sd
## item1  5764  0.47  0.47  0.36   0.29 0.72 0.45
## item2  5764  0.43  0.41  0.28   0.22 0.54 0.50
## item3  5764  0.56  0.58  0.53   0.41 0.82 0.38
## item4  5764  0.45  0.43  0.30   0.24 0.58 0.49
## item5  5764  0.46  0.45  0.33   0.26 0.66 0.47
## item6  5764  0.50  0.51  0.42   0.33 0.74 0.44
## item7  5764  0.47  0.45  0.33   0.26 0.47 0.50
## item8  5764  0.52  0.57  0.50   0.40 0.87 0.34
## item9  5764  0.46  0.44  0.32   0.25 0.55 0.50
## item10 5764  0.55  0.57  0.51   0.40 0.82 0.38
## 
## Non missing response frequency for each item
##           0    1 miss
## item1  0.28 0.72    0
## item2  0.46 0.54    0
## item3  0.18 0.82    0
## item4  0.42 0.58    0
## item5  0.34 0.66    0
## item6  0.26 0.74    0
## item7  0.53 0.47    0
## item8  0.13 0.87    0
## item9  0.45 0.55    0
## item10 0.18 0.82    0
IA1 <-ltm::descript(math.dich[,1:10])
IA1
## 
## Descriptive statistics for the 'math.dich[, 1:10]' data-set
## 
## Sample:
##  10 items and 5764 sample units; 0 missing values
## 
## Proportions for each level of response:
##             0      1   logit
## item1  0.2837 0.7163  0.9264
## item2  0.4627 0.5373  0.1495
## item3  0.1778 0.8222  1.5311
## item4  0.4186 0.5814  0.3284
## item5  0.3357 0.6643  0.6825
## item6  0.2569 0.7431  1.0619
## item7  0.5324 0.4676 -0.1300
## item8  0.1315 0.8685  1.8877
## item9  0.4454 0.5546  0.2195
## item10 0.1782 0.8218  1.5288
## 
## 
## Frequencies of total scores:
##       0  1   2   3   4   5   6    7    8   9  10
## Freq 22 67 159 266 389 556 809 1040 1131 888 437
## 
## 
## Point Biserial correlation with Total Score:
##        Included Excluded
## item1    0.4739   0.2872
## item2    0.4340   0.2186
## item3    0.5555   0.4134
## item4    0.4467   0.2357
## item5    0.4558   0.2562
## item6    0.5028   0.3273
## item7    0.4689   0.2587
## item8    0.5242   0.3956
## item9    0.4627   0.2524
## item10   0.5455   0.4014
## 
## 
## Cronbach's alpha:
##                   value
## All Items        0.6264
## Excluding item1  0.6030
## Excluding item2  0.6204
## Excluding item3  0.5793
## Excluding item4  0.6160
## Excluding item5  0.6104
## Excluding item6  0.5942
## Excluding item7  0.6107
## Excluding item8  0.5866
## Excluding item9  0.6121
## Excluding item10 0.5816
## 
## 
## Pairwise Associations:
##    Item i Item j           p.value
## 1       2      5 0.000068454720995
## 2       4      9 0.000000000084088
## 3       5      7 0.000000000003804
## 4       2      9 0.000000000000794
## 5       2      4 0.000000000000720
## 6       2      6 0.000000000000146
## 7       5      9 0.000000000000017
## 8       4      7 0.000000000000015
## 9       2      7 0.000000000000006
## 10      4      5 0.000000000000002
IA2 <- CTT::itemAnalysis(math.dich[,1:10])
IA2$itemReport
##    itemName  itemMean      pBis       bis alphaIfDeleted
## 1     item1 0.7163428 0.2872076 0.3822021      0.6029544
## 2     item2 0.5373005 0.2185598 0.2743609      0.6204166
## 3     item3 0.8221721 0.4133883 0.6070073      0.5792550
## 4     item4 0.5813671 0.2357169 0.2977029      0.6160138
## 5     item5 0.6642956 0.2562270 0.3318574      0.6103664
## 6     item6 0.7430604 0.3272913 0.4435998      0.5941805
## 7     item7 0.4675573 0.2586720 0.3245880      0.6106904
## 8     item8 0.8684941 0.3956367 0.6270355      0.5866187
## 9     item9 0.5546495 0.2524451 0.3174810      0.6121342
## 10   item10 0.8218251 0.4014348 0.5891809      0.5815800
# What is the mean item difficulties? 
mean(IA2$itemReport$itemMean) 
## [1] 0.6777065
IA3 <- psychometric::item.exam(math.dich[,1:10], discrim=T)
IA3
##        Sample.SD Item.total Item.Tot.woi Difficulty Discrimination
## item1  0.4508115  0.4739252    0.2872076  0.7163428      0.4591359
## item2  0.4986500  0.4339562    0.2185598  0.5373005      0.4705882
## item3  0.3824010  0.5555382    0.4133883  0.8221721      0.4143675
## item4  0.4933778  0.4467196    0.2357169  0.5813671      0.4934930
## item5  0.4722771  0.4558265    0.2562270  0.6642956      0.4726705
## item6  0.4369837  0.5028496    0.3272913  0.7430604      0.4622592
## item7  0.4989896  0.4688565    0.2586720  0.4675573      0.5497137
## item8  0.3379821  0.5242145    0.3956367  0.8684941      0.3342009
## item9  0.4970476  0.4627098    0.2524451  0.5546495      0.5262884
## item10 0.3826931  0.5455200    0.4014348  0.8218251      0.4185320
##        Item.Criterion Item.Reliab Item.Rel.woi Item.Validity
## item1              NA   0.2136324    0.1294652            NA
## item2              NA   0.2163735    0.1089754            NA
## item3              NA   0.2124199    0.1580664            NA
## item4              NA   0.2203824    0.1162874            NA
## item5              NA   0.2152578    0.1209996            NA
## item6              NA   0.2197180    0.1430085            NA
## item7              NA   0.2339342    0.1290635            NA
## item8              NA   0.1771598    0.1337065            NA
## item9              NA   0.2299688    0.1254663            NA
## item10             NA   0.2087486    0.1536130            NA
# Item Characteristic Curves of Items
par(mfrow=c(1,2))
CTT :: cttICC(score = math.dich$total, itemVector = math.dich[,1], colTheme="spartans", cex=1.5)
CTT :: cttICC(score = math.dich$total, itemVector = math.dich[,2], colTheme="spartans", cex=1.5)

CTT :: cttICC(score = math.dich$total, itemVector = math.dich[,3], colTheme="spartans", cex=1.5)
CTT :: cttICC(score = math.dich$total, itemVector = math.dich[,4], colTheme="spartans", cex=1.5)

CTT :: cttICC(score = math.dich$total, itemVector = math.dich[,5], colTheme="spartans", cex=1.5)
CTT :: cttICC(score = math.dich$total, itemVector = math.dich[,6], colTheme="spartans", cex=1.5)

CTT :: cttICC(score = math.dich$total, itemVector = math.dich[,7], colTheme="spartans", cex=1.5)
CTT :: cttICC(score = math.dich$total, itemVector = math.dich[,8], colTheme="spartans", cex=1.5)

CTT :: cttICC(score = math.dich$total, itemVector = math.dich[,9], colTheme="spartans", cex=1.5)
CTT :: cttICC(score = math.dich$total, itemVector = math.dich[,10], colTheme="spartans", cex=1.5)

# Distractor/Option Analysis
distractorAnalysis(items = math.no.na, key = key, nGroups = 4, pTable = T)
## $item1
##   correct key    n       rspP       pBis    discrim     lower      mid50
## A       *   A 4129 0.71634282  0.2872076  0.5486286 0.4174092 0.68685776
## B           B  438 0.07598890 -0.3508862 -0.1644885 0.1720356 0.07247161
## C           C  466 0.08084663 -0.4149051 -0.2026014 0.2056203 0.07247161
## D           D  731 0.12682165 -0.3397622 -0.1815387 0.2049349 0.16819903
##        mid75       upper
## A 0.85764810 0.966037736
## B 0.03801945 0.007547170
## C 0.02475685 0.003018868
## D 0.07957560 0.023396226
## 
## $item2
##   correct key    n      rspP       pBis    discrim     lower     mid50
## A           A  829 0.1438237 -0.2646521 -0.1039032 0.1740918 0.1730665
## B           B  857 0.1486815 -0.3517244 -0.1905642 0.2350925 0.1773932
## C           C  981 0.1701943 -0.4301121 -0.2925659 0.3235093 0.1871282
## D       *   D 3097 0.5373005  0.2185598  0.5870332 0.2673064 0.4624121
##       mid75      upper
## A 0.1432361 0.07018868
## B 0.1122900 0.04452830
## C 0.1078691 0.03094340
## D 0.6366048 0.85433962
## 
## $item3
##   correct key    n       rspP       pBis    discrim     lower      mid50
## A           A  260 0.04510756 -0.3545343 -0.1336532 0.1336532 0.03136831
## B           B  337 0.05846634 -0.4023818 -0.1684700 0.1699794 0.03948080
## C       *   C 4739 0.82217210  0.4133883  0.5094531 0.4852639 0.87560844
## D           D  428 0.07425399 -0.4239762 -0.2073299 0.2111035 0.05354246
##         mid75       upper
## A 0.006189213 0.000000000
## B 0.012378426 0.001509434
## C 0.967285588 0.994716981
## D 0.014146773 0.003773585
## 
## $item4
##   correct key    n      rspP       pBis    discrim     lower     mid50
## A           A  799 0.1386190 -0.3380814 -0.1771950 0.2254969 0.1535965
## B       *   B 3351 0.5813671  0.2357169  0.5829441 0.2940370 0.5229854
## C           C  792 0.1374046 -0.3336456 -0.1701408 0.2131597 0.1595457
## D           D  822 0.1426093 -0.3978884 -0.2356083 0.2673064 0.1638724
##        mid75      upper
## A 0.10786914 0.04830189
## B 0.70114943 0.87698113
## C 0.11405836 0.04301887
## D 0.07692308 0.03169811
## 
## $item5
##   correct key    n      rspP       pBis    discrim     lower      mid50
## A           A  427 0.0740805 -0.3899011 -0.1801834 0.1884853 0.06057328
## B           B  657 0.1139833 -0.3585149 -0.1821470 0.2138451 0.11736074
## C       *   C 3829 0.6642956  0.2562270  0.5609192 0.3598355 0.64359113
## D           D  851 0.1476405 -0.3443062 -0.1985888 0.2378341 0.17847485
##        mid75       upper
## A 0.02564103 0.008301887
## B 0.07603890 0.031698113
## C 0.79045093 0.920754717
## D 0.10786914 0.039245283
## 
## $item6
##   correct key    n       rspP       pBis    discrim     lower      mid50
## A           A  414 0.07182512 -0.4033796 -0.1917043 0.1939685 0.05840995
## B       *   B 4283 0.74306037  0.3272913  0.5509698 0.4256340 0.73931855
## C           C  768 0.13324080 -0.3874644 -0.2148538 0.2337217 0.16441320
## D           D  299 0.05187370 -0.3519660 -0.1444117 0.1466758 0.03785830
##        mid75       upper
## A 0.01768347 0.002264151
## B 0.88505747 0.976603774
## C 0.08664898 0.018867925
## D 0.01061008 0.002264151
## 
## $item7
##   correct key    n      rspP       pBis    discrim     lower     mid50
## A           A 1089 0.1889313 -0.4307031 -0.2996894 0.3351611 0.2195782
## B           B 1045 0.1812977 -0.3260854 -0.1837640 0.2426319 0.2266090
## C       *   C 2695 0.4675573  0.2586720  0.6738790 0.1857437 0.3585722
## D           D  935 0.1622137 -0.3301125 -0.1904256 0.2364633 0.1952407
##       mid75      upper
## A 0.1299735 0.03547170
## B 0.1715296 0.05886792
## C 0.5499558 0.85962264
## D 0.1485411 0.04603774
## 
## $item8
##   correct key    n       rspP       pBis     discrim      lower      mid50
## A           A  158 0.02741152 -0.2980341 -0.08766201 0.08841672 0.01297999
## B           B  348 0.06037474 -0.4245712 -0.19122687 0.19122687 0.03028664
## C           C  252 0.04371964 -0.3810814 -0.13838168 0.13913639 0.01892915
## D       *   D 5006 0.86849410  0.3956367  0.41727055 0.58122001 0.93780422
##         mid75       upper
## A 0.003536693 0.000754717
## B 0.011494253 0.000000000
## C 0.011494253 0.000754717
## D 0.973474801 0.998490566
## 
## $item9
##   correct key    n       rspP       pBis    discrim     lower      mid50
## A       *   A 3197 0.55464955  0.2524451  0.6216809 0.2666210 0.46619794
## B           B  955 0.16568355 -0.3997614 -0.2438946 0.2823852 0.19848567
## C           C  531 0.09212353 -0.3693713 -0.1902564 0.2008225 0.09626825
## D           D 1081 0.18754337 -0.3329315 -0.1875298 0.2501714 0.23904813
##        mid75      upper
## A 0.67992927 0.88830189
## B 0.11052166 0.03849057
## C 0.04067197 0.01056604
## D 0.16887710 0.06264151
## 
## $item10
##   correct key    n       rspP       pBis    discrim     lower      mid50
## A           A  202 0.03504511 -0.3565783 -0.1172036 0.1172036 0.01622499
## B           B  435 0.07546842 -0.4190325 -0.2055510 0.2063057 0.05786912
## C           C  390 0.06766135 -0.3952812 -0.1715504 0.1768334 0.05678745
## D       *   D 4737 0.82182512  0.4014348  0.4943050 0.4996573 0.86911844
##          mid75       upper
## A 0.0008841733 0.000000000
## B 0.0229885057 0.000754717
## C 0.0176834660 0.005283019
## D 0.9584438550 0.993962264
itemanalysis1(math.no.na, key=key, options = c("A","B","C","D"), ngroup = 10,
                 correction = TRUE)
## ************************************************************************ 
## itemanalysis: An R package for Classical Test Theory Item Analysis 
##  
## Cengiz Zopluoglu 
##  
## University of Oregon 
## College of Education 
##  
## cen.zop@gmail.com 
##  
## Please report any programming bug or problem you experience to improve the code. 
## ************************************************************************* 
## Processing Date:  Sat Apr 15 11:51:48 2023 
## 
##                                    ITEM STATISTICS 
##  
##        Item Difficulty Item Threshold Point-Biserial Biserial
## item1            0.716         -0.572          0.287    0.382
## item2            0.537         -0.094          0.219    0.274
## item3            0.822         -0.924          0.413    0.607
## item4            0.581         -0.205          0.236    0.298
## item5            0.664         -0.424          0.256    0.332
## item6            0.743         -0.653          0.327    0.444
## item7            0.468          0.081          0.259    0.325
## item8            0.868         -1.119          0.396    0.627
## item9            0.555         -0.137          0.252    0.317
## item10           0.822         -0.922          0.401    0.589
##  
##  
##  
##                   DISTRACTOR SELECTION PROPORTIONS 
##  
##            A     B     C     D Missing
## item1  0.716 0.076 0.081 0.127       0
## item2  0.144 0.149 0.170 0.537       0
## item3  0.045 0.058 0.822 0.074       0
## item4  0.139 0.581 0.137 0.143       0
## item5  0.074 0.114 0.664 0.148       0
## item6  0.072 0.743 0.133 0.052       0
## item7  0.189 0.181 0.468 0.162       0
## item8  0.027 0.060 0.044 0.868       0
## item9  0.555 0.166 0.092 0.188       0
## item10 0.035 0.075 0.068 0.822       0
##  
##  
##  
##                          DISTRACTOR Point-Biserial 
##  
##             A      B      C      D
## item1   0.287 -0.157 -0.226 -0.078
## item2  -0.007 -0.106 -0.183  0.219
## item3  -0.203 -0.234  0.413 -0.233
## item4  -0.090  0.236 -0.086 -0.159
## item5  -0.213 -0.125  0.256 -0.071
## item6  -0.223  0.327 -0.124 -0.196
## item7  -0.187 -0.064  0.259 -0.084
## item8  -0.173 -0.247 -0.228  0.396
## item9   0.252 -0.146 -0.183 -0.046
## item10 -0.227 -0.225 -0.209  0.401
##  
##  
##  
##                                DISTRACTOR Biserial 
##  
##             A      B      C      D
## item1   0.382 -0.292 -0.412 -0.125
## item2  -0.011 -0.163 -0.271  0.274
## item3  -0.444 -0.470  0.607 -0.435
## item4  -0.141  0.298 -0.135 -0.246
## item5  -0.399 -0.206  0.332 -0.110
## item6  -0.420  0.444 -0.195 -0.408
## item7  -0.271 -0.094  0.325 -0.126
## item8  -0.447 -0.491 -0.504  0.627
## item9   0.317 -0.219 -0.321 -0.067
## item10 -0.540 -0.417 -0.401  0.589
##  
##  
## 
## $item.stat
##        Item Difficulty Item Threshold Point-Biserial  Biserial
## item1        0.7163428    -0.57201123      0.2872076 0.3822021
## item2        0.5373005    -0.09363510      0.2185598 0.2743609
## item3        0.8221721    -0.92367453      0.4133883 0.6070073
## item4        0.5813671    -0.20539211      0.2357169 0.2977029
## item5        0.6642956    -0.42421538      0.2562270 0.3318574
## item6        0.7430604    -0.65280926      0.3272913 0.4435998
## item7        0.4675573     0.08141175      0.2586720 0.3245880
## item8        0.8684941    -1.11930089      0.3956367 0.6270355
## item9        0.5546495    -0.13741737      0.2524451 0.3174810
## item10       0.8218251    -0.92234287      0.4014348 0.5891809
## 
## $dist.sel
##                 A          B          C          D Missing
## item1  0.71634282 0.07598890 0.08084663 0.12682165       0
## item2  0.14382373 0.14868147 0.17019431 0.53730049       0
## item3  0.04510756 0.05846634 0.82217210 0.07425399       0
## item4  0.13861901 0.58136711 0.13740458 0.14260930       0
## item5  0.07408050 0.11398334 0.66429563 0.14764053       0
## item6  0.07182512 0.74306037 0.13324080 0.05187370       0
## item7  0.18893130 0.18129771 0.46755725 0.16221374       0
## item8  0.02741152 0.06037474 0.04371964 0.86849410       0
## item9  0.55464955 0.16568355 0.09212353 0.18754337       0
## item10 0.03504511 0.07546842 0.06766135 0.82182512       0
## 
## $dist.disc
##                   A           B           C           D
## item1   0.287207557 -0.15739047 -0.22639318 -0.07826719
## item2  -0.007421678 -0.10587128 -0.18282103  0.21855980
## item3  -0.203013659 -0.23369633  0.41338827 -0.23305151
## item4  -0.090241766  0.23571691 -0.08614857 -0.15856421
## item5  -0.213431746 -0.12508244  0.25622697 -0.07146401
## item6  -0.223030784  0.32729125 -0.12372650 -0.19558756
## item7  -0.187333164 -0.06407833  0.25867201 -0.08421074
## item8  -0.172641806 -0.24697122 -0.22836598  0.39563669
## item9   0.252445120 -0.14642218 -0.18326970 -0.04617808
## item10 -0.227052731 -0.22477014 -0.20897648  0.40143482
## 
## $dist.disc2
##                  A           B          C           D
## item1   0.38220207 -0.29169594 -0.4118335 -0.12525288
## item2  -0.01148935 -0.16250278 -0.2713042  0.27436089
## item3  -0.44365449 -0.46972724  0.6070073 -0.43495533
## item4  -0.14104775  0.29770294 -0.1349610 -0.24600980
## item5  -0.39862124 -0.20608772  0.3318574 -0.10988829
## item6  -0.42049298  0.44359984 -0.1954102 -0.40843256
## item7  -0.27117439 -0.09365914  0.3245880 -0.12645058
## item8  -0.44656925 -0.49140434 -0.5042163  0.62703545
## item9   0.31748097 -0.21872111 -0.3207867 -0.06696006
## item10 -0.53978849 -0.41744004 -0.4012916  0.58918086
## 
## $plots
## $plots[[1]]

## 
## $plots[[2]]

## 
## $plots[[3]]

## 
## $plots[[4]]

## 
## $plots[[5]]

## 
## $plots[[6]]

## 
## $plots[[7]]

## 
## $plots[[8]]

## 
## $plots[[9]]

## 
## $plots[[10]]

# Score transformation
math.dich$tscore <- round(CTT::score.transform(math.dich$total, mu.new = 50,sd.new = 10,normalize = T)$new.scores,0)

# percentile ranks
math.dich$p.score <- round(CTT::score.transform(math.dich$total, mu.new = 50,
                                sd.new = 10,normalize = T)$p.scores,3) 
math <- math.dich[order(math.dich$total, decreasing = F),]


norm <- data.frame(rawscore=math.dich$total, Tscore=math.dich$tscore, p.score= math.dich$p.score)
norm <- norm[order(norm$rawscore, decreasing = F),]
table(norm$rawscor, norm$Tscore)
##     
##        21   27   31   35   38   42   45   50   54   60   68
##   0    22    0    0    0    0    0    0    0    0    0    0
##   1     0   67    0    0    0    0    0    0    0    0    0
##   2     0    0  159    0    0    0    0    0    0    0    0
##   3     0    0    0  266    0    0    0    0    0    0    0
##   4     0    0    0    0  389    0    0    0    0    0    0
##   5     0    0    0    0    0  556    0    0    0    0    0
##   6     0    0    0    0    0    0  809    0    0    0    0
##   7     0    0    0    0    0    0    0 1040    0    0    0
##   8     0    0    0    0    0    0    0    0 1131    0    0
##   9     0    0    0    0    0    0    0    0    0  888    0
##   10    0    0    0    0    0    0    0    0    0    0  437
table(norm$rawscor, 100*norm$p.score) # percentile ranks for each raw score
##     
##       0.2    1  2.9  6.6 12.3 20.5 32.3 48.4 67.2 84.7 96.2
##   0    22    0    0    0    0    0    0    0    0    0    0
##   1     0   67    0    0    0    0    0    0    0    0    0
##   2     0    0  159    0    0    0    0    0    0    0    0
##   3     0    0    0  266    0    0    0    0    0    0    0
##   4     0    0    0    0  389    0    0    0    0    0    0
##   5     0    0    0    0    0  556    0    0    0    0    0
##   6     0    0    0    0    0    0  809    0    0    0    0
##   7     0    0    0    0    0    0    0 1040    0    0    0
##   8     0    0    0    0    0    0    0    0 1131    0    0
##   9     0    0    0    0    0    0    0    0    0  888    0
##   10    0    0    0    0    0    0    0    0    0    0  437
par(mfrow=c(1,2))
hist(math.dich$total)
hist(math.dich$tscore)