subscales: Function to create subscales based on a design matrix

Description Usage Arguments Details Value Author(s) See Also Examples

Description

This convenience function is provided to facilitate extracting subscales from a single set of item responses.

Usage

1
2
subscales(items, scales, scale.names = NA, score.items = FALSE,
          check.reliability = FALSE, key=NA)

Arguments

items

The item response (scored or not)

scales

A design matrix, with items represented in rows and separate subscales represented in columns. An item may appear in more than one subscale.

scale.names

Optional vector of names for the subscales

score.items

If responses are not scored, they may be scored using score.items=TRUE (key must be provided)

check.reliability

If check.reliability=TRUE, the reliability for each subscale will be calculted

key

Optional key, required only if score.scales=TRUE.

Details

This function provides an easy way to create new datasets from a single set of item responses. This function is also a front end for score and reliability, enabling the item responses to be partitioned into separate scales, scored, and reliability analyses performed using this one function.

Value

A list is returned. Results for each subscale (i.e., column in the scales matrix) are provided as sparate objects in that list.

score

Each examinee's score on the associated subscale

reliablity

Reliability results (if requested) for the associated subscale

scored

The scored item responses (if required) for each respondent for the associated subscale

Author(s)

John Willse, Zhan Shu

See Also

reliability, score

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Example data included with package
data(CTTdata)
data(CTTkey)

# design matrix
q <- matrix(c(1,0,
              1,0,
              1,0,
              1,0,
              1,0,
              1,0,
              1,0,
              1,0,
              1,0,
              1,1,
              0,1,
              0,1,
              0,1,
              0,1,
              0,1,
              0,1,
              0,1,
              0,1,
              0,1,
              0,1), ncol=2, byrow=TRUE)
subscales(CTTdata,q,c("T1","T2"),TRUE,TRUE,CTTkey)

Example output

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

$T1$reliability

 Number of Items 
 10 

 Number of Examinees 
 100 

 Coefficient Alpha 
 0.677 

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


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

$T2$reliability

 Number of Items 
 11 

 Number of Examinees 
 100 

 Coefficient Alpha 
 0.706 

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

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