betafunctions (version 1.9.0)

cba: Calculate Cronbach's Alpha reliability-coefficient from supplied variables.

Description

Calculates Cronbach's Alpha reliability coefficient of the sum-score.

Usage

cba(x)

Value

Cronbach's Alpha for the sum-score of supplied variables.

Arguments

x

A data-frame or matrix of numerical values where rows represent respondents, and columns represent items.

References

Cronbach, L.J. (1951). Coefficient alpha and the internal structure of tests. Psychometrika 16, 297--334. doi: 10.1007/BF02310555

Examples

Run this code
# Generate some fictional data. Say 100 students take a 50-item long test
# where all items are equally difficult.
set.seed(1234)
p.success <- rBeta.4P(100, 0.25, 0.75, 5, 3)
for (i in 1:50) {
  if (i == 1) {
    rawdata <- matrix(nrow = 100, ncol = 50)
  }
  rawdata[, i] <- rbinom(100, 1, p.success)
}
# To calculate Cronbach's Alpha for this test:
cba(rawdata)

Run the code above in your browser using DataLab