analysis_prep v0.1.2 AnalysisPrep.Summary
Summarize a data series.
Assume it’s a continuous data series. Returns the normal kinds of analysis_prep:
- count
- min
- max
- mean
- median
- variance
- standard deviation
- sum
If it is a categorical value, calculate the frequency of each category, as well as the frequency percent. Also, summarize the shape of the frequencies with the regular summary.
Uses a struct to contain all the possible values.
Summary
Functions
iex> summary([1,2,3]).count
3
Functions
iex> summary([1,2,3]).count
3
iex> summary([1,2,3]).min
1
iex> summary([1,2,3]).max
3
iex> summary([1,2,3]).mean
2.0
iex> summary([1,2,3]).median
2
iex> summary([1,2,3,4]).median
2.5
iex> summary([1,2,3]).variance
0.6666666666666666
iex> summary([1,2,3]).stdev
0.816496580927726
iex> summary([1,2,3]).sum
6
iex> summary([1,2,3], :categorical).frequency
%{1 => 1, 2 => 1, 3 => 1}
iex> summary([1,2,3], :categorical).frequency_percent
%{1 => 0.3333333333333333, 2 => 0.3333333333333333, 3 => 0.3333333333333333}