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))

Arguments

x

An estimate

se

Standard error of x

method

The "delta" method uses a Taylor series approximation; the default method, "mc", uses a simple monte carlo method.

nsim

Number of draws to take if method = "mc".

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. c(lower, upper) as in default bounds = c(0, Inf).

Value

Numeric vector of standard errors

Details

The delta method returns x^(-1) * se. The monte carlo method is detailed in the examples section.

Examples

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")