tabstat: Compact Table of Summary Statistics

Description Usage Arguments Value References Examples

View source: R/tabstat.R

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:

n

Count of nonmissing values of x

nmiss

Count of missing values of x

ci

95 percent confidence interval for the mean of x

sum

Sum of x

max

Maximum value of x

min

Minimum value of x

range

(Maximum value of x) - (minimum value of x)

sd

Standard deviation of x

var

Variance of x

cv

Coefficient of variation (sd / mean) of x

sem

Standard error of the mean of x

skew

Skewness of x

kurt

Kurtosis of x

p1

1st percentile of x

p5

5th percentile of x

p10

10th percentile of x

p25

25th percentile of x

p50

Median value of x

median

Median value of x

p75

75th percentile of x

p90

90th percentile of x

p95

95th percentile of x

p99

99th percentile of x

iqr

Interquartile range (p75 - p25)

q

Equivalent 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.