chisq.plot: Plot Expected and Observed Frequencies (Chi Square)

Description Usage Arguments Author(s) References See Also Examples

View source: R/chisq.plot.R

Description

This function will plot the expected vs. observed frequencies from a Chi Square Test and plot them in Barplots.

Usage

1
chisq.plot(list = NULL, v1 = NULL, v2 = NULL, standardize = F, sqrt.y = F)

Arguments

list

A table containing the variables. If not included, user can include raw data as v1 or v2

v1

The first variable (must be a factor)

v2

The second variable (also must be a factor)

standardize

Logical. Should the results be reported in proportions? (Rather than counts)

Author(s)

Dustin Fife

References

Agresti, A. (2007) An Introduction to Categorical Data Analysis, 2nd ed., New York: John Wiley & Sons. Page 38.

See Also

barchart

Examples

1
2
3
4
5
6
##' 
# From Agresti(2007) p.39
M = as.table(rbind(c(762, 327, 468), c(484, 239, 477)))
dimnames(M) = list(gender = c("F", "M"),
                    party = c("Democrat","Independent", "Republican"))
chisq.plot(list=M, standardize=F)              

dustinfife/fifer documentation built on Oct. 31, 2020, 3:36 p.m.