We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3d152ca commit a53c9dbCopy full SHA for a53c9db
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