chisq.gof: Power calculation for chi-square goodness-of-fit test

chisq.gofR Documentation

Power calculation for chi-square goodness-of-fit test

Description

Performs sample size and power calculations for chi-square goodness-of-fit test, which is used to test whether a sample of data arises from a population with a specific discrete distribution. This function can solve for power, total sample size or alpha.

Usage

chisq.gof(
  p0vec = NULL,
  p1vec = NULL,
  N = NULL,
  alpha = 0.05,
  power = NULL,
  v = FALSE
)

Arguments

p0vec

Vector of probabilities for the specified population distribution. Must sum to 1.

p1vec

Vector of expected probabilities for the sample. Must sum to 1.

N

The total number of observations.

alpha

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

power

The specified level of power.

v

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

Value

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

Examples

chisq.gof(p0vec = c(0.5, 0.3, 0.2), p1vec = c(0.7, 0.15, 0.15), N = 50)

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