{"name":"ttest","description":"Perform the Student's t hypothesis test","version":"2.1.1","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.19.0","tap":"^12.7.0"},"license":"MIT","gitHead":"045da7232ea55fc737a971760ba429908e807aa0","bugs":{"url":"https://github.com/AndreasMadsen/ttest/issues"},"homepage":"https://github.com/AndreasMadsen/ttest#readme","_id":"ttest@2.1.1","_nodeVersion":"13.0.0-pre","_npmVersion":"6.12.1","dist":{"integrity":"sha512-YlRYswipptMVPLil4bsblnp2HXmcAR0McnfnuCM26EYrBZTCdUc/BVPuqZoaMb9h06smAPhe+s+wFMtYOULVGQ==","shasum":"ee0c9118fff6580a5c8d6cfe69845219e075277f","tarball":"http://registry-npm.ywwl.com/ttest/download/ttest-2.1.1.tgz","fileCount":14,"unpackedSize":22444,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd+188CRA9TVsSAnZWagAATuwQAJb7qYRENoKuHLo5xVBd\nZCsnT7cqArpoSMJca1F12l7t6jr8UCL0T36fu/lHDqZqkXOWDrErO4ORfj4l\n9sUakMQRg2FwTbqNj/+2YBtiM8UPK9VmeV6OTbpW/VAFUA3Sxjr6NFSKkWcz\nNuyTClWE0NKf4gqI8KwQYh4VCeG+jpfxl+wYLAJGUpGpU+25nmbpsfSmNsBa\nhi75DMS4AD2JtPB6QiG2ks9rHztVQ/qZNOsFBwfL/Crsl/xw7gQiGyIaVVBl\nx4XPvAuia1kjoPq/H8uKjOSCtJ4eqvjFuJBnWHPpbrH+IBFQBC1fYmkZd05/\nirKKOCB09A/DnnJYtCcuWTaXpoZ7ekLir9L+x/iLRYPzxdUZi3TktvpUmcp9\nIkb/UlXcFVg0ZtOte1ujJ1yuvZBlwapfGdxHgedgdcs+Z9tO0VdRJHHzhGzn\nrOIurj0jQb9Oglhx+iYsm1uH00eoz0voD6Q7G2TuQJ9NxsHZDPS0QlPSLeSI\n8vHx7s+YpJHkeF+/kfE/AfxANAHQbmY5GVCCUZg18JWtxnJvCw+SdkPN+UB8\nYllaz+vF5Tx0JUpF+BdhR3DRJhmBL/9cw+7hTJSk+l42Bp76nD+TDMKn9qBu\ne6An2LWBKw3mASfKMhEEvRAAnfvxPglemv25FbO1eK+Bvb5XWgYgzdDZzmpH\nO2Yw\r\n=qZTe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCqH9Ksgpu4P7GEIbaxQdxsYsIXgMvqbKsu+06dJ9hgPQIhALOJ8e8kLqB0JkeTwMFXZU+1I/nm+mGFwULRlofHVw28"}],"size":7096,"noattachment":false,"key":"/ttest/-/ttest-2.1.1.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.1_1576755003477_0.6156303500467073"},"_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":1576755003593,"_cnpm_publish_time":1576755003593,"dist-tags":{"latest":"4.0.0"}}