Search code examples
rspatstat

Standard error of log relative risk in spatstat


My objective is to present the variation for a spatial relative risk. The relrisk function in the spatstat package has the option to compute the standard error of relative risk with the se argument. Relative risks are commonly expressed logarithmically and while the estimate from the relrisk function output can be transformed, the SE cannot.

For example, for a relative risk:

f1 <- spatstat::relrisk(spatstat.data::chorley, relative = TRUE, se = TRUE)
plot(f1$estimate); plot(f1$SE)

But, for a log relative risk, the standard errors cannot be transformed in a similar manner as the relative risk estimate.

plot(log(f1$estimate))

Can someone suggest a computational solution? Or would it be possible to add this feature to the relrisk function, perhaps as a logical argument log to estimate log relative risk and its standard error? Thank you!


Solution

  • Using the delta method, the standard error of log(R) is approximately se(R)/R, that is, the standard error of R divided by the estimate of R. So the quickest solution is

    plot(with(f1, se/estimate))