We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b0ca0b0 commit 4baf521Copy full SHA for 4baf521
src/reliability.jl
@@ -51,7 +51,11 @@ item 4: 0.7826
51
```
52
"""
53
function cronbachalpha(covmatrix::AbstractMatrix{<:Real})
54
- isposdef(covmatrix) || throw(ArgumentError("Covariance matrix must be positive definite."))
+ if !isposdef(covmatrix)
55
+ throw(ArgumentError("Covariance matrix must be positive definite. " *
56
+ "Maybe you passed the data matrix instead of its covariance matrix? " *
57
+ "If so, call `cronbachalpha(cov(...))` instead."))
58
+ end
59
k = size(covmatrix, 2)
60
k > 1 || throw(ArgumentError("Covariance matrix must have more than one column."))
61
v = vec(sum(covmatrix, dims=1))
0 commit comments