Learn R Programming

ISCAM (version 1.0.0)

iscamsummary: Some Summary Statistics

Description

summary calculates the five number summary, mean, and standard deviation of the quantitative variable x. An optional second, categorical variable can be specified and values will be calculated separately for each group. The number of digits in output can also be specified. Skewness is sample skewness: \(g_1 := \frac{m_3}{m_2^{3/2}}\), where \(m_2 := \frac{1}{n}\sum_{i=1}^{n}(x_i - \bar{x})^2\) and \(m_3 := \frac{1}{n}\sum_{i=1}^{n}(x_i - \bar{x})^3\) are the second and third central sample moments.

Usage

iscamsummary(x, explanatory = NULL, digits = 3)

Value

A table with some summary statistics of x.

Arguments

x

data to summarize.

explanatory

optional explanatory variable to group by.

digits

number of digits to round to.

Examples

Run this code
set.seed(0)
fake_data <- rnorm(30) # simulating some data
groups <- sample(c("group1","group2"), 30, TRUE)
iscamsummary(fake_data)
iscamsummary(fake_data, explanatory = groups, digits = 2) # with groups

Run the code above in your browser using DataLab