Learn R Programming

clusterPower (version 0.6.111)

fixed.effect: Canned estimation functions for the power simulations.

Description

These functions are designed to be used by the power.sim.XXX functions as the functions which estimate the treatment effect. They fit simple fixed and random effects models and return the estimated treatment effect. These functions are not designed to be called directly by the user.

Usage

fixed.effect(dat, incl.period.effect, outcome.type, alpha)

fixed.effect.cluster.level(dat, incl.period.effect, outcome.type, alpha)

random.effect(dat, incl.period.effect, outcome.type, alpha)

weighted.crossover.cluster.level(dat, incl.period.effect, outcome.type, alpha)

Arguments

dat

observed data as a data.frame with columns named, "y", "trt" and "clust". "per" column is optional if period.var==0.

incl.period.effect

indicator of whether to include a period effect

outcome.type

one of "gaussian", "binomial", "poisson"

alpha

the type I error rate

Value

A numeric vector with the following three elements, in order: [1] a point estimate for the treatment effect, [2] lower bound of (1-alpha) confidence interval, [3] lower bound of (1-alpha) confidence interval.

Details

random.effect() relies on a call to glmer() from the lme4 package. fixed.effect() relies on a call to glm(). fixed.effect.cluster.level() will save lots of time if you just want to run a cluster-level analysis and you have lots of observations. weighted.crossover.cluster.level() implements methods for fitting a weighted analysis on data from a crossover study (see Turner et al. 1997).

See Also

power.sim.normal, power.sim.binomial, power.sim.poisson