{"name":"ttest","description":"Perform the Student's t hypothesis test","version":"1.1.0","author":{"name":"Andreas Madsen","email":"amwebdk@gmail.com"},"main":"./hypothesis.js","scripts":{"test":"tap test/simple/* && eslint ."},"repository":{"type":"git","url":"git://github.com/AndreasMadsen/ttest.git"},"keywords":["hypothesis","student t"],"dependencies":{"summary":"0.3.x","distributions":"^1.0.0"},"devDependencies":{"eslint":"^3.2.2","tap":"^6.3.0"},"license":"MIT","gitHead":"7a9bbfdb7a79a88e6738e5571ed8330f1bec98cb","bugs":{"url":"https://github.com/AndreasMadsen/ttest/issues"},"homepage":"https://github.com/AndreasMadsen/ttest#readme","_id":"ttest@1.1.0","_shasum":"615dc4caea72d09023d47d1ea388dad424462e43","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.2-pre","_npmUser":{"name":"andreasmadsen","email":"amwebdk@gmail.com"},"dist":{"shasum":"615dc4caea72d09023d47d1ea388dad424462e43","tarball":"http://registry-npm.ywwl.com/ttest/download/ttest-1.1.0.tgz","integrity":"sha512-gAgagmc3wqvhyCpgZeas+LRcSKiAuty6Q6EQOEU/tQKoF6710+45m0Vpzc5UUPIvlKJ1/jWKK0F09l5Wm04KCA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCuN0mYd+nQhIj5k7XtjRsvjxMWM1NbQRL54OzGSf4G9QIhAKxc+/GZ/+U+8yL49+A+Z7yFTgQJvC6CEC2YDb1KnqA9"}],"size":5131,"noattachment":false,"key":"/ttest/-/ttest-1.1.0.tgz"},"maintainers":[{"name":"andreasmadsen","email":"amwebdk@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/ttest-1.1.0.tgz_1479988567374_0.6863931426778436"},"directories":{},"readme":"# ttest\n\n> Perform the Student t hypothesis test\n\n## Installation\n\n```sheel\nnpm install ttest\n```\n\n## Example\n\n```javascript\nvar ttest = require('ttest');\n\n// One sample t-test\nttest([0,1,1,1], {mu: 1}).valid() // true\n\n// Two sample t-test\nttest([0,1,1,1], [1,2,2,2], {mu: -1}).valid() // true\n```\n\n## Documentation\n\n```javascript\nvar ttest = require('ttest');\n```\n\nThe `ttest` module supports both one and two sample t-testing, and both\nequal and none equal variance.\n\nIf one array of data is given its a one sample t-test, and if two data arrays\nare given its a two sample t-test.\n\n`ttest()` supports data in the following format:\n\n* an array of values, e.g. `ttest([1, 2, 3])`\n* a [`Summary`](https://github.com/AndreasMadsen/summary) object,\n  e.g. `ttest(new Summary([1, 2, 3]))`\n* an object with the following properties: `mean`, `variance`,\n  `size`, e.g. `ttest({mean: 123, variance: 1, size: 42})`\n\nIn all cases you can also pass an extra optional object, there takes the\nfollowing properties:\n\n```javascript\nconst options = {\n  // Default: 0\n  // One sample case: this is the µ that the mean will be compared with.\n  // Two sample case: this is the ∂ value that the mean diffrence will be compared with.\n  mu: Number,\n\n  // Default: false\n  // If false don't assume variance is equal and use the Welch approximation.\n  // This only applies if two samples are used.\n  varEqual: Boolean,\n\n  // Default: 0.05\n  // The significance level of the test\n  alpha: Number,\n\n  // Default \"not equal\"\n  // What should the alternative hypothesis be:\n  // - One sample case: could the mean be less, greater or not equal to mu property.\n  // - Two sample case: could the mean diffrence be less, greater or not equal to mu property.\n  alternative: \"less\" || \"greater\" || \"not equal\"\n};\n```\n\nThe t-test object is finally created by calling the `ttest` constructor.\n\n```javascript\nconst stat = ttest(sample, options);\nconst stat = ttest(sampleA, sampleB, options);\n```\n\nWhen the `ttest` object is created you can get the following information.\n\n##### stat.testValue()\n\nReturns the `t` value also called the `statistic` value.\n\n##### stat.pValue()\n\nReturns the `p-value`.\n\n##### stat.confidence()\n\nReturns an array containing the confidence interval, where the confidence level\nis calculated as `1 - options.alpha`. Where the lower limit has index `0` and\nthe upper limit has index `1`. If the alternative hypothesis is `less` or\n`greater` one of the sides will be `+/- Infinity`.\n\n##### stat.valid()\n\nSimply returns true if the `p-value` is greater or equal to the `alpha` value.\n\n##### stat.freedom()\n\nReturns the degrees of freedom used in the t-test.\n","publish_time":1479988567920,"_cnpm_publish_time":1479988567920,"dist-tags":{"latest":"4.0.0"}}