# tabstat: Compact Table of Summary Statistics In brad-cannell/bfuncs: This Repository Is A Random Smattering Of Functions I Wrote For Myself - You Can Use Them Too

## Description

Based on Stata's "tabstat" command. "tabstat displays summary statistics for a series of numeric variables in one table. It allows you to specify the list of statistics to be displayed. Statistics can be calculated (conditioned on) another variable. tabstat allows substantial flexibility in terms of the statistics presented and the format of the table" (Stata, 2016).

## Usage

 `1` ```tabstat(x, digits = 3, stats = "default") ```

## Arguments

 `x` A continuous variable. `digits` Rounds the values returned to the specified number of decimal places (default 3). `stats` Return specified statistics. Options include: nCount of nonmissing values of x nmissCount of missing values of x ci95 percent confidence interval for the mean of x sumSum of x maxMaximum value of x minMinimum value of x range(Maximum value of x) - (minimum value of x) sdStandard deviation of x varVariance of x cvCoefficient of variation (sd / mean) of x semStandard error of the mean of x skewSkewness of x kurtKurtosis of x p11st percentile of x p55th percentile of x p1010th percentile of x p2525th percentile of x p50Median value of x medianMedian value of x p7575th percentile of x p9090th percentile of x p9595th percentile of x p9999th percentile of x iqrInterquartile range (p75 - p25) qEquivalent to specifying p25 p50 p75

## Value

A data frame. By default, the data frame contains the variable name and mean.

## References

Stata 14 help for tabstat http://www.stata.com/help.cgi?tabstat

## Examples

 ```1 2 3 4 5 6 7 8 9``` ```data(mtcars) # Single univariate analysis with Defaults tabstat(mtcars\$mpg) # Single univariate analysis with all stats tabstat(mtcars\$mpg, stats = c("n", "nmiss", "ci", "sum", "max", "min", "range", "sd", "var", "cv", "sem", "skew", "kurt", "p1", "p5", "p10", "p25", "p50", "median", "p75", "p90", "p95", "p99", "iqr", "q")) ```

brad-cannell/bfuncs documentation built on Dec. 13, 2018, 10:28 p.m.