Learn R Programming

longpower (version 1.0-7)

edland.linear.power: 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"))

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

Value

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

Details

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

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

Run this code
browseVignettes(package = "longpower")
# 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){
        round(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)

Run the code above in your browser using DataLab