Anova() in car not works after loading piecewiseSEM package
Jinsong Zhao <[email protected]> Sun, 19 Jul 2026 09:06:21 +0800
| Newsgroups | gmane.comp.lang.r.general |
|---|---|
| Message-ID | <[email protected]> |
Hi there, In the code below, you may notice that the Anova() function from the *car*package does not behave as expected after loading the piecewiseSEMpackage. I haven't been able to identify the cause of this issue or find a working solution. Any suggestions or insights would be greatly appreciated. Best, Jinsong > library(nlme) > fm2 <- lme(distance ~ age + Sex, data = Orthodont, random = ~ 1) > library(car) Loading required package: carData > Anova(fm2) Analysis of Deviance Table (Type II tests) Response: distance Chisq Df Pr(>Chisq) age 114.8383 1 < 2.2e-16 *** Sex 9.2921 1 0.002301 ** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > library(piecewiseSEM) Registered S3 method overwritten by 'lme4': method from na.action.merMod car This is piecewiseSEM version 2.3.0.2. Questions or bugs can be addressed to <[email protected]>. > Anova(fm2) Error in if (random) { : the condition has length > 1 [[alternative HTML version deleted]]