# cra4: Four-Level Cluster-randomized Trial In PowerUpR: Power Analysis Tools for Multilevel Randomized Experiments

## Description

For main treatment effects, use `mdes.cra4()` calculate the minimum detectable effect size, `power.cra4()` to calculate the statistical power, and `mrss.cra4()` to calculate the minimum required sample size.

## Usage

 ``` 1 2 3 4 5 6 7 8 9 10 11 12``` ```mdes.cra4(power=.80, alpha=.05, two.tailed=TRUE, rho2, rho3, rho4, p=.50, r21=0, r22=0, r23=0, r24=0, g4=0, n, J, K, L) power.cra4(es=.25, alpha=.05, two.tailed=TRUE, rho2, rho3, rho4, p=.50, r21=0, r22=0, r23=0, r24=0, g4=0, n, J, K, L) mrss.cra4(es=.25, power=.80, alpha=.05, two.tailed=TRUE, n, J, K, L0=10, tol=.10, rho2, rho3, rho4, p=.50, r21=0, r22=0, r23=0, r24=0, g4=0) ```

## Arguments

 `power` statistical power (1-β). `es` effect size. `alpha` probability of type I error. `two.tailed` logical; `TRUE` for two-tailed hypothesis testing, `FALSE` for one-tailed hypothesis testing. `rho2` proportion of variance in the outcome between level 2 units (unconditional ICC2). `rho3` proportion of variance in the outcome between level 3 units (unconditional ICC3). `rho4` proportion of variance in the outcome between level 4 units (unconditional ICC4). `p` proportion of level 4 units randomly assigned to treatment. `g4` number of covariates at level 4. `r21` proportion of level 1 variance in the outcome explained by level 1 covariates. `r22` proportion of level 2 variance in the outcome explained by level 2 covariates. `r23` proportion of level 3 variance in the outcome explained by level 3 covariates. `r24` proportion of level 4 variance in the outcome explained by level 4 covariates. `n` harmonic mean of level 1 units across level 2 units (or simple average). `J` harmonic mean of level 2 units across level 3 units (or simple average). `K` harmonic mean of level 3 units across level 4 units (or simple average). `L` number of level 4 units. `L0` starting value for `L`. `tol` tolerance to end iterative process for finding `L`.

## Value

 `fun` function name. `parms` list of parameters used in power calculation. `df` degrees of freedom. `ncp` noncentrality parameter. `power` statistical power (1-β). `mdes` minimum detectable effect size. `L` number of level 4 units.

## Examples

 ```1 2 3 4 5 6 7``` ```# cross-checks mdes.cra4(rho4=.05, rho3=.05, rho2=.10, n=10, J=2, K=3, L=20) power.cra4(es = .412, rho4=.05, rho3=.05, rho2=.10, n=10, J=2, K=3, L=20) mrss.cra4(es = .412, rho4=.05, rho3=.05, rho2=.10, n=10, J=2, K=3) ```

PowerUpR documentation built on Oct. 25, 2021, 5:06 p.m.