estimatr icon indicating copy to clipboard operation
estimatr copied to clipboard

lh_robust bug

Open graemeblair opened this issue 5 years ago • 6 comments

From a user:

Since version 0.18.0 (or earlier), I found that the joint hypothesis test is not performed with lh_robust, but it only performs single hypotheses.

In the manual (pp. 24, "Example"), it writes*

# The linear hypothesis argument can be specified equivalently as: 
lh_robust(y ~ x + z, data = dat, linear_hypothesis = "z = 2x") 
lh_robust(y ~ x + z, data = dat, linear_hypothesis = c("z = 1", "x = 2")) 

but actually they perform different hypothesis tests. The former is the test of z = 2x, but the latter only performs the t-test of z = 1 and x = 2, respectively, but not the joint test of z = 1 AND x = 2. 

In the car::linearHypothesis function, the same specification performs the joint test and returns the result of F-test. 
 
I think that lh_robust used to returns the same result as linearHypothesis. (probably version 0.16.0)

graemeblair avatar Sep 05 '19 21:09 graemeblair

This is not a bug. What should happen here is glance(lh_robust(.)) should report the F test. Switching to a feature request.

graemeblair avatar Sep 06 '19 01:09 graemeblair

So the idea is to have glance report joint specification f tests when we are glancing a lh_robust object?

lukesonnet avatar Sep 06 '19 20:09 lukesonnet

Exactly

graemeblair avatar Sep 06 '19 20:09 graemeblair

But these are different tests? I'm not sure how these are testing the same thing. I think our help is wrong. We can still add this feature to glance, but the example isn't true, right?

lukesonnet avatar Sep 06 '19 20:09 lukesonnet

Exactly, we should just add to glance but not based on the example

graemeblair avatar Sep 06 '19 21:09 graemeblair

Argh we should have removed this example before 0.20.0. They aren't the same.

lukesonnet avatar Sep 12 '19 16:09 lukesonnet