mixed_effect {structToolbox} | R Documentation

## Mixed effects model

### Description

A mixed effects model is an extension of ANOVA where there are both fixed and random effects.

### Usage

    mixed_effect(alpha = 0.05, mtc = "fdr", formula, ss_type = "marginal", ...)

### Arguments

`alpha` | (numeric) The p-value cutoff for determining significance. The default is `0.05`.
`mtc` | (character) Multiple test correction method. Allowed values are limited to the following: `"bonferroni"`: Bonferroni correction in which the p-values are multiplied by the number of comparisons. `"fdr"`: Benjamini and Hochberg False Discovery Rate correction. `"none"`: No correction. The default is `"fdr"`.
`formula` | (formula) A symbolic description of the model to be fitted.
`ss_type` | (character) Sum of squares type. Allowed values are limited to the following: `"marginal"`: Type III sum of squares. `"sequential"`: Type II sum of squares. The default is `"marginal"`.
`...` | Additional slots and values passed to `struct_class`.

### Details

This object makes use of functionality from the following packages:

- `nlme`

- `emmeans`

### Value

A `mixed_effect` object.

### References

Pinheiro J, Bates D, DebRoy S, Sarkar D, R Core Team (2020). nlme: Linear and Nonlinear Mixed Effects Models. R package version 3.1-149, https://CRAN.R-project.org/package=nlme.

Lenth R (2020). emmeans: Estimated Marginal Means, aka Least-Squares Means. R package version 1.5.2-1, https://CRAN.R-project.org/package=emmeans.

Fox J, Weisberg S (2019). An R Companion to Applied Regression, Third edition. Sage, Thousand Oaks CA. https://socialsciences.mcmaster.ca/jfox/Books/Companion/.

### Examples

    D = iris_DatasetExperiment()
    D$sample_meta$id=rownames(D) # dummy id column
    M = mixed_effect(formula = y~Species+ Error(id/Species))
    M = model_apply(M,D)

[Package structToolbox version 1.2.0 Index]