@gabrielrufino/samplesize
TypeScript icon, indicating that this package has built-in type declarations

1.0.35 • Public • Published

Sample Size

Package to determine the correct sample size for a survey

What is Sample Size?

Every survey needs an ideal number of responses according to the survey's target audience. This is where a statistical calculation that determines the desired sample size comes in.

The calculation is based on three important variables: population size, confiability rate and margin of error.

  • N: The population size
  • z: Score calculated from the confiability rate
  • e: Margin of error
  • p: Constant, generally 0.5

More information here.

Getting started

Install the package:

npm install @gabrielrufino/samplesize

Calculate the sample size:

import SampleSize from '@gabrielrufino/samplesize'

const size = SampleSize.calculate({
  population: 3000,
  confidence: SampleSize.confidences['90%'],
  errorMargin: 0.05,
})

console.log(size) // 250

License

UNLICENSED

Readme

Keywords

none

Package Sidebar

Install

npm i @gabrielrufino/samplesize

Weekly Downloads

3

Version

1.0.35

License

UNLICENSED

Unpacked Size

6.59 kB

Total Files

14

Last publish

Collaborators

  • gabrielrufino