numeric_summary: Numeric Value Summary of Weighted Records

Description Usage Arguments Details Value

Description

Because the births data set uses a weighted record strategy (i.e. you have to multiply everything by the cases field), the typical summary function won't return meaningful results. In order to provide some basic descriptive statistics for a numeric column in the data set, this function can be used instead.

Usage

1
2
numeric_summary(data, numeric_column, weight_column = "cases",
  na.rm = FALSE)

Arguments

data

a data frame, presumably the births data set or a derivative

numeric_column

the numeric column that you want to perform summary statistics on

weight_column

the column in the data.frame that contains the weighting value

na.rm

whether to pass a TRUE or FALSE value to the na.rm argument for each underlying aggregation function.

Details

It makes use of the dplyr format for summarizing results, and therefore integrates nicely with a chain of dplyr functions. Under the hood, it is using summarize_ and pasting strings together for evaluation, with the actual statistics being handled by the matrixStats package, based upon your input.

Value

A formula that can be executed in a dplyr summarize statement


Mikuana/vitalstatistics documentation built on May 7, 2019, 4:57 p.m.