ItemAnalysis: Reliability and Validity Analysis

Description Usage Arguments Details Value Author(s) Examples

View source: R/Scale.R

Description

Performs an item analysis based on item-scale correlations, and then conducts factor analysis with one factor. Reports Cronbach alpha and single factor loadings, while it returns the original analyses from the psych package.

Usage

1
2
ItemAnalysis(prep, method="spearman", fm="gls", 
nfactors=1, rcut= 0.3, score_type="z", exclude=c())

Arguments

prep

A ScaleData object pre-processed with PreProc.

nfactors

Number of factors to be extracted in validity analysis.

rcut

Lower bound for items' correlation to scale.

score_type

Type of standard scores to calculate ("z", "t", or "sten".)

method

Method to calculate the correlation matrix. Options are: "spearman" or "polychoric".

fm

Method for factor xtraction in the validity analysis.

exclude

Items to exclude from the analysis. Indices in the original order.

Details

This function is no more than a wrap-up for psych package alpha and fa functions. Use ?psych::alpha and psych::fa for details.

Available method for correlations are "spearman" and "polychoric". Available methods for factor extraction are "minres", "wls", "gls", "pa", "ml", "minchi".

Defining number of factors is included for sake of completeness. The intended use of the function is a quick and error-proof validity measure, and not factor model fitting. Adjusting the number of factors can only serve to see if there is a better model fit with more than one factor. Scores will be calculated for the first factor only. Of course if you need to use this function as a wrapper for psych::fa, you can always extract the object with YOUROBJECT$valid$model.

Default scoring is the sum of the standardized values times the first factor loadings. T-scores translate these to have a mean of 50 and an SD of 10, and STen scores, a mean of 5.5 and an SD of 2.

Value

A list of three objects. data is the dataset, passed on for other computations, rely is the output of the reliability analysis, and valid the output of the factor analysis:

data

The dataset used.

items

The item statements. If not provided value is NULL.

rely

A list of the following elements:

..alpha

Output of the psych::alpha function.

..k

Number of items

..title

Name of analysed object.

..suggest

List of 2: low_cor Items with low correlation to the rest of the scale, and a_drop Items whose deletion may improve reliability.

valid

A list of the following elements:

..model

Output of the psych::fa function

..method

character. The factor extraction method.

..loadings

numeric. The factor loadings

..kmo

list. KMO sampling adequacy statistics.

..bartlett

list. Bartlett's test of sphericity.

..scores

numeric. Factor scores (Standardized, see Details.)

Author(s)

Nikolaos Giallousis, psierevn@gmail.com.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
data(Depression98)
depressionScale <- Scale(data=Depression98, 
                         orders=list(
                           c(16,19,11,9,1,17,5,18,4,8,2,12,
                             20,10,14,6,3,13,15,7),
                           c(1,18,4,15,7,8,3,14,20,6,19,16,
                             12,5,10,13,2,17,11,9)),
                         orders_id=c(
                           rep(1, 49),
                           rep(2, 49)),
                         reverse=c(3,4,13,14,18,20),
                         col_names= paste('q', 1:20, sep=''))
depressionScale

depressionPre <- PreProc(depressionScale)

depressionRel <- ItemAnalysis(depressionPre)
depressionRel

depressionRel <- ItemAnalysis(depressionPre, exclude=c(1, 3, 15, 13))
depressionRel

Example output

Loading required package: psych
Loading required package: Hmisc
Loading required package: lattice
Loading required package: survival
Loading required package: Formula
Loading required package: ggplot2

Attaching package: 'ggplot2'

The following objects are masked from 'package:psych':

    %+%, alpha


Attaching package: 'Hmisc'

The following object is masked from 'package:psych':

    describe

The following objects are masked from 'package:base':

    format.pval, units

Loading required package: MASS
$data
   V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 V14 V15 V16 V17 V18 V19 V20
1   2  2  1  2  2  4  2  2  2   2   2   2   4   4   4   4   2   2   4   4
2   2  2  3  3  4  2  3  2  2   4   3   4   2   4   2   3   2   4   2   2
3   5  4  3  3  1  4  2  4  4   1   3   3   4   4   3   5   1   3   5   3
4   2  4  2  2  2  3  2  4  4   2   1   3   2   1   2   4   5   4   5   3
5   3  4  1  3  4  1  2  4  4   1   1   3   4   4   4   4   2  NA   4   4
6   3  3  1  3  2  4  1  3  4   1   1   1   4   1   5   4   5   1   2   3
7   3  2  2  5  4  4  3  1  3   2   3   2   4   3   4   4   2   4   5   4
8   1  1  1  1  1  5  5  5  5   1   1   1   5   5   5   4   1   5   1   1
9   2  4  1  4  5  5  3  4  4   2   1   3   4   4   2   4   4   4   4   4
10  2  2  1  2  3  4  2  4  4   2   2   2   4   2   4   4   4   3   4   3
11  1  1  1  1  4  1  1  4  4   1   1   1   4   1   4   4   5   5   2   4
12  1  1  1  3  1  1  2  3  5   1   1   2   2   4   4   2   2   5   2   2
13  2  4  1  1  1  5  1  5  4   1   1   1   5   1   3   5   5   5   1   4
14  4  4  2  1  1  2  1  5  5   1   1   1   4   1   5   5   5   5   1   5
15  4  2  1  1  1  2  1  4  5   1   1   1   5   1   5   1   4   5   1   1
16  5  4  2  3  5  4  4  3  1   1   1   5   2   4   4   4   5   4   4   4
17  1  5  1  3  1  4  1  2  3   1   1   4   4   2   2   1   2   4   1   4
18  4  4  1  2  2  1  1  4  1   1   2   2   3   5   2   3   1   3   2   5
19  3  2  1  4  1  2  1  4  2   1   1   1   4   1   5   3   2   5   4   3
20  2  3  1  2  1  3  1  3  1   1   1   3   3   4   2   1   1   3   3   4
21  3  2  1  5  1  1  1  1  2   2   1   2   4   1   4   1   5   4   2   2
22  4  4  2  2  4  4  1  3  2   1   1   3   4   3   4   4   3   2   4   4
23  2  2  1  2  4  4  1  4  4   1   1   1   4   4   4   4   4   2   4   4
24  5  5  1  3  4  2  2  2  2   1   2   2   3   3   4   3   2   3   3   3
25  3  5  1  3  4  2  1  3  3   1   1   5   3   5   3   3   2   4   2   4
26  5  5  1  2  3  4  2  4  5   1   1   2   4   4   4   4   2   4   2   4
27  2  2  1  2  2  5  2  2  2   1   1   3   4   4   4   5   5   2   4   5
28  4  2  1  4  1  4  1  4  1   1   1   2   4   3   3   4   5   4   4   3
29  5  5  1  4  3  4  2  1  2   1   1   4   4   4   4   5   4   2   4   4
30  1  2  1  3  1  2  1  3  3   1   1   1   4   1   4   3   5   3   3   3
31  2  2  1  1  3  3  1  5  5   1   1   2   4   4   5   3   4   5   4   3
32  4  2  1  1  3  4  2  5  3   1   1   2   5   3   4   3   4   4   4   3
33  3  3  1  1  2  2  2  5  4   1   1   1   4   2   3   1   3   4   3   3
34  1  1  1  1  4  1  1  5  4   1   1   1   5   1   5   1   5   5   1   1
35  3  3  1  4  5  4  5  5  5   1   5   4   1   5   1   5   5   4   5   5
36  4  3  1  3  1  5  4  2  2   1   2   4   3   2   4   4   5   1   3   4
37  4  3  2  4  3  4  4  2  3   2   3   3   2   3   3   4   2   3   3   4
38  4  4  4  4  4  4  4  4  4   4   4   4   4   4   4   4   4   4   4   4
39  4  4  2  4  2  2  1  2  4   2   1   2   4   4   4   2   2   2   2   2
40  1  1  1  4  1  2  1  1  4   1   3   2   2   1   3   1   5   2   1   3
41  4  2  4  4  4  4  4  2  1   3  NA   4   2   4   1   5   2   2   4   4
42  1  5  1  3  3  1  2  3  5   1   1   1   4   4   4   4   5   4   2   2
43  2  2  1  2  4  4  1  4  5   1   1   1   4   1   3   2   4   4   2   2
44  2  3  1  3  3  2  2  4  4   1   1   2   4   2   4   2   2   3   2   4
45  5  5  1  4  3  4  3  2  1   1   1   1   3   1   3   2   5   5   5   3
46  4  2  1  1  2  2  3  4  3   1   1   2   4   1   4   1   5   4   1   2
47  4  5  1  4  1  2  2  2  2   1   1   2   4   4   4   4   5   4   2   4
48  3  2  2  3  2  2  2  3  3   1   1   4   3   3   3   2   4   4   3   2
49  2  2  4  2  1  5  4  2  2   2   1   1   5   2   4   4   2   3   2   3
50  1  5  2  1  4  5  2  5  5   5   2   4   3   1   4   5   5   3   5   2
51  4  1  1  4  5  5  2  4  5   1   1   4   5   4   4   1   5   5   2   2
52  1  1  1  1  3  1  1  3  4   4   1   5   5   4   4   5   2   5   1   5
53  4  3  2  3  3  4  3  2  3   3   2   2   5   4   3   2   1   3   2   2
54  4  4  1  4  4  4  1  2  4   1   1   2   4   1   4   4   5   2   2   4
55  3  3  1  3  4  4  2  4  2   1   1   2   4   4   4   4   4   4   4   2
56  1  2  1  1  2  2  1  5  5   1   5   1   4   2   4   2   5   4   2   2
57  1  3  1  4  1  1  1  3  4   1   1   1   5   3   4   3   5   5   4   4
58  1  2  1  2  5  4  5  5  4   1   1   2   4   3   4   3   5   4   4   4
59  2  2  1  1  4  2  1  5  4   1   1   1   4   2   5   2   4   4   2   2
60  3  4  1  3  4  4  1  4  2   1   1   2   4   2   4   4   4   2   4   4
61  2  1  1  2  4  3  2  3  5   1   1   2   2   2   3   3   5   3   1   3
62  5  5  2  2  3  3  5  4  5   1   1   5   5   1   4   2   1   1   4   1
63  1  2  3  4  5  4  4  2  3   1   4   5   2   1   3   1   4   3   1   4
64  4  4  3  3  1  3  3  3  3   1   2   2   2   1   2   2   2   5   4   2
65  4  4  2  3  2  2  2  3  3   2   2   3   2   4   3   4   4   4   3   3
66  2  3  1  2  2  4  1  4  4   1   1   2   4   2   3   4   5   5   2   3
67  4  2  1  1  3  2  2  4  5   1   1   1   4   3   5   4   4   3   4   4
68  2  5  1  4  4  1  1  2  4   1   1   4   5   1   3   1   4   4   2   1
69  2  4  1  2  5  1  2  3  3   1   1   2   4   1   4   3   3   4   4   2
70  2  4  1  2  3  2  1  4  2   1   1   1   5   1   4   2   5   2   4   2
71  4  4  1  2  2  1  1  3  3   1   1   2   4   1   3   2   2   4   1   1
72  2  2  1  2  3  1  1  5  5   1   1   1   4   2   5   1   4   4   1   2
73  5  5  2  3  5  4  1  4  4   5   2   4   4   4   4   4   5   4   5   4
74  4  5  1  3  2  4  1  3  3   1   1   2   4   1   3   2   5   2   1   4
75  3  1  1  2  5  4  1  5  4   1   1   4   4   1   5   3   4   4   3   3
76  2  2  1  3  3  2  1  4  4   1   1   2   4   1   4   2   5   4   4   2
77  2  2  1  2  4  4  1  2  3   1   1   2   4   2   4   4   5   4   3   4
78  2  2  1  2  3  3  2  4  4   1   1   2   4   2   3   3   5   4   3   3
79  1  1  1  1  3  2  1  5  4   1   1   1   4   1   4   2   4   4   4   2
80  3  4  1  4  4  2  1  3  3   1   1   2   4   4   3   4   4   3   4   2
81  5  4  1  2  2  2  1  3  2   1   1   1   4   2   3   2   5   4   4   2
82  2  2  1  2  3  2  2  3  4   1   1   2   4   2   3   2   5   4   4   2
83  2  1  1  3  4  2  1  3  4   1   1   1   3   1   2   4   5   4   2   2
84  3  3  2  2  3  2  2  3  3   1   1   2   4   3   4   2   3   3   4   2
85  3  2  2  3  3  3  1  2  3   1   1   2   4   3   3   4   3   3   3   4
86  2  3  1  2  4  3  3  4  4   2   3   2   3   1   4   3   4   4   4   2
87  4  2  2  2  2  2  2  2  4   2   2   2   4   2   4   2   4   4   2   2
88  2  2  1  4  3  2  2  1  5   1   1   2   4   5   2   4   2   4   2   4
89  1  1  1  2  3  1  1  5  3   1   1   1   5   1   5   1   5   4   3   1
90  2  3  2  2  2  2  2  4  2   1   2   2   4   2   4   2   4   4   2   2
91  1  2  1  3  2  2  1  1  4   1   1   2   4   2   4   4   5   4   2   2
92  4  2  1  3  2  2  2  4  3   1   1   2   4   2   4   2   2   4   2   2
93  1  1  1  1  1  1  1  5  5   1   1   1   5   1   5   1   5   5   3   1
94  2  2  1  1  1  3  1  4  5   2   1   1   5   2   4   3   4   4   4   2
95  3  2  1  2  3  2  1  4  4   1   1   2   4   2   4   4   2   4   4   2
96  4  2  2  2  4  3  2  3  2   2   2   2   4   3   3   3   4   5   3   3
97  2  2  1  3  2  2  2  4  3   1   1   3   4   2   4   2   4   5   3   2
98  4  3  1  2  2  2  2  4  2   1   1   2   4   4   4   2   3   4   4   2

$orders
$orders[[1]]
 [1] 16 19 11  9  1 17  5 18  4  8  2 12 20 10 14  6  3 13 15  7

$orders[[2]]
 [1]  1 18  4 15  7  8  3 14 20  6 19 16 12  5 10 13  2 17 11  9


$orders_id
 [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
[39] 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
[77] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2

$reverse
[1]  3  4 13 14 18 20

$items
character(0)

$col_names
 [1] "q1"  "q2"  "q3"  "q4"  "q5"  "q6"  "q7"  "q8"  "q9"  "q10" "q11" "q12"
[13] "q13" "q14" "q15" "q16" "q17" "q18" "q19" "q20"

attr(,"class")
[1] "ScaleData"
Warning message:
In PreProc(depressionScale) :
  Items' vector unspecified. out$items is NULL...

Reliability Analysis of depressionPre ScaleData object. 

A spearman correlation matrix of 20 items was calculated and submitted to Reliability analysis.
      
The overall Cronbach's Alpha was 0.83 .
Item(s) that exhibited low correlation with the rest of the scale were:
 1 and 3 .
Furthermore, deleting item(s) 1 and 3 may improve reliability.A gls factor analysis was conducted. Items were regressed to
      a single factor. Their loadings are the following:
       q1        q3       q15        q4       q13       q19        q8        q6 
0.2265837 0.2900250 0.3400521 0.4109353 0.4173177 0.4259260 0.4320918 0.4347683 
      q16       q17       q14       q10        q7       q18        q2       q20 
0.4515751 0.4582502 0.4727368 0.4729194 0.4816417 0.4997000 0.4998320 0.5111198 
       q5        q9       q11       q12 
0.5168634 0.5349238 0.5471951 0.6541123 

Reliability Analysis of depressionPre ScaleData object. 

A spearman correlation matrix of 16 items was calculated and submitted to Reliability analysis.
      
The overall Cronbach's Alpha was 0.82 .
A gls factor analysis was conducted. Items were regressed to
      a single factor. Their loadings are the following:
       q4       q19        q6        q8       q17       q16       q10        q7 
0.3996803 0.4115013 0.4171090 0.4350791 0.4368332 0.4404291 0.4488153 0.4824395 
      q14       q18        q2        q5       q20        q9       q11       q12 
0.4997687 0.5103412 0.5116982 0.5121831 0.5279374 0.5492480 0.5515895 0.6456384 

Scale documentation built on May 2, 2019, 1:27 p.m.

Related to ItemAnalysis in Scale...