adw96 / breakaway

Species richness with high diversity
68 stars 18 forks source link

Feature Request: ANOVA #120

Open twowinkel opened 3 years ago

twowinkel commented 3 years ago

Would it be possible to have an ANOVA-like table, to see the overall significance of a main effect or interaction? Thank you so much!

## pairwise comparisons
bb = breakaway::betta( chats = data$shannon
                       , ses = data$sd
                       ,  X  = model.matrix( ~  x * ( y + z ) , data = data ) )

# anova version?
aa = aov( shannon ~ x * ( y + z )
          , data = data
          , weights = 1/sd )
summary( aa )
adw96 commented 3 years ago

Thanks for reaching @twowinkel ! Your proposal is close, but not quite an ANOVA using the betta() model. We can definitely implement a ANOVA method, though! Thanks for the request; I'll chat about it with the development team.

ailurophilia commented 3 years ago

Update: this is in the works – stay tuned :)

adw96 commented 2 years ago

Notes to self: @ailurophilia plans to write up notes/bullet points on analysis of deviance

adw96 commented 2 years ago

@svteichman -- If I recall correctly, @ailurophilia made a fantastic F-test function which I believe addresses this issue. Is this function documented and tested? If so, would you mind alerting @twowinkel to it?

If we don't yet have a vignette for it, could I please task you with making one? (Not urgent -- perhaps by the end of January given all the other exciting projects that you have going on?)

svteichman commented 1 year ago

@adw96 Yes! David made an F-test function, but the F_test function is actually a helper function for the test_submodel function, which the user can interact with.

@twowinkel You should be able to use test_submodel to provide a fitted betta object (either the output of betta() or betta_random() and the submodel that you would like to test (this is where you can specify the main effect of interaction that you want to test by removing it from the full model that you used to make the betta object). You can see an example of using test_submodel in the very end of the diversity-hypothesis-testing vignette. Let me know if you have any questions!