scoreTest: Scoring Multiple Tests, Scales, or Composites

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

Description

A function for scoring tests, measures, or questionnaires

Usage

1
2
scoreTest(items, keys, Zitems = FALSE, maxScore = NULL, minScore = NULL, 
	rel = FALSE, nomiss = .8, tr = 0, item.names = NULL, check.keys=TRUE)

Arguments

items

A data.frame containing the items or questions on the test or measure.

keys

A list containing the scoring keys for each scale or construct to be scored from the test or measure. Each object in the list consists of a single numeric vector indicating the column position of 'items' belonging to that scale. Placing a negative sign in front of the column number indicates that this item should be reverse scored.

Zitems

A logical indicating whether the items should be standardized (Z-scored) prior to the computation of scale scores.

maxScore

A numeric element indicating the maximum possible score on the scales used to rate the items. Useful when (a) there are items that need to be reverse scored and (b) the maximum score on a rating scale is never used. In all other cases this is not needed.

minScore

A numeric element indicating the minimum possible score on the scales used to rate the items. Useful when (a) there are items that need to be reverse scored and (b) the minimum score on a rating scale is never used. In all other cases this is not needed.

rel

A logical indicating whether reliability statistics should be computed for each scale.

nomiss

A numeric between 0 and 1 indicating the proportion of the data that must be present to compute a scale score for a particular observation. Any subject with fewer than this proportion of valid data points will recieve NA.

tr

A numeric between 0 and 1 indicating the amount of trimming to be done when computing a scale score.

item.names

A character vector indicating the names for the items. If left NULL, the names provided in keys will be used.

check.keys

A logical indicating whether, when calculating reliabilities, the function should check for items negatively correlated with the scale and automatically reverse them for the alpha calculation. Generally, with this function items should already be scored in the proper direction. Thus, this serves as a warning that items may be miskeyed.

Details

This function computes mean scores for each of the scales provided in the keys list. If rel=TRUE, it also computes the reliabilites for the composite scores based on the keys list.

Value

If rel=FALSE, then a matrix containing the composite or scale scores is returned. If rel=TRUE, a list containing...

rel

The reliability statistics for each composite or scale

scores

The composite or scale scores.

Author(s)

Ryne A. Sherman

See Also

plotProfile meanif scoreItems

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(bfi)
keys.list <- list("agree"=c(-1,2,3,4,5),
  "conscientious"=c(6,7,8,-9,-10),"extraversion"=c(-11,-12,13,14,15),
  "neuroticism"=c(16,17,18,19,20),"openness"=c(21,-22,23,24,-25))
out <- scoreTest(bfi, keys.list, nomiss=0, maxScore=6, minScore=1)
outZ <- scoreTest(bfi, keys.list, Zitems=TRUE, nomiss=0)
describe(out) # Descriptives of Scale Scores
describe(outZ)
outR <- scoreTest(bfi, keys.list, nomiss=0, rel=TRUE, maxScore=6)
outR$rel # Scale reliabilities

Example output

Loading required package: psych
Loading required package: abind
Loading required package: foreach
              vars    n mean   sd median trimmed  mad min max range  skew
agree            1 2800 4.65 0.90    4.8    4.73 0.89 1.0   6   5.0 -0.76
conscientious    2 2800 4.27 0.95    4.4    4.30 0.89 1.0   6   5.0 -0.40
extraversion     3 2800 4.15 1.06    4.2    4.20 1.19 1.0   6   5.0 -0.48
neuroticism      4 2800 3.16 1.20    3.0    3.13 1.48 1.0   6   5.0  0.21
openness         5 2800 4.59 0.81    4.6    4.62 0.89 1.2   6   4.8 -0.34
              kurtosis   se
agree             0.40 0.02
conscientious    -0.19 0.02
extraversion     -0.21 0.02
neuroticism      -0.67 0.02
openness         -0.29 0.02
              vars    n mean   sd median trimmed  mad   min  max range  skew
agree            1 2800    0 0.68   0.10    0.06 0.67 -2.78 1.08  3.86 -0.77
conscientious    2 2800    0 0.69   0.06    0.03 0.72 -2.42 1.27  3.69 -0.43
extraversion     3 2800    0 0.72   0.06    0.04 0.75 -2.15 1.28  3.43 -0.49
neuroticism      4 2800    0 0.76  -0.09   -0.02 0.90 -1.41 1.80  3.21  0.21
openness         5 2800    0 0.62   0.03    0.02 0.66 -2.66 1.14  3.80 -0.36
              kurtosis   se
agree             0.43 0.01
conscientious    -0.13 0.01
extraversion     -0.17 0.01
neuroticism      -0.67 0.01
openness         -0.24 0.01
              raw_alpha std.alpha   G6(smc) average_r      S/N         ase
agree         0.7030184 0.7130286 0.6827627 0.3319677 2.484668 0.008951774
conscientious 0.7267350 0.7300726 0.6942276 0.3510454 2.704700 0.008116697
extraversion  0.7617328 0.7617951 0.7265955 0.3901001 3.198066 0.007027046
neuroticism   0.8139629 0.8146747 0.7991260 0.4678539 4.395917 0.005607097
openness      0.6001725 0.6072684 0.5681398 0.2362061 1.546268 0.011858651
                  mean        sd        NA
agree         4.652095 0.8984019 0.3376233
conscientious 4.265732 0.9513469 0.3400043
extraversion  4.145083 1.0609041 0.3817637
neuroticism   3.162268 1.1963314 0.4136794
openness      4.586649 0.8083739 0.2261315

multicon documentation built on May 2, 2019, 3:18 a.m.