Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OneWayANOVATest, LeveneTest, FlignerKilleenTest #272

Open
r-de-r opened this issue May 14, 2022 · 3 comments
Open

OneWayANOVATest, LeveneTest, FlignerKilleenTest #272

r-de-r opened this issue May 14, 2022 · 3 comments

Comments

@r-de-r
Copy link

r-de-r commented May 14, 2022

in function 'anova' line 4
Z̄ = mean(Z̄ᵢ)
is wrong.
It must be
Z̄ = sum(Z̄ᵢ .* Nᵢ) / sum(Nᵢ).

As a result, function using 'anova', ie. OneWayANOVATest, LeveneTest, FlignerKilleenTest are wrong, too.

function anova(scores::AbstractVector{<:Real}...)
    Nᵢ = [length(g) for g in scores]
    Z̄ᵢ = mean.(scores)
    # Z̄ = mean(Z̄ᵢ)= sum(Z̄ᵢ .* Nᵢ) / sum(Nᵢ)
    SStᵢ = Nᵢ .* (Z̄ᵢ .- Z̄).^2
    SSeᵢ = sum.( (z .- z̄).^2 for (z, z̄) in zip(scores, Z̄ᵢ) )
    (Nᵢ, SStᵢ, SSeᵢ)
end
@r-de-r
Copy link
Author

r-de-r commented May 15, 2022

BrownForsytheTest is wrong, too.

@wildart
Copy link
Contributor

wildart commented May 15, 2022

Duplicate #242

@nalimilan
Copy link
Member

The solution proposed by @wildart at #242 is more efficient. Anybody willing to make a PR, with a test?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants