diffDetect: Mean Difference Detetion Tool

Description Usage Arguments Details Value Author(s) References Examples

View source: R/diffDetect.R

Description

Provides Minimum Detectable Difference in Means Between Two Populations for fixed values of sigma and n. Useful for experimental design for randomized trials.

Usage

1
diffDetect(N,sigma,alpha=0.05, power=0.8, two.tailed=TRUE)

Arguments

N

A Vector (or single value) of fixed sample sizes.

sigma

A Vector (or single value) of fixed standard deviations sizes.

alpha

The desired Type I Error Rate

power

The desired level of power, recall power = 1 - Type II Error.

two.tailed

Logical, If TRUE calculations are based on a two-tailed Type I error, if FALSE, a one-sided calculation is performed.

Details

This function can be used as a tool for sensitivity analysis on the choice of population standard deviation. As is often the case, the sample size is fixed by practical considerations, such as cost or difficulty recruiting subjects. This simple tool may help determine whether it is worth performing an experiment that can only detect a given calculated difference between means.

Value

delta

A Matrix of minimum detectable differences for fixed values of n and sigma

N

A Vector (or single value) of specified sample sizes.

sigma

A Vector (or single value) of specified standard deviations sizes.

alpha

The desired Type I Error Rate

power

The desired level of power, recall power = 1 - Type II Error.

two.tailed

Logical, If TRUE calculations are based on a two-tailed Type I error, if FALSE, a one-sided calculation is performed.

Author(s)

Michael Rotondi, mrotondi@yorku.ca

References

Matthews JNS. Introduction to Randomized Controlled Clinical Trials (2nd Ed.) Chapman & Hall: New York, 2006.

Examples

1
2
3
4
5
6
7
## Not run: Suppose, for financial considerations we can only enroll 100 people in a blood
pressure medication trial.  What is the minimum difference we can detect between means if 
sigma = 1, 5 or 10 mmHg, at standard levels?
## End(Not run)
n <- 100;
sigma <- c(1, 5, 10);
diffDetect(n,sigma);

epibasix documentation built on May 2, 2019, 10:08 a.m.