ff_se_ratio | R Documentation |
This function calculates the standard error for derived ratios. An example of a ratio is the median income of males divided by the median income of females. If the data is a proportion instead of a ratio, use 'ff_se_prop'.
ff_se_ratio(estimate_num, estimate_den, se_num, se_den)
estimate_num |
The numerator for the estimated proportion |
estimate_den |
The denominator for the estimated proprotion |
se_num |
Standard error for the numerator of the derived proportions. |
se_den |
Standard error for the denominator of the derived proportions |
Reference for calculations: US Census Bureau, A Compass for Understanding and Using ACS Data, October 2008, A-15
The standard error of the derived ratios.
df <- data.frame(estimate_numerator = rnorm(n = 10, mean = 2000, sd = 500), estimate_denominator = rnorm(n = 10, mean = 10000, sd = 2000), se_numerator = rnorm(n = 10, mean = 200, sd = 50), se_denominator = rnorm(n = 10, mean = 100, sd = 10)) # calculate standard errors of proportions for each observation ff_se_ratio(df$estimate_numerator, df$estimate_denominator, df$se_numerator, df$se_denominator) # add columns to dataframe showing proportions and standard errors of proportions dplyr::mutate(df, ratio = estimate_numerator / estimate_denominator, se_ratio = ff_se_ratio(estimate_numerator, estimate_denominator, se_numerator, se_denominator))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.