Latest 0.1.0
Homepage https://github.com/natalia-io/simplestats
License MIT
Platforms ios 8.0
Authors

CI Status
Version
License
Platform

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

Requirements

Installation

SimpleStats is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'SimpleStats'

Author

Natália Mendonça, [email protected]

License

SimpleStats is available under the MIT license. See the LICENSE file for more info.

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",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Natu00e1lia Mendonu00e7a": "[email protected]"
    },
    "source": {
        "git": "https://github.com/natalia-io/simplestats.git",
        "tag": "v0.1.0"
    },
    "social_media_url": "https://www.facebook.com/axiomaticdoubts",
    "platforms": {
        "ios": "8.0"
    },
    "swift_version": "4.2",
    "source_files": "SimpleStats/SimpleStats.swift"
}

Pin It on Pinterest

Share This