edland.linear.power: Linear mixed model sample size calculations.

View source: R/edland.linear.power.R

edland.linear.powerR Documentation

Linear mixed model sample size calculations.

Description

This function performs sample size calculations for the linear mixed model with random intercepts and slopes when used to test for differences in fixed effects slope between groups. Input parameters are random effect variance and residual error variance as estimated by a REML fit to representative pilot data or data from a representative prior clinical trial or cohort study.

Usage

edland.linear.power(
  n = NULL,
  delta = NULL,
  power = NULL,
  t = NULL,
  lambda = 1,
  sig2.int = 0,
  sig2.s = NULL,
  sig.b0b1 = 0,
  sig2.e = NULL,
  sig2.int_2 = NULL,
  sig2.s_2 = NULL,
  sig.b0b1_2 = NULL,
  sig2.e_2 = NULL,
  sig.level = 0.05,
  p = NULL,
  p_2 = NULL,
  alternative = c("two.sided", "one.sided"),
  tol = NULL
)

Arguments

n

sample size, group 1

delta

group difference in fixed effect slopes

power

power

t

the observation times

lambda

allocation ratio (sample size group 1 divided by sample size group 2)

sig2.int

variance of random intercepts, group 1

sig2.s

variance of random slopes, group 1

sig.b0b1

covariance of random slopes and intercepts,group 1

sig2.e

residual variance, group 1

sig2.int_2

variance of random intercepts, group 2 (defaults to sig2.int)

sig2.s_2

variance of random slopes, group 2 (defaults to sig2.s)

sig.b0b1_2

covariance of random slopes and intercepts, group 2 (defaults to sig.b0b1)

sig2.e_2

residual variance, group 2 (defaults to sig2.e)

sig.level

type one error

p

proportion vector for group 1, if i indexes visits, p[i] = the proportion whose last visit was at visit i (p sums to 1)

p_2

proportion vector for group 2 (defaults to p)

alternative

one- or two-sided test

tol

not used (no root finding used in this implementation).

Details

Default settings perform sample size / power / effect size calculations assuming equal covariance of repeated measures in the 2 groups, equal residual error variance across groups, equal allocation to groups, and assuming no study subject attrition. Specifically, variance parameters required for default settings are sig2.s, the variance of random slopes, and sig2.e, the residual error variance, both either known or estimated from a mixed model fit by REML to prior data.

This function will also provide sample size estimates for linear mixed models with random intercept only by setting sig2.s = 0 (although, this is not generally recommended).

This function was generalized April 2020. The function is back compatible, although the order of arguments has changed. The new function accommodates different variance parameters across groups, unequal allocation across groups, and study subject attrition (loss to followup), which may also vary across groups.

  • Unequal allocation is accommodated by the parameter lambda, where lambda = (sample size group 1)/(sample size group 2). lambda defaults to one (equal allocation).

  • Study subject attrition is accommodated by the parameter 'p', where p is a vector of proportions. If i indexes successive study visits, p[i] = the proportion whose last visit is at visit i. p sums to 1. p defaults to the case of no study subject attrition (everyone completes all visits).

  • differential study subject attrition is accommodated by the parameter p_2. p_2 is analogous to p, but for group 2. p_2 defaults to p (equal pattern of study subject attrition across groups).

  • Note that when there is study subject attrition, sample size / power calculations are also a function of the variance of random intercepts and the covariance of random intercepts and slopes. When p and/or p_2 are specified, edland.linear.power requires specification of these parameters. (These are part of the standard output of lmer and other software fitting REML models.) These parameters are specified by sig2.int and sig.b0b1 (group 1), and sig2.int_2 and sigb0b1_2 (group 2).

  • different variance parameters across groups is accommodated by the variance arguments sig2.int_2, sig.b0b1_2, sig2.s_2 and sig2.e_2, analogous to the the corresponding arguments within group 1. These values default to to the corresponding group 1 variables (equal variance across groups).

  • The parameter t is the design vector. For example, a one year trial with observations every three months would specify t = c(0, .25, .5, .75, 1).

Value

One of the number of subject required per arm, the power, or detectable effect size given sig.level and the other parameter estimates.

Author(s)

Michael C. Donohue, Steven D. Edland

References

Ard and Edland, S.D. (2011) Power calculations for clinical trials in Alzheimer's disease. Journal of Alzheimer's Disease. 21:369-377.

See Also

lmmpower, diggle.linear.power, liu.liang.linear.power, hu.mackey.thomas.linear.power

Examples


## Not run: 
browseVignettes(package = "longpower")

## End(Not run)
# An Alzheimer's Disease example using ADAS-cog pilot estimates
t <- seq(0,1.5,0.25)
edland.linear.power(delta=1.5, t=t, sig2.s = 24, sig2.e = 10, sig.level=0.05, power = 0.80)


longpower documentation built on Jan. 11, 2023, 5:12 p.m.