Last active
December 18, 2015 13:29
-
-
Save tmcw/5789934 to your computer and use it in GitHub Desktop.
Simple Statistics Play Snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void require('http://bit.ly/ss-js'); | |
// numbers from 1 to 100 | |
var myData = []; | |
for (var i = 0; i < 99; i++) { | |
myData[i] = i + 1; | |
} | |
ss.mean(myData); | |
ss.min(myData); | |
ss.quantile(myData , 0.2); | |
// points from 1,1 to 100,50 | |
var myPoints = []; | |
for (var i = 0; i < 99; i++) { | |
myPoints[i] = [i + 1, (i + 1)/2]; | |
} | |
ss.linear_regression() | |
.data(myPoints) | |
.line()(50); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment