row.marginal: Row marginal table from contingency table

Description Usage Arguments Details Value Examples

Description

This function inputs a contingency table and produces a univariate frequency table from the row marginals.

Usage

1
row.marginal(contingencytable)

Arguments

contingencytable

A censored contingency table. Accepted classes are a data.frame or matrix. See Details section for formatting.

Details

Table Format:
The only symbols accepted for censored data are listed below. Note, less than or equal to (<= and LE) is not equivalent to less than (< and L) and greater than or equal to (>=, +, and GE) is not equivalent to greater than (> and G). Also, calculations use closed intervals.

The column names should be the Y category values. The first column should be the X category values and the row names can be arbitrary. The inside of the table are X * Y cross tabulation, which are either positive frequency values or probabilities. The row and column marginal totals corresponding to their X and Y category values need to be placed in this table. The top left, top right, and bottom left corners of the table should be NA or blank. The bottom right corner can be a total cross tabulation sum value, NA, or blank. The table below is a formatted example.

NA <20 20-30 >30 NA
<5 18 19 8 45
5-9 13 8 12 33
>=10 7 5 10 21
NA 38 32 31 NA

Value

A univariate frequency table (data.frame) created from the row marginals.

Examples

1
2
# contingencytable.csv is a preloaded contingency table example
row.marginal(contingencytable.csv)

Example output

   Row Category Marginal Frequencies
1             1                54838
2             2                92830
3             3               154037
4             4               164925
5             5               134884
6             6                85593
7             7                43645
8             8                21859
9             9                 9790
10          10+                 7613

revengc documentation built on May 2, 2019, 3:43 a.m.