JSPM

sample-population

1.0.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q24962F
  • License ISC

Returns sample size for population numbers

Package Exports

  • sample-population

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (sample-population) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Proportional Population Samples

npm i sample-population

Returns sample size for population numbers when supplied with the following paramaters

Example

var sample = require('sample-population');

var sampleSize = {
  population: 1234
};

var example = sample.population(sampleSize);

Parameters

population: numberrequired

confidence: numberdefault 1.98

The confidence level is the amount of uncertainty you can tolerate. Default is set to 1.98 which is 95% confidence.

errorMargin: numberdefault .5

The margin of error is the amount of error that you can tolerate. If 90% of respondents answer yes, while 10% answer no, you may be able to tolerate a larger amount of error than if the respondents are split 50-50 or 45-55. Lower margin of error requires a larger sample size. Default is set to .5

response: number default .5

For each question, what do you expect the results will be? If the sample is skewed highly one way or the other,the population probably is, too. If you don't know, use 50%, which gives the largest sample size. Default is set to .5