Learn R Programming

collapse (version 1.1.0)

A9-summary-statistics: collapse Summary Statistics

Description

collapse provides the following functions to efficiently summarize data:

  • qsu, shorthand for quick-summary, is an extremely fast summary command inspired by the (xt)summarize command in the STATA statistical software. It computes a set of 7 statistics (nobs, mean, sd, min, max, skewness and kurtosis) using a numerically stable one-pass method. Statistics can be computed weighted, by groups, and also within-and between entities (for multilevel / panel-data).

  • descr computes a concise and detailed description of a data.frame, including frequency tables for categorical variables and various statistics and quantiles for numeric variables. It is inspired by Hmisc::describe, but about 10x faster.

  • pwcor, pwcov and pwNobs compute pairwise correlations, covariances and observation counts, respectively. Pairwise correlations and covariances can be computed together with observation counts and p-values, and output as 3D array (default) or list of matrices. A major feature of pwcor and pwcov is the print method displaying all of these statistics in a single correlation table.

Arguments

Table of Functions

Function / S3 Generic Methods Description
qsu default, matrix, data.frame, pseries, pdata.frame Fast (grouped, weighted, panel-decomposed) summary statistics
descr No methods, for data.frame's or lists of vectors detailed statistical description of data.frame
pwcor No methods, for matrices or data.frame's pairwise correlations
pwcov No methods, for matrices or data.frame's pairwise covariances
pwNobs No methods, for matrices or data.frame's pairwise observation counts

See Also

Fast Statistical Functions, Collapse Overview