Description Usage Arguments Value References Examples
Calculate proportion and margin of error (stratified sample)
1 | spro(fulldf, sampdf, strata, col_name, ci = 95, na = "")
|
fulldf |
object containing original data frame used to draw sample |
sampdf |
object containing data frame on which to perform analysis |
strata |
variable in both data frames by which to stratify |
col_name |
variable in data frame for which you want to calculate proportion and margin of error |
ci |
(optional) confidence level for establishing a confidence interval using z-score (defaults to 95; restricted to 80, 85, 90, 95 or 99 as input) |
na |
(optional) value that you want to filter and exclude (defaults to include everything) |
Returns table of responses (n), proportions, margins of error, lower and upper bounds by factor for a given variable in a stratified sample
[1] Sampling Design & Analysis, S. Lohr, 1999, 4.6 & 4.7
1 |
openTime n midpoint me lower upper
1 7_00 408 78.3676959 3.3312036 75.03649228 81.698900
2 7-730 92 17.6001119 3.0807742 14.51933775 20.680886
3 730-8 17 3.2674097 1.4554306 1.81197911 4.722840
4 8-830 4 0.7647825 0.7085333 0.05624911 1.473316
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.