{"name":"ttest","description":"Perform the Student's t hypothesis test","version":"2.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":"^2.1.0"},"devDependencies":{"eslint":"^3.2.2","tap":"^12.1.0"},"license":"MIT","gitHead":"684857de9bec429629fa04ccec62760acb6f6e46","bugs":{"url":"https://github.com/AndreasMadsen/ttest/issues"},"homepage":"https://github.com/AndreasMadsen/ttest#readme","_id":"ttest@2.1.0","_nodeVersion":"13.0.0-pre","_npmVersion":"6.9.0","dist":{"integrity":"sha512-6dj/XRHsY4lFZxzye+YgoRnGNnD6/eJvG/DVDnYbVF6T2c8TBTVXLzElKipK2BcdbDUXoDwYQBBbFQ8+SyEKVA==","shasum":"a9e870dc43da690ce65564965bd6771ba90cd821","tarball":"http://registry-npm.ywwl.com/ttest/download/ttest-2.1.0.tgz","fileCount":14,"unpackedSize":18894,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdYsBmCRA9TVsSAnZWagAAtHgP/irOhp8oJjbB1x6ajt7V\nCCHgWceLemLC9IOA7Tpmm7bZriTPuanszHvPezSjloH3Z51YTE7dM2Yz8eQy\nBxhE//NXCjU7U/00ZZd11JPTgyLSlRe2wXt81riFpDKvFs3c8fc9KcVQZa13\nfW6NNOivE+9NovIQSnfwbXiBdCM8hjo3bbp4fTDgh9iRxALp7WrwZ60F79Sy\nEWFwuy95J7OEy4fN+ydt1qtQz1piQ0uepqXO0gtPYfPjNCcS+R3URNXuGJC+\nSDbkppxNf7hFWLWIZzREfZvHUvEJYmV53Vi0Dw4VBAOYVUUSPxsONEhR9YsZ\nDHi9HAE4+5+ZF9Vy1/TnPccccuTi+KJFNAcNpCoAfp1q6cxRBPs2xfh24i7Z\n1A8xLVOJ44f9POMbuMyNgmIKeOwIG8a8363u8gJkF+o4Dy1zz+kOyx89L/au\nP4lHU4mtq5ke19JX5uBGTJSsBrCynln8s2Q+Eu9kHmlPSllLZhc+3ST9+GwY\nrTVbY1vIXw2WW1G3ldSq3DW0m8/48QsriTetD/K6hhMW1XCUz3atUQ+5O4LA\nFYXTueOAQYLD6mH+YgbV057cu0JusB5tkNruOmNfVpV2fTjOb/Z61m6S9g2a\nRHmGpsrNEwNbg7clGO78tqZW0wW4ObyOnT04G0WzoyvHRxKtWZm1xSKEhb+z\nNggz\r\n=Mig5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG/nnrrWEFHZjtSyypxQtu0NXQba6SicAB+psLuN7Rn8AiAGgyZ+8ePfIi3aWCCj5cgEPnGoeKMnfWC1M8Ze2t++JA=="}],"size":5262,"noattachment":false,"key":"/ttest/-/ttest-2.1.0.tgz"},"maintainers":[{"name":"andreasmadsen","email":"amwebdk@gmail.com"}],"_npmUser":{"name":"andreasmadsen","email":"amwebdk@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ttest_2.1.0_1566752869650_0.2911108521276904"},"_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":1566752869773,"_cnpm_publish_time":1566752869773,"dist-tags":{"latest":"4.0.0"}}