n_glm: Calculate sample size for a group comparison via generalized...

Description Usage Arguments Value References

View source: R/cundill.R

Description

Estimation of required sample size as given by Cundill & Alexander (2015).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
n_glm(
  mean0,
  mean1,
  dispersion0,
  dispersion1,
  alpha,
  power,
  link_fun = function(mu) NULL,
  variance_fun = function(mu, dispersion) NULL,
  dmu_deta_fun = function(mu) NULL,
  q
)

Arguments

mean0

Mean in control group

mean1

Mean in treatment group

dispersion0

Dispersion parameter in control group

dispersion1

Dispersion parameter in treatment group.

alpha

Type I error rate

power

1 - Type II error rate

link_fun

function object, the link function to create the response η.

variance_fun

function object, function for computing the variance based on a mean and a dispersion parameter

dmu_deta_fun

function object, derivative of the original mean with respect to the link: dμ / dη.

q

Number between 0 and 1, the proportion of observations allocated to the control group

Value

Total sample size (numeric)

References

Cundill, B., & Alexander, N. D. E. (2015). Sample size calculations for skewed distributions. BMC Medical Research Methodology, 15(1), 1–9. https://doi.org/10.1186/s12874-015-0023-0


skewsamp documentation built on Dec. 17, 2021, 1:07 a.m.