cumulative.table: Cumulative Percentage Table

Description Usage Arguments Details Value See Also Examples

View source: R/cumulative.table.R

Description

Returns as a named vector the cumulative percentage frequency distribution of a variable x at each unique value.

Usage

1

Arguments

x

object containing data for a single variable.

Details

If x contains NA values (missing data), the cumulative percentage table will not reach 100. The table will end with the cumulative percentage of non-missing data within the object; the value remaining after subtracting this value from 100 represents the percentage of NA values within the object.

Value

A named numeric vector containing cumulative percentage frequencies, named by unique values of x and ordered numerically or alphabetically by name.

See Also

percent.table, cumsum, table

Examples

1
2
3
4
5
# using variable without NA values
cumulative.table(NELS$famsize)

# using variable with NA values
cumulative.table(NELS$parmarl8)

Example output

    2     3     4     5     6     7     8     9 
  1.8  12.2  52.0  80.4  91.4  95.6  97.4 100.0 
                  Divorced                    Widowed 
                       5.2                        6.4 
                 Separated              Never Married 
                       8.0                        9.0 
Marriage-Like Relationship                    Married 
                      10.0                       95.4 

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

Related to cumulative.table in sur...