You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/Algorithm_AnovaFixedEffectModels.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,7 @@ The mean residual deviance $\sigma^2$
46
46
```math
47
47
\sigma^2 =\frac{D_n}{df_r}
48
48
```
49
-
where $D_n$ is the residual sum of squares of $M_n$; $df_r$ is the degrees of freedom of the residuals, i.e. $df_r = s - n(\mathcal{C})$, where $s$ is number of samples.
49
+
where $D_n$ is the residual sum of squares of $M_n$; $df_r$ is the degrees of freedom of the residuals, i.e. $df_r = nob - n(\mathcal{C})$, where $nob$ is number of observations.
Copy file name to clipboardExpand all lines: docs/src/Algorithm_AnovaGLM.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,7 @@ For ordinary linear regression,
53
53
```math
54
54
\sigma^2 =\frac{D_n}{df_r}
55
55
```
56
-
where $D_n$ is the residual sum of squares of $M_n$; $df_r$ is the degrees of freedom of the residuals, i.e. $df_r = s - n(\mathcal{C})$, where $s$ is number of samples.
56
+
where $D_n$ is the residual sum of squares of $M_n$; $df_r$ is the degrees of freedom of the residuals, i.e. $df_r = nob - n(\mathcal{C})$, where $nob$ is number of observations.
This function returns a tuple of terms which can be used in ANOVA (some terms may not be used because of ANOVA type or model itself).
25
25
26
-
There is a default method for `RegressionModel`, i.e., `formula(model).rhs.terms`. If the formula for `SomeModel` has special structure like `MixedModel`, this function should be overloaded.
26
+
There is a default method for `RegressionModel`, i.e., `formula_aov(model).rhs.terms`. If the formula for `SomeModel` has special structure like `MixedModel`, this function or [`formula_aov`](./AnovaBase.md#AnovaBase.formula_aov-Tuple{RegressionModel}) should be overloaded.
@@ -62,4 +62,7 @@ This function is not essential for ANOVA; it is just for convenience to create n
62
62
`AnovaBase` provides a lot of functions to work on formula, terms and contrasts. See [Developer utility](./AnovaBase.md#Developer-utility)
63
63
64
64
## Other function
65
-
*[`dof_residual`](./AnovaBase.md#StatsAPI.dof_residual-Tuple{AnovaResult}) applies `dof_residual` to all models by default. If `dof_residual(::SomeModel)` is not valid for ANOVA, customize `dof_residual(::AnovaResult{<: AnovaModel{SomeModel}})` alternatively.
65
+
*[`dof_aovres`](./AnovaBase.md#AnovaBase.dof_aovres-Tuple{RegressionModel}) calls `dof_residual` by default. If `dof_residual(::SomeModel)` is not valid for ANOVA, customize `dof_aovres(::SomeModel)`. This function is utilized in the following function [`dof_residual`].
66
+
*[`dof_residual`](./AnovaBase.md#StatsAPI.dof_residual-Tuple{AnovaResult}) applies [`dof_aovres`](./AnovaBase.md#AnovaBase.dof_aovres-Tuple{RegressionModel}) to all models by default. This function is utilized in the [`anovatable`](./AnovaBase.md#AnovaBase.anovatable-Tuple{AnovaResult{<:FullModel}}).
67
+
*[`dof_aov`](./AnovaBase.md#AnovaBase.dof_aov-Tuple{RegressionModel}) calls `dof` by default. If `dof(::SomeModel)` is not valid for ANOVA, customize `dof_aov(::SomeModel)`. Currently, no other function depends on this function.
68
+
*[`formula_aov`](./AnovaBase.md#AnovaBase.formula_aov-Tuple{RegressionModel}) calls `formula` by default. If `formula(::SomeModel)` is not valid for ANOVA, customize `formula_aov(::SomeModel)`. Several functions including [`predictors`](./AnovaBase.md#AnovaBase.predictors-Tuple{RegressionModel}), and `show` function for ANOVA depend on this function.
Copy file name to clipboardExpand all lines: src/fit.jl
+2-4Lines changed: 2 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -50,9 +50,9 @@ end
50
50
51
51
# Calculate dof from assign
52
52
"""
53
-
dof_asgn(v::Vector{Int})
53
+
dof_asgn(assign::Vector{Int})
54
54
55
-
Calculate degrees of freedom of each predictors. 'assign' can be obtained by `StatsModels.asgn(f::FormulaTerm)`. For a given `trm::RegressionModel`, it is as same as `trm.mm.assign`.
55
+
Calculate degrees of freedom of each predictors. `assign` can be obtained by `StatsModels.asgn(f::FormulaTerm)`. For a given `trm::RegressionModel`, it is as same as `trm.mm.assign`.
56
56
57
57
The index of the output matches values in the orinal `assign`. If any index value is not in `assign`, the default is 0.
58
58
@@ -80,8 +80,6 @@ function dof_asgn(v::Vector{Int})
0 commit comments