Skip to main content

stats.cronbach_alpha

stats.cronbach_alpha(X, rep_axis=0, var_axis=1, ci=None, squeeze=True)

Cronbach’s alpha.

Parameters

Name Type Description Default
X ndarray The data. required
rep_axis int The axis along which the repetitions are stacked, e.g., items, parallel tests, repeated measures of brain response patterns. 0
var_axis int The axis along which individuals differ, e.g., test-takers, voxels, vertices. 1
ci float or tuple of float or None Confidence level. If float, it should be between 0 and 1, e.g., 0.95 for 95% confidence interval. If tuple, it should be a pair of floats between 0 and 1, e.g., (0.025, 0.975) for 95% confidence interval. If None, no confidence interval is computed or returned. None
squeeze bool Whether to squeeze the returned ndarray for rep_axis and var_axis. If False, the returned ndarray has the same number of dimensions as X. True

Returns

Name Type Description
alpha float or ndarray Cronbach’s alpha. If X is 2D, a float is returned. Otherwise, an ndarray is returned.
ci ndarray Confidence interval. Returned only if ci is not None.