freq1way: Analysis of 1-dimensional frequency tables

Description Usage Arguments Details Value Note Examples

View source: R/freq1way.r

Description

If hypothprob is absent: prints confidence intervals for the true proportions, a Chi-square test for uniformity, confidence intervals for differences in proportions (no corrections for multiple comparisons and plots the proportions.

Usage

1
2
3
4
5
6
7
8
9
freq1way(
  counts,
  hypothprob,
  conf.level = 0.95,
  addCIs = TRUE,
  digits = 4,
  arrowwid = 0.1,
  estimated = 0
)

Arguments

counts

A 1-way frequency table as produced by table.

hypothprob

If present, a set of probabilities to test the cell counts against.

conf.level

confidence level for the confidence interval, expressed as a decimal.

addCIs

If true, adds confidence limits to plot of sample proportions.

digits

used to control rounding of printout.

arrowwid

controls width of arrowheads.

estimated

default is 0. Subtracted from the df for the Chi-square test.

Details

If hypothprob is present: prints confidence intervals for the true proportions, a Chi-square test for the hypothesized probabilities, and plots the sample proportions (with atached confidence limits) alongside the corresponding hypothesized probabilities. )

Value

An invisible list containing the following components:

CIs

a matrix containing the confidence intervals.

exp

a vector of the expected counts.

chi

a vector of the components of Chi-square.

Note

These confidence intervals have been Bonferroni adjusted for multiple comparisons. This function has been deprecated and will be removed from future versions of the package

Examples

1
2
3
4
5
##Body image data:
data(body.df)
eth.table = with(body.df, table(ethnicity))
freq1way(eth.table)
freq1way(eth.table,hypothprob=c(0.2,0.4,0.3,0.1))

s20x documentation built on Jan. 7, 2021, 9:08 a.m.

Related to freq1way in s20x...