Learn R Programming

tidycensus (version 1.6.7)

moe_sum: Calculate the margin of error for a derived sum

Description

Generates a margin of error for a derived sum. The function requires a vector of margins of error involved in a sum calculation, and optionally a vector of estimates associated with the margins of error. If the associated estimates are not specified, the user risks inflating the derived margin of error in the event of multiple zero estimates. It is recommended to inspect your data for multiple zero estimates before using this function and setting the inputs accordingly.

Usage

moe_sum(moe, estimate = NULL, na.rm = FALSE)

Value

A margin of error for a derived sum

Arguments

moe

A vector of margins of error involved in the sum calculation

estimate

A vector of estimates, the same length as moe, associated with the margins of error

na.rm

A logical value indicating whether missing values (including NaN) should be removed

See Also