Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
PharmCat committed Jul 29, 2022
1 parent cf0cd1d commit f81eeaa
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
5 changes: 5 additions & 0 deletions docs/src/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ Metida.SpatialPower
Metida.SpatialGaussian
```

### Metida.Unstructured
```@docs
Metida.Unstructured
```

### Metida.typeiii
```@docs
Metida.typeiii
Expand Down
13 changes: 12 additions & 1 deletion docs/src/instanduse.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ nothing # hide

#### Step 2: Make model

Make model with `@formula` macro from `StatsModels`.
Define `random` and `repreated` effects with [`Metida.VarEffect`](@ref) using [`Metida.@covstr`](@ref) macros. Left side of `@covstr` is model of effect and
right side is a effect itself. [`Metida.HeterogeneousCompoundSymmetry`](@ref) and [`Metida.Diagonal`](@ref) in example bellow is a model of variance-covariance structure.

!!! 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!


```@example lmmexample
lmm = LMM(@formula(var~sequence+period+formulation), df;
random = VarEffect(@covstr(formulation|subject), CSH),
Expand All @@ -66,6 +75,8 @@ repeated = VarEffect(@covstr(formulation|subject), DIAG));

#### Step 3: Fit

Just fit the model.

```@example lmmexample
fit!(lmm)
```
Expand Down Expand Up @@ -93,7 +104,7 @@ Metida.LMM

* `model` - example: `@formula(var ~ sequence + period + formulation)`

* `random` - effects can be specified like this: `VarEffect(@covstr(formulation|subject), CSH)`. `@covstr` is a effect model: `@covstr(formulation|subject)`. `CSH` is a CovarianceType structure. Premade constants: SI, DIAG, AR, ARH, CS, CSH, ARMA. If not specified only repeated used.
* `random` - effects can be specified like this: `VarEffect(@covstr(formulation|subject), CSH)`. `@covstr` is a effect model: `@covstr(formulation|subject)`. `CSH` is a CovarianceType structure. Premade constants: SI, DIAG, AR, ARH, CS, CSH, ARMA, TOEP, TOEPH, UN. If not specified only repeated used.

* `repeated` - can be specified like random effect. If not specified `VarEffect(@covstr(1|1), SI)` used. If no repeated effects specified vector of ones used.

Expand Down

0 comments on commit f81eeaa

Please sign in to comment.