marcpabst / ANOVA.jl

Provides a Simple Way to Calculate ANOVAs From Fitted Linear Models.
Other
21 stars 9 forks source link

Avoid using internals and rely on API #9

Open Nosferican opened 5 years ago

Nosferican commented 5 years ago

I encourage the implementation to be based solely on the StatsBase.StatisticalModel / StatsBase.RegressionModel API such that it works with any regression model rather than limiting it to only the GLM struct. As for the GLM, I believe it wasn't robust to allowrankdeficient which could benefit from the generalization and checks. If you need methods beyond the current API, do reach out and we can expand the API to accommodate it.

epogrebnyak commented 5 years ago

GLM was probably used as easiest way to get linear regression working. What would be a way to through
StatsBase.StatisticalModel / StatsBase.RegressionModel API? Is there something beyond type definitions at src/statmodels.jl that should be taken to consideration? A link to any other example implementation would be great.

Nosferican commented 5 years ago

It should probably just be replacing the use of internals for accessors. For example, Any time you have mod.pp.X you would call modelmatrix(mod) or for mod.rr.y, response(y). if you need weighs, weights(model), etc. I think that should be the core of it. If it helps to have additional methods (e.g., hasintercept) we can add those the the API.

marcpabst commented 5 years ago

This is something we definitely should take in into consideration when expanding anova() beyond simple linear models.