Skip to contents

A Monte-Carlo approximation of the power of a two-sample comparison of replicate means formed from independent, unit-variance normal cells. There is no between-unit random effect or intraclass correlation. The result is an idealized scenario, not a validated estimate of power for a clustered biological assay or a formal upper bound on laboratory power. For a follow-up design use cr_power() with an effect on the independent experimental-unit scale, or a separately specified correlated-data model.

Usage

cr_power_analysis(
  effect_size,
  n_replicates,
  n_cells_per_rep,
  alpha = 0.05,
  test = "t_test",
  n_sim = 500,
  seed = NULL
)

Arguments

effect_size

Cohen's d at the cell level.

n_replicates

Number of replicate units per group.

n_cells_per_rep

Cells per replicate unit.

alpha

Type I error rate.

test

Only "t_test" is implemented.

n_sim

Number of simulations (default 500).

seed

Optional integer seed. The caller's random number stream is restored on exit.

Value

A tibble with the inputs and the simulated power.

Examples

cr_power_analysis(effect_size = 0.8, n_replicates = 4,
                  n_cells_per_rep = 100, n_sim = 100, seed = 1)
#> # A tibble: 1 × 5
#>   effect_size n_replicates n_cells_per_rep alpha power
#>         <dbl>        <dbl>           <dbl> <dbl> <dbl>
#> 1         0.8            4             100  0.05     1