responserates is a package for calculating survey response rates according to the American Association for Public Opinion Research (AAPOR) Standard Definitions.
The main function of interest is rates()
, which calculates all AAPOR standard response, refusal, cooperation, and contact rates based upon specified disposition codes. Disposition codes can be specified either as a vector of character codes (following AAPOR's standard acronyms):
library("responserates") rates(c(rep("I", 100), rep("NC", 20)))
or as a table or list of totals (codes are not case-sensitive):
rates(list(i = 100, nc = 20))
Calculations are performed assuming equal probability of selection, but this can be modified by specifying a vector of codes and corresponding weights:
set.seed(1) rates(c(rep("I", 100), rep("NC", 20)), w = runif(120))
If some cases have unknown eligibility, a default value for the proportion eligible (e
in the Standard Definitions) is assumed to be 1. This can easily be changed if other values are appropriate:
rates(list(i = 100, nc = 20, uo = 100, e = .25))
The package also exposes functions for calculating each response rate (rr1()
, rr2()
, ref1()
, etc.) based upon counts of disposition codes for a survey. These can be useful, for example, when one is only interested in a particular rate becuase the design is very simple (such as rr1(i = 10, r = 5)
) or when handling complex survey designs. For instance, in a dual-frame survey, the overall response rate needs to average the response rate for each frame:
# landline frame (ll <- rr1(i = 100, r = 400, nc = 300)) # cellphone frame (cp <- rr1(i = 150, r = 300, nc = 200)) # Pr(interviews from ll frame) p <- 100/150 # overall response rate (ll * p) + (cp * (1-p))
This package is not yet on CRAN. To install the latest development version from GitHub:
if(!require("remotes")){ install.packages("remotes") } remotes::install_github("leeper/responserates")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.