{"name":"ttest","description":"Perform the Student's t hypothesis test","version":"3.0.0","author":{"name":"Andreas Madsen","email":"amwebdk@gmail.com"},"main":"./hypothesis.js","scripts":{"test":"tap test/simple/*"},"repository":{"type":"git","url":"git://github.com/AndreasMadsen/ttest.git"},"keywords":["hypothesis","student t"],"dependencies":{"summary":"^2.0.0","distributions":"^2.1.0"},"devDependencies":{"tap":"^14.0.0"},"license":"MIT","gitHead":"0b8b73f3ff81a0b69bb7143e5323503c5925b966","bugs":{"url":"https://github.com/AndreasMadsen/ttest/issues"},"homepage":"https://github.com/AndreasMadsen/ttest#readme","_id":"ttest@3.0.0","_nodeVersion":"13.12.1-pre","_npmVersion":"6.14.4","dist":{"integrity":"sha512-bLo+LdYokiDZHVFIWJmC5afoh7wZ+o1h++0XXKh01+yprzz8CnaiGNcbcbqP0e3+iyDqclLI+rM0j/9AwmRljw==","shasum":"01f491762178b46c1a4841b01829e1e8ff906d0b","tarball":"http://registry-npm.ywwl.com/ttest/download/ttest-3.0.0.tgz","fileCount":13,"unpackedSize":21997,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNTbbCRA9TVsSAnZWagAAkckQAJOr1wYdNow5FFJo6lTT\nbMAJwGxJw/hP+hf9Zx5fR7YZ3XtGuXbuJLPcS9YNVxvPbKhhokqLr2QGz++o\nJSNT926j7nMmbn8Pk8Avq3b6+oZDTM5hGwXwIa0X/psZgHKPBucEBEToiDUA\nWc3oW6CsJ8fLirSrCujAmcsjlmioIeLDr2IMOiZPGNTL43Vp5aacxFuuqkyI\nEEVPXUgkwkobu3cuVwtPTWTv25e+IaNzsO7xqP+5C1FuEN+lUTEVVyIhZ2d6\nTR44rJKubssfOmwis9or+bvL6rWSwJ55XZlh1YEoJjI+KNUJfiCX90w3vFJ9\n4G6wKpJXl2cB0w0dSYnUJnn+AG4jqOuZaMvyWUsnrUmR8fnfNAmcI/NsFf6T\nQ916F9kuoL1t4lJfkmpOuegGzX3LSKdWdjKVOvY4BYc5j15gaMyPyyBjpnlY\nlKs9E2v6iov2o2pPw2n5QEeYW0B4fXzdgduaoapzMlhdsALwH3YbgL/BwDgz\nz2hqUCHre61r4SQbJTW4AP1zaf7Uofp2vXz2vLJ2cxJC0xzwpeSZANJhxYBa\nw5fCrr0UHityB6wG23zAM9CumV2BOnyXMFX5q9/K49J42Mvea6BUWvNac2Sd\nRN7H8ARknOEu1AD+/FQXDsvx2eInuIfLvjqQopAP0YHfFKS0w5cm0u7aHemm\nBfGC\r\n=C/on\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDeFrDMnsLJ9eIlrmBcMiwe3uT4ZAEs/tV7BjnmMNGUuwIhAO4IeGJVX+wYvigGZjFV0UYzTytP4tP1NeGqMJdlf6or"}],"size":6862,"noattachment":false,"key":"/ttest/-/ttest-3.0.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_3.0.0_1597322970983_0.8553847781377173"},"_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":1597322971090,"_cnpm_publish_time":1597322971090,"dist-tags":{"latest":"4.0.0"}}