bin_stats: Split data into bins (usually time bins), then calculate...

Description Usage Arguments Value Note Author(s)

View source: R/bin_stats.R

Description

Essentially the part of VPC that deals with observed data. Good for finding trends in large data sets.

Usage

1
2
bin_stats(data, bins, dv_col = "DV", ind_var_col = "TIME", pct = c(10, 50,
  90))

Arguments

data

data frame. Suitably filtered and containing the data to analyse.

bins

numeric vector giving the cut off values for the time bins (binning doesn't have to based on time - see ind_var_col).

dv_col

column name (default value 'DV') in data containing the experimental data (default value is 'DV')

ind_var_col

column name (default value 'TIME') in data containing the variable to use for binning.

pct

numeric vector of percentiles (default value c(10,50,90)) to calculate for the dv_col data within each bin.

Value

A matrix object with one column for each bin, and the following rows of summary statistics for the dv_col data within each bin (see sum_stats function documentation for descriptions):

Note

For a bin with limits (LOWER,UPPER), an observation will go into that bin if it is >=LOWER and <UPPER.

Author(s)

Rupert Austin


jgrevel/BAST1-R-Library documentation built on May 21, 2019, 10:11 a.m.