percent.table: Percentage Table

Description Usage Arguments Value See Also Examples

View source: R/percent.table.R

Description

For one variable, returns a frequency distribution table given in percentages. For two variables, returns a contingency table given in percentages.

Usage

1

Arguments

x

object containing data for a single variable.

y

optional second object to create a contingency table given in percentages. Default setting ignores second object by setting y = NULL.

Value

A table of frequency percentages (for one variable) or a contingency table of percentages (for two variables).

See Also

cumulative.table, table

Examples

1
2
3
4
5
# frequency table for one variable
percent.table(NELS$region)

# cross-tabulation for two variables
percent.table(Wages$south,Wages$occup)

Example output

x
    Northeast North Central         South          West 
         21.2          30.2          30.0          18.6 
                        y
x                        Management Sales Clerical Service Professional Other
  does not live in South        9.0   3.0      9.0     9.5         24.0  13.5
  lives in South                3.5   1.5      5.0     6.5          6.0   9.5

sur documentation built on Aug. 26, 2020, 1:06 a.m.

Related to percent.table in sur...