AnovaGLM.jl
AnovaBase.anova
— Methodanova(<glmmodels>...; test::Type{<: GoodnessOfFit}, <keyword arguments>)
anova(<anovamodel>; test::Type{<: GoodnessOfFit}, <keyword arguments>)
anova(test::Type{<: GoodnessOfFit}, <glmmodels>...; <keyword arguments>)
anova(test::Type{<: GoodnessOfFit}, <anovamodel>; <keyword arguments>)
Analysis of variance.
Return AnovaResult{M, test, N}
. See AnovaResult
for details.
Arguments
glmmodels
: model objectsTableRegressionModel{<: LinearModel}
fitted byGLM.lm
TableRegressionModel{<: GeneralizedLinearModel}
fitted byGLM.glm
anovamodel
: wrapped model objects;FullModel
andNestedModels
.test
: test statistics for goodness of fit. Available tests areLikelihoodRatioTest
(LRT
) andFTest
. The default is based on the model type.TableRegressionModel{<: LinearModel}
:FTest
.TableRegressionModel{<: GeneralizedLinearModel}
: based on distribution function, seecanonicalgoodnessoffit
.
Other keyword arguments
- When one model is provided:
type
specifies type of anova (1, 2 or 3). Default value is 1.
- When multiple models are provided:
check
: allows to check if models are nested. Defalut value is true. Some checkers are not implemented now.
AnovaGLM.anova_lm
— Functionanova_lm(X, y; test::Type{<: GoodnessOfFit} = FTest, <keyword arguments>)
anova_lm(test::Type{<: GoodnessOfFit}, X, y; <keyword arguments>)
anova(test::Type{<: GoodnessOfFit}, ::Type{LinearModel}, X, y;
type::Int = 1,
<keyword arguments>)
ANOVA for simple linear regression.
Arguments
X
andy
can be aMatrix
and aVector
or aFormula
and aTables.jl
compatible data.test
: test statistics for goodness of fit.
Keyword arguments
test
: test statistics for goodness of fit.type
specifies type of anova (1, 2 or 3). Default value is 1.dropcollinear
controls whether or notlm
accepts a model matrix which is less-than-full rank. If true (the default), only the first of each set of linearly-dependent columns is used. The coefficient for redundant linearly dependent columns is 0.0 and all associated statistics are set to NaN.
anova_lm
generate a TableRegressionModel
object, which is fitted by lm
.
AnovaGLM.anova_glm
— Functionanova_glm(X, y, d::UnivariateDistribution, l::Link = canonicallink(d);
test::Type{<: GoodnessOfFit} = canonicalgoodnessoffit(d), <keyword arguments>)
anova_glm(test::Type{<: GoodnessOfFit}, X, y, d::UnivariateDistribution, l::Link = canonicallink(d); <keyword arguments>)
anova(test::Type{<: GoodnessOfFit}, X, y, d::UnivariateDistribution, l::Link = canonicallink(d); <keyword arguments>)
ANOVA for genaralized linear models.
Arguments
X
andy
can be aMatrix
and aVector
or aFormula
and aTables.jl
compatible data.d
: aGLM.UnivariateDistribution
.l
: aGLM.Link
test
: test statistics for goodness of fit based on distribution function. Seecanonicalgoodnessoffit
.
For other keyword arguments, see fit
.
AnovaBase.nestedmodels
— Methodnestedmodels(trm::TableRegressionModel{<: LinearModel}; null::Bool = true, <keyword arguments>)
nestedmodels(trm::TableRegressionModel{<: GeneralizedLinearModel}; null::Bool = true, <keyword arguments>)
nestedmodels(::Type{LinearModel}, formula, data; null::Bool = true, <keyword arguments>)
nestedmodels(::Type{GeneralizedLinearModel}, formula, data, distr::UnivariateDistribution, link::Link = canonicallink(d); null::Bool = true, <keyword arguments>)
Generate nested nested models NestedModels
from a model or formula and data.
The null model will be a model with at least one factor (including intercept) if the link function does not allow factors to be 0 (factors in denominators) or the keyword argument null
is false (default value is true).
InverseLink
forGamma
InverseSquareLink
forInverseGaussian
LinearModel
fitted withCholeskyPivoted
whendropcollinear = true
Otherwise, it will be an empty model.