Description Usage Arguments Value Examples

Use `mdes.bird2()`

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

to calculate statistical power, and `cosa.bird2()`

for bound constrained optimal sample size allocation (BCOSSA).

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ```
mdes.bird2(score = NULL, dists = "normal", k1 = -6, k2 = 6,
order = 1, interaction = FALSE,
treat.lower = TRUE, cutoff = 0, p = NULL,
power = .80, alpha = .05, two.tailed = TRUE, df = n2 - g2 - 1,
rho2, omega2, r21 = 0, r2t2 = 0, g2 = 0,
rate.tp = 1, rate.cc = 0, n1, n2)
power.bird2(score = NULL, dists = "normal", k1 = -6, k2 = 6,
order = 1, interaction = FALSE,
treat.lower = TRUE, cutoff = 0, p = NULL,
es = .25, alpha = .05, two.tailed = TRUE, df = n2 - g2 - 1,
rho2, omega2, r21 = 0, r2t2 = 0, g2 = 0,
rate.tp = 1, rate.cc = 0, n1, n2)
cosa.bird2(score = NULL, dists = "normal", k1 = -6, k2 = 6, rhots = NULL,
order = 1, interaction = FALSE,
treat.lower = TRUE, cutoff = 0, p = NULL,
cn1 = 0, cn2 = 0, cost = NULL,
n1 = NULL, n2 = NULL, n0 = c(10, 100), p0 = .499,
constrain = "power", round = TRUE, max.power = FALSE,
local.solver = c("LBFGS", "SLSQP"),
power = .80, es = .25, alpha = .05, two.tailed = TRUE,
rho2, omega2, g2 = 0, r21 = 0, r2t2 = 0)
``` |

`score` |
vector or list; an empirical score variable or an object with class 'score' returned from the |

`dists` |
character; distribution of the score variable, |

`k1` |
left truncation point for (uncentered) empirical, truncated normal, or uniform distribution. Ignored when |

`k2` |
right truncation point for (uncentered) empirical, truncated normal, or uniform distribution. Ignored when |

`order` |
integer >= 0; order of polynomial functional form specification for the score variable. |

`interaction` |
logical; if |

`rhots` |
obsolote; use |

`treat.lower` |
logical; if |

`cutoff` |
decision threshold. |

`p` |
proportion of level 1 units in the treatment condition. |

`power` |
statistical power (1 - |

`es` |
effect size (Cohen's d). |

`alpha` |
probability of type I error ( |

`two.tailed` |
logical; |

`df` |
degrees of freedom. |

`rho2` |
proportion of variance in the outcome between level 2 units (unconditional ICC2). |

`omega2` |
ratio of the treatment effect variance between level 2 units to the variance in the outcome between level 2 units. |

`g2` |
number of covariates at level 2. |

`r21` |
proportion of level 1 variance in the outcome explained by level 1 covariates. |

`r2t2` |
proportion of treatment effect variance between level 2 units explained by level 2 covariates. |

`rate.tp` |
treatment group participation rate. |

`rate.cc` |
control group crossover rate. |

`n1` |
average number of level 1 units per level 2 units. |

`n2` |
number of level 2 units (blocks). |

`cn1` |
marginal costs per level 1 unit in treatment and control conditions (positional), e.g. |

`cn2` |
marginal cost per level 2 unit. |

`cost` |
total cost or budget. Ignored when |

`p0` |
starting value for |

`n0` |
vector of starting values for |

`constrain` |
character; constrains one of the |

`round` |
logical; |

`max.power` |
logical; |

`local.solver` |
subset of |

`parms` |
list of parameters used in the function. |

`df` |
degrees of freedom. |

`sse` |
standardized standard error. |

`cosa` |
BCOSSA solution. |

`mdes` |
minimum detectable effect size and (1 - |

`power` |
statistical power (1 - |

1 2 3 4 5 6 7 8 9 10 11 12 13 | ```
score.obj <- inspect.score(rnorm(1000),
order = 1, interaction = FALSE,
cutoff = 0, k1 = -1, k2 = 1)
power.bird2(score.obj,
es = 0.25, rho2 = .20, omega2 = .30,
g2 = 0, r2t2 = 0, n1 = 50, n2 = 30)
# minimum required number of level 1 units for each one of the level 2 block
cosa.bird2(score.obj,
es = 0.25, rho2 = .20, omega2 = .30,
g2 = 0, r2t2 = 0,
n1 = NULL, n2 = 30)
``` |

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.