Last data update: 2014.03.03

R: Linear mixed model sample size calculations.
edland.linear.powerR Documentation

Linear mixed model sample size calculations.

Description

This function performs the sample size calculation for a linear mixed model with random slope.

Usage

edland.linear.power(n = NULL, delta = NULL, t = NULL, sig2.s = 0,
  sig2.e = 1, sig.level = 0.05, power = NULL,
  alternative = c("two.sided", "one.sided"), tol = .Machine$double.eps^2)

Arguments

n

sample size per group

delta

group difference in slopes

t

the observation times

sig2.s

variance of random slope

sig2.e

residual variance

sig.level

type one error

power

power

alternative

one- or two-sided test

tol

numerical tolerance used in root finding.

Details

This function will also provide sample size estimates for linear mixed models with random intercept only simply by setting sig2.s = 0

Value

The number of subject required per arm to attain the specified power given sig.level and the other parameter estimates.

Author(s)

Michael C. Donohue, Steven D. Edland

References

Edland, S.D. (2009) Which MRI measure is best for Alzheimer's disease prevention trials: Statistical considerations of power and sample size. Joint Stat Meeting Proceedings. 4996-4999.

See Also

lmmpower, diggle.linear.power, liu.liang.linear.power

Examples


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

## End(Not run)
# Reproduces the table on page 29 of Diggle et al
n = 3
t = c(0,2,5)
rho = c(0.2, 0.5, 0.8)
sigma2 = c(100, 200, 300)
tab = outer(rho, sigma2, 
      Vectorize(function(rho, sigma2){
        ceiling(edland.linear.power(
          delta=0.5,
          t=t,
          sig2.e=sigma2*(1-rho),
          alternative="one.sided",
          power=0.80)$n)}))
colnames(tab) = paste("sigma2 =", sigma2)
rownames(tab) = paste("rho =", rho)
tab

# An Alzheimer's Disease example using ADAS-cog pilot estimates
t = seq(0,1.5,0.25)
n = length(t)

edland.linear.power(delta=1.5, t=t, sig2.s = 24, sig2.e = 10, sig.level=0.05, power = 0.80)

Results