I am trying to do something that seems very simple yet I cannot find any good advice out there. I would like to get the confidence interval for the non-linear combination of two coefficients in a regression model. I cam use linearHypothesis()
to conduct an F-test and get the p-value for a linear combination. The code I ran for that part is:
reg4 <- lm(bpsys ~ current_tobac + male + wtlb + age, data=NAMCS2010)
linearHypothesis(reg4, "current_tobac + male = 0")
I can use glht()
from the multcomp package to get the confidence interval for a linear combination of parameters:
confcm <- summary(glht(reg4, linfct = c("current_tobac + male = 0")))
confint(confcm)
But I'm not sure what to do for a non-linear combination like (summary(reg4)$coefficients[2])/ (summary(reg4)$coefficients[4])
Any advice?