Comments (4)
Does anyone have information on the methods used for sample size calculation? Cannot find any mathematical references that describe what exactly is going on here.
from surveys.
This can be used for simple random sampling: http://www.openepi.com/SampleSize/SSPropor.htm
from surveys.
Ok, so this is the code according to openepi
#' Sample size computation as in OpenEpi
#' http://www.openepi.com/SampleSize/SSPropor.htm
sample_size <- function(population_size, expected_prevalence,
precision, design_effect, alpha = 0.05) {
num <- (design_effect * population_size * expected_prevalence * (1 - expected_prevalence))
denom <- (precision^2 / qnorm(1 - alpha / 2)^2 * (population_size - 1) + expected_prevalence * (1 - expected_prevalence))
as.integer(round(num / denom))
}
sample_size(1e+06, 0.5, 0.05, 1)
#> [1] 384
sample_size(10, 0.5, 0.05, 1, alpha = c(0.05, 0.2, 0.1, 0.03, 0.01, 0.001, 0.0001))
#> [1] 384 164 270 471 663 1082 1511
from surveys.
And with conversion to HH from https://www.humanitarianresponse.info/sites/www.humanitarianresponse.info/files/documents/files/Sampling_Paper_June_2012.pdf page 14
sample_size_households <- function(sample_size, avg_hh, prop_under_5, frac_6_59, non_response_rate = 0) {
hh <- sample_size / (avg_hh * prop_under_5 * frac_6_59)
hh <- (1 + non_response_rate) * hh
as.integer(ceiling(hh))
}
sample_size_households(500, 6.2, 0.15, 0.9)
#> [1] 598
sample_size_households(500, 6.2, 0.15, 0.9, non_response_rate = 0.1)
#> [1] 658
from surveys.
Related Issues (7)
- Nutrition survey sample size calculation HOT 4
- Vaccine coverage sample size calculation HOT 1
- Generating an interview schedule HOT 6
- Code for maps HOT 3
- CFR estimates HOT 1
- Population for surveys HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from surveys.