1

Is it possible to do a simultaneous F-test, likelihood ratio test or Wald test with the marginaleffects::hypotheses function? I'm looking for similar behavior as car::linearHypothesis and multcomp:glht. Minimal example:

library(multcomp)
library(car)

lmfit <- lm(mpg~as.factor(cyl)*hp, data=mtcars)
car::linearHypothesis(lmfit, c("as.factor(cyl)6:hp", "as.factor(cyl)8:hp"), test = "F")
car::linearHypothesis(lmfit, c("as.factor(cyl)6:hp", "as.factor(cyl)8:hp"), test = "Chisq")
summary(multcomp::glht(lmfit, c("`as.factor(cyl)6:hp` = 0", "`as.factor(cyl)8:hp` = 0")), test = Ftest())
summary(multcomp::glht(lmfit, c("`as.factor(cyl)6:hp` = 0", "`as.factor(cyl)8:hp` = 0")), test = Chisqtest())
Stefan Hansen
  • 499
  • 1
  • 3
  • 16
  • Sorry, this is not currently possible with this function. – Vincent Apr 30 '23 at 11:49
  • @Vincent: Thanks for the reply. Is it something you would consider implementing? Or is it out of the scope of your package? – Stefan Hansen Apr 30 '23 at 13:54
  • 1
    I don't want to make too many promises about implementation or timeline, but I would certainly consider it. Feel free to open a feature request on Github, ideally with both a specific mathematical description of the quantity of interest and a reference software implementation. – Vincent Apr 30 '23 at 16:44

0 Answers0