---
title: "Designing studies"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Designing studies}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(collapse = TRUE, comment = "#>")
```

This vignette outlines how to capture study designs with `mp_design()` and
assumptions with `mp_assumptions()`.

```{r}
library(mixpower)
```

```{r}
design <- mp_design(
  clusters = list(subject = 40),
  trials_per_cell = 5,
  notes = "Baseline study layout"
)

assumptions <- mp_assumptions(
  fixed_effects = list(`(Intercept)` = 0, condition = 0.3),
  residual_sd = 1,
  random_effects = list(subject = list(intercept_sd = 0.1))
)

design
assumptions
```
