ci.mean: Power calculation for precision analysis (confidence...

ci.meanR Documentation

Power calculation for precision analysis (confidence interval) for one mean

Description

Calculates the "power" of a confidence interval for one mean, that is, the probability of achieving a 100(1 - alpha) percent confidence interval with halfwidth not greater than a specified value. Can solve for power, N or alpha.

Usage

ci.mean(
  N = NULL,
  halfwidth = NULL,
  sd = 1,
  alpha = 0.05,
  power = NULL,
  cond = FALSE,
  v = FALSE
)

Arguments

N

The sample size.

halfwidth

The desired halfwidth.

sd

The estimated standard deviation; defaults to 1.

alpha

The significance level (type 1 error rate); defaults to 0.05.

power

The specified level of power.

cond

Specify whether to use unconditional or conditional probability. Defaults to FALSE (unconditional).

v

Either TRUE for verbose output or FALSE (default) to output computed argument only.

Details

The unconditional probability is the probability of obtaining the desired precision (i.e., that the observed halfwidth does not exceed the desired halfwidth) regardless of whether or not the confidence interval includes the true parameter value. The conditional probability is the probability of both obtaining the desired precision and having the interval include the true parameter value.

Value

A list of the arguments (including the computed one).

Examples

ci.mean(N = NULL, halfwidth = 0.25, power = 0.8)
ci.mean(N = 62, halfwidth = 0.25, power = NULL)
ci.mean(N = 73, halfwidth = 0.25, cond = TRUE)

powertools documentation built on April 4, 2025, 5:02 a.m.