-
Notifications
You must be signed in to change notification settings - Fork 87
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
Tests for Equality of Variances #204
Conversation
57eb538
to
b8c9a14
Compare
Ready for review. |
It looks like Levene's test is just a form of one-way ANOVA with F-distributed test statistic. Is this somehow already covered elsewhere? |
Indeed, it is a variant of ANOVA. Question is why there is no simple 1-way extendable ANOVA in this package that would allow to perform above tests? I've seen this discourse thread ANOVA Tests in Julia?. I could try to spin this PR in a proper ANOVA interface. |
This looks like the right approach to me. Should the Levene, Brown-Forsythe, Fligner-Killeen return an ANOVA object or have their own objects inheriting from that? |
I do not think it is necessary to create separate types for each test. I designed |
Do these tests have any relation with the equality of variance tests we already support? |
docs/src/parametric.md
Outdated
``` | ||
|
||
Example: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't show examples for other tests AFAIK. Can't you put it in the docstring instead?
src/var_equality.jl
Outdated
length(t.description[3]) != 0 ? t.description[3] : (TD <: FDist ? "F" : "χ²") | ||
|
||
StatsBase.nobs(t::VarianceEqualityTest) = t.Nᵢ | ||
StatsBase.dof(t::VarianceEqualityTest{Chisq}) where T = t.DFt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
T
doesn't exist. Is this method actually covered by tests?
src/var_equality.jl
Outdated
StatsBase.dof(t::VarianceEqualityTest{FDist}) where T = (t.DFt, t.DFe) | ||
|
||
teststatistic(t::VarianceEqualityTest{FDist}) = (t.DFe/t.DFt)*sum(t.SStᵢ)/sum(t.SSeᵢ) | ||
teststatistic(t::VarianceEqualityTest{Chisq}) = let y=sum(t.SStᵢ)/sum(t.SSeᵢ); y*(t.DFe+t.DFt)/(1 + y) end # sum(t.SStᵢ)/t.s² |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the long function form?
@mschauer, are there any updates on this? This is an ideal solution for a use-case that I'm currently running and I was wondering if there's a timeline on merging it. Thanks! |
I'll try to find some time next week to finish it. |
f4b0a7d
to
7fd83a3
Compare
They are related, https://en.wikipedia.org/wiki/F-test_of_equality_of_variances#Properties, but computationally more to the ANOVA. |
OK (the point of my question was to know whether they should use a common type). Can you wrap all lines at 92 chars? Otherwise, looks good to me. |
Implemented tests for equality of variances: