Description Usage Arguments Value Examples

For four-level cluster-randomized block designs (treatment at level 2, with random effects across level 3 and 4 blocks), use `mdes.bcra4r2()`

to calculate the minimum detectable effect size, `power.bcra4r2()`

to calculate the statistical power, and `mrss.bcra4r2()`

to calculate the minimum required sample size.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ```
mdes.bcra4r2(power=.80, alpha=.05, two.tailed=TRUE,
rho2, rho3, rho4, esv3=NULL, esv4=NULL,
omega3=esv3/rho3, omega4=esv4/rho4,
p=.50, r21=0, r22=0, r2t3=0, r2t4=0, g4=0,
n, J, K, L)
power.bcra4r2(es=.25, alpha=.05, two.tailed=TRUE,
rho2, rho3, rho4, esv3=NULL, esv4=NULL,
omega3=esv3/rho3, omega4=esv4/rho4,
p=.50, r21=0, r22=0, r2t3=0, r2t4=0, g4=0,
n, J, K, L)
mrss.bcra4r2(es=.25, power=.80, alpha=.05, two.tailed=TRUE,
n, J, K, L0=10, tol=.10,
rho2, rho3, rho4, esv3=NULL, esv4=NULL,
omega3=esv3/rho3, omega4=esv4/rho4,
p=.50, r21=0, r22=0, r2t3=0, r2t4=0, g4=0)
``` |

`power` |
statistical power |

`es` |
effect size. |

`alpha` |
probability of type I error. |

`two.tailed` |
logical; |

`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). |

`esv3` |
effect size variability as the ratio of the treatment effect variance between level 3 units to the total variance in the outcome (level 1 + level 2 + level 3 + level 4). Ignored when |

`esv4` |
effect size variability as the ratio of the treatment effect variance between level 4 units to the total variance in the outcome (level 1 + level 2 + level 3 + level 4). Ignored when |

`omega3` |
treatment effect heterogeneity as ratio of treatment effect variance among level 3 units to the residual variance at level 3. |

`omega4` |
treatment effect heterogeneity as ratio of treatment effect variance among level 4 units to the residual variance at level 4. |

`p` |
average proportion of level 2 units randomly assigned to treatment within level 3 units. |

`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. |

`r2t3` |
proportion of treatment effect variance among level 3 units explained by level 3 covariates. |

`r2t4` |
proportion of treatment effect variance among level 4 units 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 |

`tol` |
tolerance to end iterative process for finding |

`fun` |
function name. |

`parms` |
list of parameters used in power calculation. |

`df` |
degrees of freedom. |

`ncp` |
noncentrality parameter. |

`power` |
statistical power |

`mdes` |
minimum detectable effect size. |

`L` |
number of level 4 units. |

1 2 3 4 5 6 7 | ```
# cross-checks
mdes.bcra4r2(rho4=.05, rho3=.15, rho2=.15,
omega4=.50, omega3=.50, n=10, J=4, K=4, L=20)
power.bcra4r2(es = .206, rho4=.05, rho3=.15, rho2=.15,
omega4=.50, omega3=.50, n=10, J=4, K=4, L=20)
mrss.bcra4r2(es = .206, rho4=.05, rho3=.15, rho2=.15,
omega4=.50, omega3=.50, n=10, J=4, K=4)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.