# Poll: Do we Julians want ANOVAs?

**URL:** <https://discourse.julialang.org/t/poll-do-we-julians-want-anovas/3757>\
**Category:** Statistics\
**Created:** [May 17, 2017, 12:07am UTC](https://discourse.julialang.org/t/poll-do-we-julians-want-anovas/3757 "2017-05-17T00:07:52Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![LewisHein](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lewishein/32/5690_2.png) [@LewisHein](https://discourse.julialang.org/u/LewisHein)\
**Post date:** [May 17, 2017, 12:07am UTC](https://discourse.julialang.org/t/poll-do-we-julians-want-anovas/3757/1 "2017-05-17T00:07:52Z")

</div>

Hi everyone,

I’m a scientist on a crusade. My crusade is to bring a really good ANOVA system to julia, probably by merging [https://github.com/JuliaStats/GLM.jl/pull/70](https://github.com/JuliaStats/GLM.jl/pull/70).

I want to do this because Julia is awesome and I depend on it almost exclusively from everything from signal processing to basic stats. It works better than just about anything else. However, I believe that Julia could be made so much more awesome if we had a quick, easy, and julian ANOVA test available. What do you think?

_Poll ([view on site](https://discourse.julialang.org/t/poll-do-we-julians-want-anovas/3757/1))_

I will even go so far as to stick my neck out and say that I am willing to get my hands “dirty” coding if necessary to make this ANOVA dream a reality.

Lewis

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [May 17, 2017, 4:28am UTC](https://discourse.julialang.org/t/poll-do-we-julians-want-anovas/3757/2 "2017-05-17T04:28:07Z")

</div>

I think ANOVA is useful not only as a test, but a a [way of summarizing](http://www.stat.columbia.edu/~gelman/research/published/AOS259.pdf) the fitted model. If you did something like this, it would be very useful.

---

<div class="post-metadata">

**Author:** ![QuelqunQui](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/quelqunqui/32/1071_2.png) [@QuelqunQui](https://discourse.julialang.org/u/QuelqunQui)\
**Post date:** [May 17, 2017, 7:19am UTC](https://discourse.julialang.org/t/poll-do-we-julians-want-anovas/3757/3 "2017-05-17T07:19:01Z")

</div>

I recently had ANOVA implemented based on `Distribution` using Student and Fisher Testing to create a multiple regression. I’m still to write the Readme.md but the code can be found there if you want to use it 😉 [https://github.com/QuelqunQui/TIFFtoRegression.jl](https://github.com/QuelqunQui/TIFFtoRegression.jl)  
The ANOVA part is in the `StatRegs` function

---

<div class="post-metadata">

**Author:** ![LewisHein](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lewishein/32/5690_2.png) [@LewisHein](https://discourse.julialang.org/u/LewisHein)\
**Post date:** [May 17, 2017, 11:31am UTC](https://discourse.julialang.org/t/poll-do-we-julians-want-anovas/3757/4 "2017-05-17T11:31:25Z")

</div>

Great, keep the results coming in.

@QuelqunQui: Thanks for alerting me to your ANOVA implementation. I may well be checking it out while things work out over at at GLM.jl

---

<div class="post-metadata">

**Author:** ![QuelqunQui](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/quelqunqui/32/1071_2.png) [@QuelqunQui](https://discourse.julialang.org/u/QuelqunQui)\
**Post date:** [May 17, 2017, 4:39pm UTC](https://discourse.julialang.org/t/poll-do-we-julians-want-anovas/3757/5 "2017-05-17T16:39:39Z")

</div>

@LewisHein glad it might help you 🙂

---

<div class="post-metadata">

**Author:** ![ararslan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ararslan/32/3825_2.png) [@ararslan](https://discourse.julialang.org/u/ararslan)\
**Post date:** [May 17, 2017, 8:51pm UTC](https://discourse.julialang.org/t/poll-do-we-julians-want-anovas/3757/6 "2017-05-17T20:51:02Z")

</div>

See also [ANOVA Tests in Julia?](https://discourse.julialang.org/t/anova-tests-in-julia/1421)

---

<div class="post-metadata">

**Author:** ![dmbates](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dmbates/32/44_2.png) [@dmbates](https://discourse.julialang.org/u/dmbates)\
**Post date:** [May 17, 2017, 10:27pm UTC](https://discourse.julialang.org/t/poll-do-we-julians-want-anovas/3757/7 "2017-05-17T22:27:41Z")

</div>

I would respectfully request anyone wanting to implement ANOVA to first read Bill Venables’ (of Venables and Ripley, _Modern Applied Statistics with S_ fame) famous unpublished paper [_Exegeses on Linear Models_](https://www.stats.ox.ac.uk/pub/MASS3/Exegeses.pdf).

I am probably too hard-line about always defining anova as a comparison of the fits of two nested (in the sense that one is a special case of the other) linear models but that is because I have spent so much of my life explaining why p-values from certain anova tables don’t make sense.

---

<div class="post-metadata">

**Author:** ![LewisHein](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lewishein/32/5690_2.png) [@LewisHein](https://discourse.julialang.org/u/LewisHein)\
**Post date:** [May 17, 2017, 10:47pm UTC](https://discourse.julialang.org/t/poll-do-we-julians-want-anovas/3757/8 "2017-05-17T22:47:13Z")

</div>

@dmbates I already skimmed it, and read your comments on [https://github.com/JuliaStats/GLM.jl/pull/65](https://github.com/JuliaStats/GLM.jl/pull/65). Then I went to Wikipedia and read up on the F-test, and went back to the derivation of ANOVA to see how it is a special case of this test.

After revising my world view on ANOVAs, I’m not bringing ANOVA per se to GLM.jl. After tossing some ideas around over at github, I’ve been working on a function `ftest(mod1::LinPredModel, mod2::LinPredModel)`. I plan on putting a clear explanation in the docs for how to use this test to do an ANOVA.

The work on my PR for this is ongoing. If anyone (say, @dmbates) want to go over to [https://github.com/JuliaStats/GLM.jl/pull/182](https://github.com/JuliaStats/GLM.jl/pull/182) and discuss how many things I might, could, or should have done differently, it will only make the final end product better.

---

<div class="post-metadata">

**Author:** ![LewisHein](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lewishein/32/5690_2.png) [@LewisHein](https://discourse.julialang.org/u/LewisHein)\
**Post date:** [May 17, 2017, 10:47pm UTC](https://discourse.julialang.org/t/poll-do-we-julians-want-anovas/3757/9 "2017-05-17T22:47:57Z")

</div>

@dmbates Can you give me an example of a p-value from an ANOVA table that doesn’t make sense? I think I have an idea, but I want to check my understanding.

Thanks

---

<div class="post-metadata">

**Author:** ![ibadr](https://avatars.discourse-cdn.com/v4/letter/i/e99b99/32.png) [@ibadr](https://discourse.julialang.org/u/ibadr)\
**Post date:** [May 17, 2017, 11:17pm UTC](https://discourse.julialang.org/t/poll-do-we-julians-want-anovas/3757/10 "2017-05-17T23:17:08Z")

</div>

> [@ararslan](#):
>
> See also [ANOVA Tests in Julia?](https://discourse.julialang.org/t/anova-tests-in-julia/1421)

Thank you for mentioning this. Back at the time of that thread, I looked at the two pull requests and tried to figure out how to implement a basic ANOVA table a la R’s `anova`, with the intent of implementing `aov` next. I started off pull requests [add effects and ANOVAtest function for lm by timema · Pull Request #70 · JuliaStats/GLM.jl · GitHub](https://github.com/JuliaStats/GLM.jl/pull/70) and [Add effects and anovatable function for lm by timema · Pull Request #65 · JuliaStats/GLM.jl · GitHub](https://github.com/JuliaStats/GLM.jl/pull/65), and the result thus far is here

> **[GitHub - ibadr/ANOVA.jl: Experimental code for ANOVA in Julia](https://github.com/ibadr/ANOVA.jl)**
>
> Experimental code for ANOVA in Julia. Contribute to ibadr/ANOVA.jl development by creating an account on GitHub.

Disclaimer: it’s buggy and experimental, and still can’t handle categorical variables, but it was a good start, I guess! I was planning to keep on improving it and to add support for categorical variables, but I got swamped with other stuff to do at work. Maybe this is a good time to revisit it.

After closely inspecting the GLM.jl code at that time, I came to the conclusion that ANOVA-related code should live in its own package, with direct dependence on GLM.jl. Basically, all the heavy lifting is/will be already done inside GLM.jl, with the ANOVA package merely adding a convenient layer to fit the different GLMs and present the ANOVA results.

---

<div class="post-metadata">

**Author:** ![ibadr](https://avatars.discourse-cdn.com/v4/letter/i/e99b99/32.png) [@ibadr](https://discourse.julialang.org/u/ibadr)\
**Post date:** [May 17, 2017, 11:17pm UTC](https://discourse.julialang.org/t/poll-do-we-julians-want-anovas/3757/11 "2017-05-17T23:17:11Z")

</div>

> [@dmbates](#):
>
> I would respectfully request anyone wanting to implement ANOVA to first read Bill Venables’ (of Venables and Ripley, Modern Applied Statistics with S fame) famous unpublished paper Exegeses on Linear Models

Prof. Bates, thank you for citing this very valuable resource!

---

<div class="post-metadata">

**Author:** ![LewisHein](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lewishein/32/5690_2.png) [@LewisHein](https://discourse.julialang.org/u/LewisHein)\
**Post date:** [May 17, 2017, 11:26pm UTC](https://discourse.julialang.org/t/poll-do-we-julians-want-anovas/3757/12 "2017-05-17T23:26:26Z")

</div>

> [@ibadr](#):
>
> but I got swamped with other stuff to do at work. Maybe this is a good time to revisit it.

It’s never a bad time to revisit a languishing Julia package (said the busy guy who had five or six languishing Julia packages already)

I like the looks of your ANOVA package. Perhaps a better approach than the one I took; Mine was to go charging into GLM.jl like a bull (with a pull request) in a china shop. I don’t think I broke too much china, but it’s only day 1 on the pull request. so we’ll see.

---

<div class="post-metadata">

**Author:** ![ibadr](https://avatars.discourse-cdn.com/v4/letter/i/e99b99/32.png) [@ibadr](https://discourse.julialang.org/u/ibadr)\
**Post date:** [May 18, 2017, 6:16am UTC](https://discourse.julialang.org/t/poll-do-we-julians-want-anovas/3757/13 "2017-05-18T06:16:33Z")

</div>

> [@LewisHein](#):
>
> It’s never a bad time to revisit a languishing Julia package

Agreed! I have retouched the package. It’s now up to date with GLM v0.7.0, with proper handling of categorical variables. Check the new `iris` data example for one-way ANOVA.

> <https://github.com/ibadr/ANOVA.jl/blob/master/examples/ExampleIris.jl>

Next, I need to add support for multiple (nested) models, and for `aov`. Pull requests welcome!

---

<div class="post-metadata">

**Author:** ![alexhallam](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alexhallam/32/435_2.png) [@alexhallam](https://discourse.julialang.org/u/alexhallam)\
**Post date:** [May 20, 2017, 1:18pm UTC](https://discourse.julialang.org/t/poll-do-we-julians-want-anovas/3757/14 "2017-05-20T13:18:15Z")

</div>

To me, I have always seen ANOVA as more of an Experimental Design tool.

What would be nice to see is adding a really good Experimental Design Package. Such a package would include ANOVA and maybe support for setting up randomized blocking, latin squares, multi-factor designs etc.

---

<div class="post-metadata">

**Author:** ![epogrebnyak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/epogrebnyak/32/6287_2.png) [@epogrebnyak](https://discourse.julialang.org/u/epogrebnyak)\
**Post date:** [December 18, 2018, 4:59pm UTC](https://discourse.julialang.org/t/poll-do-we-julians-want-anovas/3757/15 "2018-12-18T16:59:43Z")

</div>

Please note there is also quite clean ANOVA implementation here: [https://github.com/marcpabst/ANOVA.jl](https://github.com/marcpabst/ANOVA.jl). There are 3 types of tables provided and tests for each type. Explanatory variables can be (in fact, should be) wrapped as effects.
