estimatr icon indicating copy to clipboard operation
estimatr copied to clipboard

lh_robust does not work with multiple outcomes

Open lukesonnet opened this issue 6 years ago • 6 comments

lho <- lh_robust(cbind(mpg, am) ~ cyl + gear, data = mtcars, linear_hypothesis = c("cyl = 2", "cyl = gear")) Output:

Error in constants(lhs, cnames_symb) : 
  The hypothesis "cyl = 2" is not well formed: contains bad coefficient/variable names.
In addition: Warning message:
In constants(lhs, cnames_symb) : NAs introduced by coercion

lukesonnet avatar Mar 05 '19 05:03 lukesonnet

car has a seperate method for mlm, you might be able to get this working by fiddling with the classes of the output object that lm_robust is producing.

On Mon, Mar 4, 2019 at 9:05 PM Luke Sonnet [email protected] wrote:

lho <- lh_robust(cbind(mpg, am) ~ cyl + gear, data = mtcars, linear_hypothesis = c("cyl = 2", "cyl = gear")) Output:

Error in constants(lhs, cnames_symb) : The hypothesis "cyl = 2" is not well formed: contains bad coefficient/variable names. In addition: Warning message: In constants(lhs, cnames_symb) : NAs introduced by coercion

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/DeclareDesign/estimatr/issues/297, or mute the thread https://github.com/notifications/unsubscribe-auth/AAZjTgYlKgv3oU5QATOAInZKOcIjNB7iks5vTfsmgaJpZM4bdyFZ .

nfultz avatar Mar 05 '19 16:03 nfultz

method for mlm performs tests but doesn't compute variance or expected value of the linear combination of coefficients, so not so sure what would we include in the tidy output.

lilymedina avatar Mar 13 '19 14:03 lilymedina

:(

We may be able to decompose an mlm into a list of lm, but that seems a bit painful.

nfultz avatar Mar 13 '19 16:03 nfultz

Any advice here? I don't think we can very easily accommodate this and believe we should explicitly fail to support this with a message, while just returning the usual lm_robust() output.

lukesonnet avatar May 16 '19 18:05 lukesonnet

I think this should be an error that says you have to go outcome by outcome

acoppock avatar May 16 '19 18:05 acoppock

Anyone have any feelings re: error? I think that's also reasonable. I'll implement it as such later today/tomorrow if no other feedback.

lukesonnet avatar May 16 '19 18:05 lukesonnet