Re: [R] car::deltaMethod() fails when a particular combination of categorical variables is not present

2023-10-07 Thread Michael Cohn
Thank you very much, John. This has allowed us to move forward on several fronts and better understand our data. - Michael Cohn On Tue, Sep 26, 2023 at 8:39 AM John Fox wrote: > Dear Michael, > > My previous response was inaccurate: First, linearHypothesis() *is* able > to accommodate aliased

Re: [R] car::deltaMethod() fails when a particular combination of categorical variables is not present

2023-09-26 Thread John Fox
Dear Michael, My previous response was inaccurate: First, linearHypothesis() *is* able to accommodate aliased coefficients by setting the argument singular.ok = TRUE: > linearHypothesis(minimal_model, "bt2 + csent + bt2:csent = 0", + singular.ok=TRUE) Linear hypothesis

Re: [R] car::deltaMethod() fails when a particular combination of categorical variables is not present

2023-09-26 Thread John Fox
Dear Michael, You're testing a linear hypothesis, so there's no need to use the delta method, but the linearHypothesis() function in the car package also fails in your case: > linearHypothesis(minimal_model, "bt2 + csent + bt2:csent = 0") Error in linearHypothesis.lm(minimal_model, "bt2 +

[R] car::deltaMethod() fails when a particular combination of categorical variables is not present

2023-09-26 Thread Michael Cohn
I'm running a linear regression with two categorical predictors and their interaction. One combination of levels does not occur in the data, and as expected, no parameter is estimated for it. I now want to significance test a particular combination of levels that does occur in the data (ie, I want