descriptive: Descriptive

Description Usage Arguments Value Author(s) References Examples

View source: R/descriptive.R

Description

This function generates a descriptive statistics of the data - similar to what proc tabulate procedure does in SAS

Usage

1
2
3
descriptive(ADS, vars = c(), type = "categorical", strata = list(),
  strata_label = list(), numeric_summary = "min+mean+median+sd+max",
  percent = "col", vars_label = c(), test = NULL)

Arguments

ADS

The input data frame.

vars

a vector consisting of all the variable names for which the descriptive has to be generated

type

a string indicating the type of descriptive to be generated. The possible values are "categorical","binary","continuous" with default being categorical. For binary, all the variables must have only 0 and 1 as possible values

strata

a list of vectors consisting of the names of the stratification variables. The variables in a vector will be stratified in the order given.

strata_label

The label for the strata variables. The size should be as same as that of the strata

numeric_summary

Only applicable to type="continuous". The summary functions can be mentioned as a string seperated by '+'

percent

Applicable to type "categorical" and "binary". It helps in generating percentage frequency of the variable. The possible values are "col","row" and "null". If unspecified there will be no percentage stats in the output

vars_label

The label for the "vars" The size should be as same as that of the strata

test

a string denoting the test which has to be conducted for calculating the p value

Value

A list with descriptive table and other input parameters

Author(s)

Nivesh Elangovanraaj, kenivesh@gmail.com

References

The function is built on the top of a package named "tables" [tables::tabular()]

Examples

1
descriptive(ADS,vars=c("country","race"),percent="col")

nivesh22/descriptive documentation built on Jan. 22, 2020, 8:03 p.m.