get_stats: Calculate Anscombe's summary statistics

View source: R/get_stats.R

get_statsR Documentation

Calculate Anscombe's summary statistics

Description

Calculates a particular set of summary statistics for a dataset.

Usage

get_stats(x)

Arguments

x

a numeric matrix or data frame with at least 2 columns/variables. Each column contains observations on a different variable. Missing observations are not allowed.

Value

A named list of summary statistics containing

  • n The sample size.

  • means The sample means of each variable.

  • variances The sample means of each variable.

  • correlation The sample correlation matrix.

  • intercepts,slopes,rsquared Matrices whose (i,j)th entries are the estimated regression coefficients in a regression of x[, i] on x[, j] and the resulting coefficient of determination R^2.

Examples

get_stats(anscombe[, c(1, 5)])

anscombiser documentation built on Oct. 3, 2022, 1:05 a.m.