chi.squared.test: Pearson's Chi-squared Test for Contingency Tables

Description Usage Arguments Value Author(s)

Description

Extends chi.squared.test in package Deducer by warning when expected cell frequences are less than 5.

Usage

1
chi.squared.test(x, y = NULL, conservative = FALSE, cramers.v.conf = 0.95, simulate.p.value = FALSE, B = 10000)

Arguments

x

A vector or a matrix

y

A vector that is ignored if x is a matrix and required if x is a vector

conservative

If FALSE, the usual chi-squared test is performed and if simulate.p.value=TRUE, the monte carlo mid p-value is returned. Otherwise, Yates' continuity correction is applied, and if simulate.p.value=TRUE the monte carlo conservative p-value is returned

cramers.v.conf

The confidence level for the confidence interval around the Cramer's V effect size

simulate.p.value

a logical indicating whether to compute p-values by monte carlo simulation

B

An integer specifying the number of replicates used in the monte carlo test

Value

A list with class “htest” containing the following components:

statistic

the value the chi-squared test statistic.

parameter

the degrees of freedom of the approximate chi-squared distribution of the test statistic.

p.value

the p-value for the test.

method

a character string indicating the type of test performed, and whether Monte Carlo simulation or continuity correction was used.

data.name

a character string giving the name(s) of the data.

observed

the observed counts.

expected

the expected counts under the null hypothesis.

residuals

the Pearson residuals, (observed - expected) / sqrt(expected).

estimate

Cramer's V

conf.int

A confidence interval for Cramer's V

Author(s)

Bill Altermatt


DeducerRichOutput documentation built on May 2, 2019, 4:53 p.m.