error_me: Calculate Margin of Error at given confidence level

Description Usage Arguments References See Also Examples

View source: R/errors.R

Description

This is particularly useful for constructing confidence intervals.

Usage

1
error_me(std_error, confidence = 0.95)

Arguments

std_error

numeric: Estimated standard error

confidence

numeric: Confidence level (0 < confidence < 1). This default is approximately equal to std_error * 1.96

References

http://en.wikipedia.org/wiki/Margin_of_error

See Also

Other functions for estimating sampling error: error_se_mean(), error_se_prop()

Examples

1
2
3
4
5
6
7
8
9
# maximum margin of error (proportion) for N=100: 9.8%
std_error <- error_se_prop(0.5, 100)
error_me(std_error)

# margin of error for mean
x <- rlnorm(50, 3)
summary(x)
std_error <- error_se_mean(x)
error_me(std_error)

southwick-associates/sastats documentation built on March 27, 2020, 9:39 p.m.