power.contr.simulate: Compute power based on simulation

Description Usage Arguments Value Author(s) Examples

View source: R/sims.R

Description

Simulates samples based on normal distribution and test the contrast for each sample, providing power information

Usage

1
power.contr.simulate(rep, cont, n, means, sd = 1)

Arguments

rep

number of simulations to run

cont

contrast codes as a numeric vector

n

per cell n

means

pattern of means as numeric vector of the same length of cont

sd

pooled standard deviation

Value

a data.frame with all the simulated results of class simulations

Author(s)

Marcello Gallucci, mcfanda@gmail.com

Examples

1
2
3
4
5
## check actual power with 10 simulations
cont<-c(-3,-1,1,3)
means<-c(10,12,10,12)
pwr<-power.contr.simulate(10,cont,10,means,sd=1)
mean(pwr$`Pr(>|t|)`>=.05)

mcfanda/cpower documentation built on May 28, 2019, 1 p.m.