Cronbach's Alpha
In a survey questionnaire, a set of items referred to the same construct or concept is included. Therefore, it is expected that responses for those items are similar or highly correlated. To measure that, the Cronbach’s Alpha is frequently used. It estimates the reliability or the internal consistency for a set of survey items.
A set of related survey items can be like these ones:
- My claim was attended in a reasonable amount of time.
- I am satisfied with the timeliness of the service.
- The time I waited for services was acceptable.
- I am satisfied with the services I received.
The Cronbach’s Alpha is expressed as a point generally in the interval between 0 and 1. It is asumed that greater values represent a higher internal consistency. As a rule of thumb, obtaining a value higher than 0.7 is an acceptable result. The formula to calculate the Cronbach’s Alpha is shown below.
$$\alpha = \frac{n}{n - 1} (1 - \frac{\sum_{i=1}^n \sigma_i^2}{\sigma_T^2})$$
Where:
$n$: the number of items
\(\sigma_i^2\): variance in responses for an individual item
\(\sigma_T^2\): variance of total scores for all the items
The reasoning behind the Cronbach's Alpha is that responses for each item should have a lower fluctuation, \(\sigma_i^2\). Instead, the total variance among items \(\sigma_T^2\) should be higher. Therefore, the quotient of the aggregated variance for individual items over the variance of total scores for all the items is expected to be a small number. To obtain the estimation, that number is subtracted from 1 and adjusted by \(\frac{n}{n - 1}\). This final adjustment is to prevent an underestimation when there are few items.
Implementation
A Python's quick implementation can be the next one:
import numpy as np
# Rows are respondents
# Columns are survey items
data = np.array([
[4.0, 4.0, 4.0, 5.0],
[3.0, 4.0, 3.0, 4.0],
[5.0, 4.0, 5.0, 5.0],
[2.0, 3.0, 2.0, 3.0],
[4.0, 4.0, 4.0, 4.0],
])
# ddof means degrees of freedom
var_items = np.var(data, axis=0, ddof=1)
total_scores = np.sum(data, axis=1)
var_total = np.var(total_scores, ddof=1)
n = data.shape[0]
correction_factor = n / (n - 1)
alpha = correction_factor * (1 - np.sum(var_items) / var_total)
print(f"Cronbach's Alpha: {alpha:0.4f}")
As an alternative, below, a Rust function is shown as an implementation to calculate the Cronbach's Alpha. It receives as input a matrix where rows are respondents and columns are survey items.
fn cronbach_alpha(data: &Vec<Vec<f64>>) -> f64 {
let n = data.len() as f64;
let d = data[0].len();
// item variances
let mut var_items = Vec::new();
for j in 0..d as usize {
let col: Vec<f64> = data.iter()
.map(|row| row[j]).collect();
var_items.push(variance(&col));
}
// total score variances
let total_scores: Vec<f64> = data.iter()
.map(|row| row.iter().sum()).collect();
let var_total = variance(&total_scores);
// cronbach's alpha
let sum_var_items: f64 = var_items.iter().sum();
let correction_factor = n / (n - 1.0);
correction_factor *
(1.0 - (sum_var_items / var_total))
}
To compute the variance in the previous code, given that \(\sigma^2 = \frac{\sum(x_i - \bar{x})^2}{n - 1}\), one more function can be included:
fn variance(data: &Vec<f64>) -> f64 {
let n = data.len() as f64;
let mean = data.iter().sum::<f64>() / n;
let sqr_diff: f64 = data.iter()
.map(|x| (x - mean).powi(2)).sum();
sqr_diff / (n - 1.0)
}
To use these functions, here it is an example:
fn main() {
// rows are respondents
// columns are responses to the survey items
let responses = vec![
vec![4.0, 4.0, 4.0, 5.0],
vec![3.0, 4.0, 3.0, 4.0],
vec![5.0, 4.0, 5.0, 5.0],
vec![2.0, 3.0, 2.0, 3.0],
vec![4.0, 4.0, 4.0, 4.0],
];
let alpha = cronbach_alpha(&responses);
println!("Cronbach's Alpha: {:.4}", alpha);
}
Once that program is compiled and run, the output is like the below one. For this example, a value of 0.8761 indicates that a high internal consistency exists among the included survey items.
$ rustc cronbachalpha.rs
$ ./cronbachalpha
Cronbach's Alpha: 0.8761
Considerations
On using Cronbatch's Alpha estimations, researchers should attend some considerations, like:
- It is assumed that the set of items is measuring only one dimension. Other estimations, like Factor Analysis, can be used to identify the dimensions of a test.
- An alpha is a property of a set of survey items for a sample of respondents. The alpha should be measured every time the test is administered (Streiner, 2003).
- Alpha increases with the number of items and redundant questions. Therefore, a higher alpha can be the result not only because of the internal consistency, but because of the number of items or the redundancy among them.
Recommended articles
- Sijtsma, K. (2009). On the Use, the Misuse, and the Very Limited Usefulness of Cronbach’s Alpha. Psychometrika, 74(1), 107–120. doi:10.1007/s11336-008-9101-0
- Streiner, D. L. (2003). Starting at the beginning: an introduction to coefficient alpha and internal consistency. Journal of personality assessment, 80(1), 99-103.
- Tavakol, M., & Dennick, R. (2011). Making sense of Cronbach's alpha. International journal of medical education, 2, 53–55. https://doi.org/10.5116/ijme.4dfb.8dfd

