aggrStats: Aggregate statistics

Description Usage Arguments Value Examples

Description

Calculates the number of records, mean, standard deviation, confidence interval for the mean from t-test (optionally) from a chosen column of a data table.

Usage

1
aggrStats(in.dt, in.col, in.bycol = NULL, in.cilevel = NULL, in.rob = F)

Arguments

in.dt

Input data table. Should contain at least one numeric column.

in.col

String with the column name in the data table from which the stats should be calculated.

in.bycol

String with the column name for grouping (optional).

in.cilevel

Number between 0 an 1 with confidence level for t-test (optional), If not provided CIs won't be calculated.

in.rob

Whether robust stats should be calculated instead

Value

Data Table with aggregaed statistics.

Examples

1
2
3
4
5
6
7
dt = data.table(x = c(rnorm(1000, 0, 1), rnorm(800, 1, 2)), gr = c(rep('a', 1000), rep('b', 800)))

# aggregation of the entire table without CI
dt.aggr.all = aggrStats(dt, 'x')

# aggregation within groups with CI
dt.aggr.gr = aggrStats(dt, 'x', 'gr', 0.95)

dmattek/hcs-package documentation built on May 16, 2019, 7:24 a.m.