Select Page
Latest 0.1.0 https://github.com/natalia-io/simplestats MIT ios 8.0 Natália Mendonça

## Example

Usage is very simple. After installation, write at the top of your file:

``import SimpleStats``

From then on, you can call functions such as .avg(), .sd(), .variance(), etc. on arrays of type [Double] and [Int], like so:

``````var xValues:[Double] = [7.5,8.8,9.3,8.1,6,8,7,5.9,2.3,7]
var yValues:[Double] = [203,345,174,245,235,864,356,668,847,905]
print(xValues.avg())
print(yValues.avg())
//6.99
//484.2``````

Create a dictionary from two arrays with the same count and you can easily calculate correlation:

``````var dictionary = [Double:Double]()

for i in xValues.indices {
dictionary[xValues[i]] = yValues[i]
}

var correlation = dictionary.r()
print(correlation)

//-0.4980879419156199``````

## Installation

SimpleStats is available through CocoaPods. To install

``pod 'SimpleStats'``

## Author

Natália Mendonça, [email protected]

### Latest podspec

```{
"name": "SimpleStats",
"version": "0.1.0",
"summary": "Calculate statistical functions easily and quickly. No new classes, only extensions.",
"description": "'Simple, easy-to-use Array and Dictionary extensions to calculate statistics such as average, median, standard deviation, standard error, variance, covariance, confidence intervals, correlation coefficients, etc.'",
"homepage": "https://github.com/natalia-io/simplestats",
"type": "MIT",
},
"authors": {
"Natu00e1lia Mendonu00e7a": "[email protected]"
},
"source": {
"git": "https://github.com/natalia-io/simplestats.git",
"tag": "v0.1.0"
},