diff --git a/src/reliability.jl b/src/reliability.jl index aebb94b29..e9abb58b3 100644 --- a/src/reliability.jl +++ b/src/reliability.jl @@ -51,7 +51,11 @@ item 4: 0.7826 ``` """ function cronbachalpha(covmatrix::AbstractMatrix{<:Real}) - isposdef(covmatrix) || throw(ArgumentError("Covariance matrix must be positive definite.")) + if !isposdef(covmatrix) + throw(ArgumentError("Covariance matrix must be positive definite. " * + "Maybe you passed the data matrix instead of its covariance matrix? " * + "If so, call `cronbachalpha(cov(...))` instead.")) + end k = size(covmatrix, 2) k > 1 || throw(ArgumentError("Covariance matrix must have more than one column.")) v = vec(sum(covmatrix, dims=1))