int.prop.table: Confidence intervals on a matrix of a contingent

View source: R/confidence.R

int.prop.tableR Documentation

Confidence intervals on a matrix of a contingent

Description

Confidence intervals on a matrix of a contingent

Usage

int.prop.table(x, margin = NULL, conf.level = 0.95)

Arguments

x

: a matrix (a two-dimensional contingency table: the entries of x must be non-negative integers).

margin

: a vector giving the margins to split by. E.g., for a matrix 1 indicates rows, 2 indicates columns, c(1, 2) indicates rows and columns. When x has named dimnames, it can be a character vector selecting dimension names.

conf.level

: Confidence level (from 0 to 1)

Value

Confidence interval on proportions of table obtained with prop.table().

Examples

contingent = with(airquality, table(cut(Temp, quantile(Temp)), Month))
prop.table(contingent) # proportions
int.prop.table(contingent) # confidence intervals
# by row
prop.table(contingent,1) # proportions
int.prop.table(contingent,1) # confidence intervals
# by col
prop.table(contingent,2) # proportions
int.prop.table(contingent,2) # confidence intervals

Antoine-Masse/KefiR documentation built on Feb. 22, 2024, 5:54 a.m.