s2k: Statistics for 2 by K table

View source: R/s2k.R

s2kR Documentation

Statistics for 2 by K table

Description

Statistics for 2 by K table

Usage

s2k(y1, y2)

Arguments

y1

a vector containing the first row of a 2 by K contingency table.

y2

a vector containing the second row of a 2 by K contingency table.

Details

This function calculates one-to-others and maximum accumulated chi-squared statistics for a 2 by K contingency table.

Value

The returned value is a list containing:

  • x2a the one-to-other chisquare.

  • x2b the maximum accumulated chisquare.

  • col1 the column index for x2a.

  • col2 the column index for x2b.

  • p the corresponding p value.

Note

The lengths of y1 and y2 should be the same.

Author(s)

Chihiro Hirotsu, Jing Hua Zhao

References

\insertRef

hirotsu01gap

Examples

## Not run: 
# an example from Mike Neale
# termed 'ugly' contingency table by Patrick Sullivan
y1 <- c(2,15,16,35,132,30,25,7,12,24,10,10,0)
y2 <- c(0, 6,31,49,120,27,15,8,14,25, 3, 9,3)

result <- s2k(y1,y2)

## End(Not run)

gap documentation built on Sept. 11, 2024, 5:36 p.m.