0

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?

  • What exactly are you trying to get a confidence interval for? The sum of the regression weights? Why? – Richard Border Feb 11 '18 at 03:06
  • To look at the confidence interval for the joint effect of two variables (current_tobac and male in this case). I can get the confidence intervals for the each coefficient individually, but I'm concerned about the joint. – Christian Conroy Feb 11 '18 at 05:52
  • What is the "joint effect"? There is a joint test of the null hypothesis that both regression slopes equal zero. There is the variance accounted for by including both variables compared to neither. But there is no slope associated with two parameters... – Richard Border Feb 12 '18 at 15:47
  • I ended up figuring it out. There can indeed be a slope associated with two parameters as I understand it. Apologies if any part of the language of the question was unclear. The code I ended up using is below: `linearHypothesis(reg4, "current_tobac + male = 0") confcm <- summary(glht(reg4, linfct = c("current_tobac + male = 0")))` – Christian Conroy Feb 14 '18 at 20:49

0 Answers0