Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
PharmCat committed Jan 19, 2024
1 parent 2dde18c commit ff49c81
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 3 deletions.
9 changes: 9 additions & 0 deletions docs/src/details.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ V_{i} = Z_{i} G Z_i'+ W^{- \frac{1}{2}}_i R_{i} W^{- \frac{1}{2}}_i
where ```W``` - diagonal matrix of weights.


#### Multiple random and repeated effects

If model include multiple effects ( with n random and m repeated effects) final V will be:

```math
V_{i} = Z_{i, 1} G_{1} Z_{i, 1}' + ... + Z_{i, n} G_{1} Z_{i, n}'+ W^{- \frac{1}{2}}_i ( R_{i, 1} + ... + R_{i, m}) W^{- \frac{1}{2}}_i
```


##### Initial step

Initial (first) step before optimization may be done:
Expand Down
30 changes: 28 additions & 2 deletions docs/src/instanduse.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ Define `random` and `repreated` effects with [`Metida.VarEffect`](@ref) using [`
right side is a effect itself. [`Metida.HeterogeneousCompoundSymmetry`](@ref) and [`Metida.Diag`](@ref) (Diagonal) in example bellow is a model of variance-covariance structure. See also [`Metida.@lmmformula`](@ref) macro.

!!! note
In some cases levels of repeated effect should not be equal inside each level of subject or model will not have any sense. For example, it is assumed that usually CSH or UN (Unstructured) using with levels of repeated effect is different inside each level of subject.
Metida does not check this!

In some cases levels of repeated effect should not be equal inside each level of subject or model will not have any sense. For example, it is assumed that usually CSH or UN (Unstructured) using with levels of repeated effect is different inside each level of subject. Metida does not check this!


```@example lmmexample
Expand All @@ -73,6 +73,15 @@ random = VarEffect(@covstr(formulation|subject), CSH),
repeated = VarEffect(@covstr(formulation|subject), DIAG));
```

Also [`Metida.@lmmformula`](@ref) macro can be used:

```julia
lmm = LMM(@lmmformula(var~sequence+period+formulation,
random = formulation|subject:CSH,
repeated = formulation|subject:DIAG),
df)
```

#### Step 3: Fit

Just fit the model.
Expand All @@ -87,6 +96,23 @@ fit!(lmm)
lmm.log
```

#### Confidence intervals for coefficients


```@example lmmexample
confint(lmm)
```

!!! note

Satterthwaite approximation for the denominator degrees of freedom used by default.

#### StatsBsae API

StatsBsae API implemented: [`Metida.islinear`](@ref), [`Metida.confint`](@ref), [`Metida.coef`](@ref), [`Metida.coefnames`](@ref), [`Metida.dof_residual`](@ref), [`Metida.dof`](@ref), [`Metida.loglikelihood`](@ref), [`Metida.aic`](@ref), [`Metida.bic`](@ref), [`Metida.aicc`](@ref), [`Metida.isfitted`](@ref), [`Metida.vcov`](@ref), [`Metida.stderror`](@ref), [`Metida.modelmatrix`](@ref), [`Metida.response`](@ref), [`Metida.crossmodelmatrix`](@ref), [`Metida.coeftable`](@ref), [`Metida.responsename`](@ref)



##### Type III Tests of Fixed Effects

!!! warning
Expand Down
2 changes: 1 addition & 1 deletion src/lmm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Make Linear-Mixed Model object.
`random`: vector of random effects or single random effect
`repeated`: is a repeated effect (only one)
`repeated`: is a repeated effect or vector
`wts`: regression weights (residuals).
Expand Down

0 comments on commit ff49c81

Please sign in to comment.