Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

xchisq.test

Augmented Chi-squared test


Description

This augmented version of chisq.test() provides more verbose output.

Usage

xchisq.test(
  x,
  y = NULL,
  correct = TRUE,
  p = rep(1/length(x), length(x)),
  rescale.p = FALSE,
  simulate.p.value = FALSE,
  B = 2000,
  data = environment(x)
)

Arguments

x, y, correct, p, rescale.p, simulate.p.value, B

as in chisq.test(), but x may also be a formula, in which case x is replaced by tally(x, data) prior to the call to chisq.test().

data

a data frame for use when x is a formula.

See Also

Examples

# Physicians' Health Study data
phs <- cbind(c(104,189),c(10933,10845)) 
rownames(phs) <- c("aspirin","placebo") 
colnames(phs) <- c("heart attack","no heart attack") 
phs 
xchisq.test(phs) 
xchisq.test(sex ~ substance, data = HELPrct)

mosaic

Project MOSAIC Statistics and Mathematics Teaching Utilities

v1.8.3
GPL (>= 2)
Authors
Randall Pruim [aut, cre], Daniel T. Kaplan [aut], Nicholas J. Horton [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.