{"name":"ttest","description":"Perform the Student's t hypothesis test","version":"2.0.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":"^2.0.0"},"devDependencies":{"eslint":"^3.2.2","tap":"^12.1.0"},"license":"MIT","gitHead":"132a6f8d060e21066318a5cec98a4446fdbe4fea","bugs":{"url":"https://github.com/AndreasMadsen/ttest/issues"},"homepage":"https://github.com/AndreasMadsen/ttest#readme","_id":"ttest@2.0.0","_npmVersion":"6.4.1","_nodeVersion":"12.0.0-pre","_npmUser":{"name":"andreasmadsen","email":"amwebdk@gmail.com"},"dist":{"integrity":"sha512-OtO1caDn7USjJNq5GInnNWueD2ImTADQK0r+iMTs0l3ovHOunm8MVmTLwIvhRxGg+1+AOz3bPzr4ig/aMiSDBQ==","shasum":"693e75ebb5a135dfa59654c6b5b2c5849402a7f9","tarball":"http://registry-npm.ywwl.com/ttest/download/ttest-2.0.0.tgz","fileCount":13,"unpackedSize":17706,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBmzYCRA9TVsSAnZWagAAp9MP/j12xrtUnPyynayAy+NI\nxPodmeNIRqUYPcM5C6StNP1ZjSVVvYSLAAbMqP57O1ElvlPKsXSTcejpJcm/\nVc5CKWGoY9ySWR37jei9axUuojEWKSY/kN9bbiK28VKzBuU7fc7fRoH37/Dr\nfAE2pCyYw8aOW+4Kyi72DcgTKpefmFuW6fdegvbV4NQFl1o8Hzt+r362CENS\nD2fXtZvUQXozw4qYBjzK3IHs8LJsDraKQ4tp22QnfdBieDkWo8fv5dmy88Ig\n09mvsGNDNwSsIb/qt6EDLRKeH9XDIrRXxqy02J0AEzYypjtGLRmzTpwm8GJ5\nnCdkSzs6xNsxTPA5vxjtzT6O0/xoC0RC2lLN9K/whx9pDbPKXXRERCNATQeQ\nejf1Ajh9/igmSMu9LH1K1oNUX3Oru7ohAjHgaPf16xs0Lpl1V8cEtXXiRxSs\n8Mf994gnHtZJzPo70GrVFnEelrHdZa4NIZNGVekt90vsAZjR4NG8klQOlYGH\n62qj9WZLnq3oLn0ueKTKxsRZQEeTFInjycMHhTkV4sMS4xun4DspaQRTbO6A\nnnKxNpMfnPc3N9wIzwv+9RTGCJhIfyFU0JKe+0KuV5S7mqFIl08aFP7nbYIf\nAcL8M5wmjPvyCDSL3RJ25U8cvNvdu9TrNCLd23ESXEX2aOvlB2VK3GR07OX0\nHYWa\r\n=zpC9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCLVTBuwt5vI5hSGK88yaJOWWIuJe8qYT/TCqBco8g3KwIhAI7K0vufVftMucIeQhl+CUvCqbOt94hTBKwKqJ6mSBPH"}],"size":5022,"noattachment":false,"key":"/ttest/-/ttest-2.0.0.tgz"},"maintainers":[{"name":"andreasmadsen","email":"amwebdk@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ttest_2.0.0_1543924952219_0.4304611247627177"},"_hasShrinkwrap":false,"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":1543924952319,"_cnpm_publish_time":1543924952319,"dist-tags":{"latest":"4.0.0"}}