delta method using numerical derivative. An example
The main conclusions are : - Use delta method with or without analytic derivative, it does not change anything - Do not use simple resampling using SD - You can use resampling taking into variance-covariance matrix library(car) m1 <- lm(time ~ t1 + t2, data = Transact) result <- deltaMethod(coef(m1), "t1/t2", vcov.=vcov(m1)) rownames(result) <- "Delta method, analytic derivative" library("nlWaldTest") r <- nlConfint(obj = NULL, texts="b[2]/b[3]", level = 0.95, coeff = coef(m1), Vcov = vcov(m1), df2 = TRUE, x = NULL) result <- rbind(result, t(as.data.frame(c(Estimate=r[, 1], SE=NA, '2.5 %'=r[, 2], '97.5 %'=r[, 3])))) rownames(result)[2] <- "Delta method, analytic derivative in nlWaldTest" ############# Now numerical derivative is used. The result is the same. try_g <- function(...) { par <- list(...) return(par[[1]]/par[[2]]) } r <- nlConfint2(texts="tr...