oii.freq: Frequency tables

Description Usage Arguments Value See Also Examples

Description

This function prints a simple frequency table with totals and percentages

Usage

1

Arguments

x

input variable, (usually of class factor)

Value

A data.frame with one row per each unique value of x. These values of x are assigned to the row.names of the data.frame. The data.frame also has rows for:

Valid Total

The total number of non-missing cases (i.e., sum(!is.na(x)))

Missing

The total number of missing/NA cases (i.e., sum(is.na(x)))

Total

The total number of cases (i.e., length(x))

The data.frame has the following columns:

freq

The number of cases with this value

percent

The percentage of all cases that this value represents

valid_percent

The percentage of all valid (i.e., not missing) cases that this value represents

cum_percent

The cumulative percentage of valid cases

See Also

data.frame, row.names is.na, length, summary, table

Examples

1
2
3
4
5
#Create var as 200 A's, B's, and C's
var<-sample(LETTERS[1:3],size=200,replace=TRUE)

#Generate a frequency table for the counts of A's, B's, and C's
oii.freq(var)

oii documentation built on May 2, 2019, 6:33 a.m.

Related to oii.freq in oii...