score: Function to score the response files

Description Usage Arguments Author(s) See Also Examples

Description

This function can score multiple choice item responses. This function can also call and return results from function reliability.

Usage

1
2
score(items,key,output.scored=FALSE,ID=NA,rel=FALSE,multiKeySep="none",
         multiKeyScore=c("or","poly"))

Arguments

items

The item responses to be scored

key

The answer key

output.scored

If output.scored=FALSE (the default) only a vector of scores is returned. If output.scored=TRUE a matrix containing scored items is returned.

ID

If respondent IDs are provided scores are labeled appropriately.

rel

If rel=TRUE, the function will call the function reliability and provide that output as well.

multiKeySep

If a value other than "none" is provided (e.g., ","), the key and the raw items will be reviewed for the provided delimiter. Using this otion allows for multiple correct responses.

multiKeyScore

The first value controls how multiple keys are handled. If "or" any correct response results in score of 1. If "and" all responses must be correct. If the second value is "poly" the returned score is the sum of correct responses. If the second value is "dich" a maximum score of 1 is returned. If the respondent can only provide one response, use "or". If the responded can provide multiple responses and you use c("and", "poly") the score will be 0 or max score.

Author(s)

John T. Willse

See Also

reliability

Examples

1
2
3
4
5
6
7
8
9
# Example data provided with package
data(CTTdata)
data(CTTkey)

# Scores for each preson 
score(CTTdata,CTTkey)

# Scores, scored file, and relibility
score(CTTdata,CTTkey,output.scored=TRUE,rel=TRUE)

Example output

$score
  P1   P2   P3   P4   P5   P6   P7   P8   P9  P10  P11  P12  P13  P14  P15  P16 
   1    9    2    7   13    5    4   12   12    7   13    4   13   12   18    5 
 P17  P18  P19  P20  P21  P22  P23  P24  P25  P26  P27  P28  P29  P30  P31  P32 
   5    5    8    9   12    5    6    8    9    5    6    8    7    5   10    6 
 P33  P34  P35  P36  P37  P38  P39  P40  P41  P42  P43  P44  P45  P46  P47  P48 
   5    5    7    3   11    7    7    8    4    7   10    7    7    7   17   17 
 P49  P50  P51  P52  P53  P54  P55  P56  P57  P58  P59  P60  P61  P62  P63  P64 
  15    7    8   12   12    4    5    5    5   14    9    7   17    6   13   15 
 P65  P66  P67  P68  P69  P70  P71  P72  P73  P74  P75  P76  P77  P78  P79  P80 
   4    9    3   18   20   19   10    9   12   10   13    9   12   12   15   15 
 P81  P82  P83  P84  P85  P86  P87  P88  P89  P90  P91  P92  P93  P94  P95  P96 
  14   13    7    4    5   18   10   13   19   15    6    6    4   13    7   12 
 P97  P98  P99 P100 
  15   17   10   16 

$score
  P1   P2   P3   P4   P5   P6   P7   P8   P9  P10  P11  P12  P13  P14  P15  P16 
   1    9    2    7   13    5    4   12   12    7   13    4   13   12   18    5 
 P17  P18  P19  P20  P21  P22  P23  P24  P25  P26  P27  P28  P29  P30  P31  P32 
   5    5    8    9   12    5    6    8    9    5    6    8    7    5   10    6 
 P33  P34  P35  P36  P37  P38  P39  P40  P41  P42  P43  P44  P45  P46  P47  P48 
   5    5    7    3   11    7    7    8    4    7   10    7    7    7   17   17 
 P49  P50  P51  P52  P53  P54  P55  P56  P57  P58  P59  P60  P61  P62  P63  P64 
  15    7    8   12   12    4    5    5    5   14    9    7   17    6   13   15 
 P65  P66  P67  P68  P69  P70  P71  P72  P73  P74  P75  P76  P77  P78  P79  P80 
   4    9    3   18   20   19   10    9   12   10   13    9   12   12   15   15 
 P81  P82  P83  P84  P85  P86  P87  P88  P89  P90  P91  P92  P93  P94  P95  P96 
  14   13    7    4    5   18   10   13   19   15    6    6    4   13    7   12 
 P97  P98  P99 P100 
  15   17   10   16 

$reliability

 Number of Items 
 20 

 Number of Examinees 
 100 

 Coefficient Alpha 
 0.813 

$scored
    i1 i2 i3 i4 i5 i6 i7 i8 i9 i10 i11 i12 i13 i14 i15 i16 i17 i18 i19 i20
1    0  0  0  0  0  0  0  0  0   0   0   0   0   0   0   0   0   0   1   0
2    0  0  1  1  0  0  1  1  1   1   0   1   0   0   0   1   0   1   0   0
3    0  0  0  1  0  0  0  0  0   0   0   0   0   0   0   0   0   0   0   1
4    0  1  0  1  1  1  0  0  1   0   1   0   1   0   0   0   0   0   0   0
5    0  0  1  1  0  1  1  1  0   0   1   1   1   1   0   1   0   1   1   1
6    0  0  0  0  0  1  0  0  0   1   0   0   1   1   0   0   1   0   0   0
7    0  0  0  0  0  1  1  1  0   0   0   0   0   0   1   0   0   0   0   0
8    0  1  1  1  0  1  1  0  0   1   0   1   1   1   1   0   1   0   1   0
9    1  0  1  1  1  1  1  1  0   1   0   0   0   1   0   0   1   1   0   1
10   0  1  1  0  0  0  1  0  0   1   0   1   0   0   1   1   0   0   0   0
11   1  0  0  0  1  1  1  1  1   1   1   1   0   1   0   1   1   0   1   0
12   0  0  1  1  0  1  0  0  0   0   0   0   0   0   0   1   0   0   0   0
13   1  1  0  0  1  1  1  1  0   1   0   1   1   1   0   1   1   1   0   0
14   1  1  0  1  0  1  1  1  1   0   0   1   1   0   1   0   1   0   0   1
15   1  1  1  1  1  1  1  1  1   1   1   0   1   1   1   1   0   1   1   1
16   0  1  0  0  0  0  1  0  0   1   0   0   1   0   0   0   0   1   0   0
17   1  0  1  0  1  0  0  0  0   1   0   0   0   0   0   1   0   0   0   0
18   0  0  0  0  0  1  1  0  0   0   0   0   1   0   0   1   0   0   1   0
19   1  0  1  0  1  0  1  1  1   0   0   1   0   1   0   0   0   0   0   0
20   0  1  1  1  0  0  0  0  1   0   1   0   1   1   0   0   0   0   1   1
21   1  1  1  1  0  1  1  0  0   1   1   1   1   1   0   1   0   0   0   0
22   0  0  0  0  0  1  1  0  1   0   0   1   0   0   1   0   0   0   0   0
23   0  1  0  0  0  0  1  1  1   1   0   1   0   0   0   0   0   0   0   0
24   0  1  1  0  0  0  1  1  0   1   0   0   1   1   0   0   0   0   0   1
25   1  0  0  0  0  1  1  1  0   1   0   1   0   0   1   1   0   1   0   0
26   0  0  1  0  0  1  0  0  0   0   1   0   0   0   0   0   1   0   0   1
27   0  0  0  0  0  0  1  0  0   1   0   1   1   0   0   0   1   1   0   0
28   1  1  0  0  0  1  0  0  0   0   0   1   1   1   1   0   0   0   0   1
29   1  0  0  0  1  1  1  0  1   0   0   1   1   0   0   0   0   0   0   0
30   0  0  0  0  1  1  0  1  0   0   0   0   0   1   0   0   0   1   0   0
31   1  1  0  0  0  1  1  0  0   1   0   1   1   1   1   0   0   0   0   1
32   0  0  1  0  1  1  0  0  1   1   1   0   0   0   0   0   0   0   0   0
33   0  0  1  0  0  0  0  0  0   1   1   0   0   0   1   0   0   0   0   1
34   1  0  0  0  0  1  0  1  0   0   0   1   1   0   0   0   0   0   0   0
35   0  1  0  0  1  1  1  1  0   1   0   0   1   0   0   0   0   0   0   0
36   0  0  0  0  0  1  0  1  0   0   0   0   0   1   0   0   0   0   0   0
37   1  1  1  0  0  1  1  1  0   0   1   1   1   0   0   1   1   0   0   0
38   1  1  0  0  0  1  1  1  0   0   0   1   0   0   0   0   1   0   0   0
39   0  1  0  0  0  1  1  1  0   1   1   0   0   0   0   1   0   0   0   0
40   1  1  1  0  1  1  1  0  0   0   0   0   1   0   0   0   0   0   1   0
41   0  1  0  0  0  0  0  0  1   1   0   0   0   0   0   0   0   0   1   0
42   0  0  0  1  0  1  0  1  0   1   0   1   1   0   0   0   1   0   0   0
43   0  0  0  0  0  1  1  1  1   1   0   1   1   0   0   0   0   1   1   1
44   0  0  1  0  0  1  1  1  0   0   0   0   1   1   0   0   1   0   0   0
45   1  0  0  0  0  1  1  0  0   1   0   0   1   1   0   0   0   0   1   0
46   1  0  0  0  0  1  1  1  1   0   0   0   0   0   1   1   0   0   0   0
47   1  1  1  1  1  1  1  1  1   1   0   1   1   1   1   0   1   1   0   1
48   1  1  1  1  0  1  1  1  1   1   1   1   1   1   1   0   1   1   0   1
49   1  1  0  0  0  1  1  1  1   0   1   1   1   0   1   1   1   1   1   1
50   0  0  1  0  0  1  1  1  0   0   0   0   1   0   1   0   0   1   0   0
51   0  0  1  0  0  1  1  0  0   1   0   1   1   1   0   0   0   1   0   0
52   1  1  0  1  1  1  1  1  1   1   0   1   1   0   0   0   0   0   1   0
53   1  1  0  1  1  1  1  0  0   1   1   1   1   0   1   0   1   0   0   0
54   0  0  1  1  0  1  0  1  0   0   0   0   0   0   0   0   0   0   0   0
55   0  1  1  0  0  1  1  0  0   0   0   0   1   0   0   0   0   0   0   0
56   0  0  0  1  0  1  1  0  0   0   0   0   0   0   1   0   0   1   0   0
57   0  0  1  0  0  0  1  1  0   0   0   0   1   1   0   0   0   0   0   0
58   0  0  1  0  1  1  1  0  1   1   1   1   1   1   0   0   1   1   1   1
59   1  1  1  0  0  1  1  0  0   1   0   0   1   0   0   0   0   1   1   0
60   0  0  0  0  0  1  1  0  1   1   0   1   1   1   0   0   0   0   0   0
61   1  1  1  1  1  1  1  1  0   1   1   1   0   1   1   1   1   1   0   1
62   0  0  1  0  0  0  1  1  0   0   1   0   0   0   1   0   1   0   0   0
63   1  1  1  0  0  1  1  0  0   0   1   1   1   1   0   1   1   0   1   1
64   1  1  1  0  0  1  1  1  0   1   1   1   1   1   1   1   0   1   0   1
65   0  0  1  0  0  1  0  0  0   0   0   0   1   0   0   0   0   0   0   1
66   0  1  0  0  1  0  0  1  0   0   0   1   1   0   0   1   1   1   1   0
67   0  0  0  0  0  1  0  0  0   0   0   0   0   0   1   0   0   0   1   0
68   1  1  1  1  1  1  1  1  1   1   1   1   1   1   1   0   1   0   1   1
69   1  1  1  1  1  1  1  1  1   1   1   1   1   1   1   1   1   1   1   1
70   1  1  1  1  1  1  1  1  1   1   1   1   1   1   1   0   1   1   1   1
71   0  1  0  0  1  1  0  1  0   0   1   1   1   0   1   0   1   0   1   0
72   0  1  1  0  0  0  1  1  0   0   1   1   1   1   0   0   1   0   0   0
73   1  0  1  0  0  1  1  1  0   0   1   0   0   1   1   1   1   0   1   1
74   0  1  0  1  0  1  0  0  0   1   1   0   1   1   1   0   1   0   0   1
75   1  1  1  1  1  1  1  0  0   0   0   1   1   1   0   0   0   1   1   1
76   1  1  0  0  1  1  0  0  0   1   1   1   1   1   0   0   0   0   0   0
77   1  1  1  1  0  1  1  1  0   0   1   1   0   1   1   0   1   0   0   0
78   0  1  1  0  0  1  1  1  0   0   1   1   1   1   0   1   0   0   1   1
79   1  1  0  1  0  1  1  0  1   1   0   1   1   1   1   1   1   0   1   1
80   1  1  1  1  1  1  1  1  1   1   0   1   1   1   0   0   1   1   0   0
81   1  1  1  0  1  1  1  1  1   0   1   1   1   1   1   0   0   0   1   0
82   0  1  1  0  1  1  1  1  1   0   1   1   0   1   0   1   0   0   1   1
83   0  1  1  1  0  0  0  0  0   1   0   0   0   1   0   1   0   0   0   1
84   0  0  0  0  0  1  0  0  0   0   0   0   1   0   1   0   0   0   0   1
85   0  0  1  0  0  1  1  1  0   0   0   0   0   0   0   0   1   0   0   0
86   1  1  1  1  1  1  1  1  1   1   1   1   1   1   1   0   1   1   1   0
87   0  1  1  0  0  1  1  1  1   0   1   1   0   1   0   0   0   0   0   1
88   0  1  0  1  1  1  1  1  0   1   1   1   1   1   0   1   0   0   1   0
89   1  1  1  1  1  1  1  1  1   1   1   1   1   1   1   0   1   1   1   1
90   1  1  1  1  1  1  1  1  0   0   1   1   0   1   0   1   1   1   0   1
91   1  0  1  0  1  1  0  0  0   0   0   0   0   0   0   1   0   0   0   1
92   1  0  0  0  0  1  0  0  0   1   0   0   1   0   1   1   0   0   0   0
93   0  0  1  0  0  1  0  0  0   0   0   1   0   0   1   0   0   0   0   0
94   1  0  0  0  0  1  1  1  0   1   1   1   1   1   1   1   1   0   0   1
95   0  0  0  0  1  1  0  0  0   1   0   1   1   1   0   0   0   1   0   0
96   1  1  1  1  1  1  1  1  0   0   0   1   0   0   0   0   1   1   0   1
97   1  1  0  1  1  1  1  1  0   1   1   1   1   1   1   0   1   0   0   1
98   1  1  1  1  0  1  1  1  0   1   1   1   1   1   1   0   1   1   1   1
99   0  0  1  0  1  1  1  1  0   1   0   0   1   1   0   1   1   0   0   0
100  1  0  1  1  1  1  1  1  0   1   1   1   0   1   0   1   1   1   1   1

CTT documentation built on May 2, 2019, 1:08 p.m.