ttestCorrSim: ttestCorrSim(n,B,mu) A function to model effect of...

Description Usage Arguments Value Author(s) Examples

View source: R/ttestCorrSim.R

Description

This function calculates the power of an independent 2-sample t-test, to detect various differences in pairs of means (mu), under the presence of a variety of correlation (rho) values. Produces data and a plot.

Usage

1
2
ttestCorrSim(n = 30, B = 1000, mu = matrix(c(0, 0, 0, 0.25, 0, 0.5, 0,
  0.75), byrow = T, nrow = 4))

Arguments

n

The sample size of for each simulation. Defaults to n=30.

B

The number of simulations to perform for each pair of mean (mu) values. Defaults to 1000.

mu

The matrix of pairs of mean values to compare. Each pair of mu values is a row. Defaults to matrix(c(0,0,0,.25,0,.5,0,.75),byrow=T,nrow=4), which compares 0 to .25, .5, and .75.

Value

x A list, containing a data frame for each pair of means.

x[[m]] A data frame for the mth mean pair comparison. Contains means, rho, and power.

plot Displays a plot of the all simulations.

Author(s)

Jennifer Starling

Examples

1
ttestCorrSim(n=30,B=100,mu=matrix(c(0,0,0,.25,0,.5,0,.75),byrow=T,nrow=4))

jstarling1/starlib documentation built on May 20, 2019, 2:12 a.m.