chisq.bin: Chi-square goodness of fit test for binomial distribution

View source: R/ChisqBin.R

chisq.binR Documentation

Chi-square goodness of fit test for binomial distribution

Description

This function performs a chi-square goodness of fit test for a binomial distribution.

Usage

chisq.bin(x, f, n = NULL, p = NULL)

Arguments

x

The observed values.

f

The observed counts.

n

Binomial parameter n.

p

Binomial parameter pi.

Details

If p is not specified, then it is estimated from the data. If there are categories with expected counts less than 5 or less than 1 a warning is shown.

Value

It returns a table with the contribution to the chi-square statistic for each category, the chi-square statistic, the degrees of freedom, and the p-value.

Author(s)

Raúl Eyzaguirre.

Examples

x <- 0:6
f <- c(334, 369, 191, 63, 22, 12, 9)
chisq.bin(x, f, n = 10)

reyzaguirre/rhep documentation built on Dec. 2, 2024, 4:22 p.m.