View source: R/convenience-functions.R
se_log | R Documentation |
Transform the standard error of x
to standard error of log(x)
.
se_log(x, se, method = c("mc", "delta"), nsim = 5000, bounds = c(0, Inf))
x |
An estimate |
se |
Standard error of |
method |
The |
nsim |
Number of draws to take if |
bounds |
Lower and upper bounds for the variable, used in the monte carlo method. Must be a length-two numeric vector with lower bound greater than or equal to zero (i.e. |
The delta method returns x^(-1) * se
. The monte carlo method is detailed in the examples section.
Numeric vector of standard errors
data(georgia)
x = georgia$college
se = georgia$college.se
lse1 = se_log(x, se)
lse2 = se_log(x, se, method = "delta")
plot(lse1, lse2); abline(0, 1)
# the monte carlo method
x = 10
se = 2
z = rnorm(n = 20e3, mean = x, sd = se)
l.z = log(z)
sd(l.z)
se_log(x, se, method = "mc")
se_log(x, se, method = "delta")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.