This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple function to determine optimum sample size for a survey. | |
# A lot of websites provide online calculators, but here is the code so you can do it yourself in R. | |
# Source: | |
# Krejcie, Robert V., and Daryle W. Morgan. "Determining sample size for research activities." | |
# Educational and psychological measurement 30.3 (1970): 607-610. | |
# https://journals.sagepub.com/doi/abs/10.1177/001316447003000308?journalCode=epma | |
# Downloadable PDF: https://home.kku.ac.th/sompong/guest_speaker/KrejcieandMorgan_article.pdf | |
# | |
# The paper provides a table with chi-squared distribution values for 1 degree of freedom. | |
# R function qchisq() generates the right value from a given confidence level, so the table is not needed. |