Statistics.jl icon indicating copy to clipboard operation
Statistics.jl copied to clipboard

Inconsistency of matrix `cov` and `cor` in the presence of `missing`

Open adienes opened this issue 1 year ago • 0 comments

julia> using Statistics

julia> x = [missing, 1, 2]; y = [-1, -2, -3];

julia> cor([x y])
2×2 Matrix{Union{Missing, Int64}}:
 1          missing
  missing  1

julia> cor([y x])
ERROR: MethodError:

~would be fixed by https://github.com/JuliaLang/julia/pull/56673~

adienes avatar Dec 29 '24 19:12 adienes