[R] Problem with Anova() in package "car"

Gang Chen gangchen6 at gmail.com
Tue Jan 13 23:44:19 CET 2015


Dear John,

Thanks a lot for the quick response and fix! I'm looking forward to
try out the development version. I assume that the fix will be
released in the official version at some point.

Thanks again,
Gang

On Tue, Jan 13, 2015 at 5:06 PM, John Fox <jfox at mcmaster.ca> wrote:
> Dear Gang,
>
> The problem was in the model.matrix.lme() method provided by the car
> package, and is now fixed in the development version of the car package on
> R-Forge. You should be able to install it from there via
> install.packages("car", repos="http://R-Forge.R-project.org") after the
> package is next built on R-Forge, usually in a day or so.
>
> Best,
>  John
>
>> -----Original Message-----
>> From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Gang Chen
>> Sent: January-13-15 1:48 PM
>> To: r-help
>> Subject: [R] Problem with Anova() in package "car"
>>
>> I'm having some trouble with Anova() in package "car". When the model
>> formula is explicitly expressed:
>>
>> library('nlme')
>> library('car')
>> fm <- lme(distance ~ age + Sex, data = Orthodont, random = ~ 1)
>>
>> Anova() works fine:
>>
>> Anova(fm)
>>
>> However, if the model formula is scanned from an external source:
>>
>> myModel <- as.formula("distance ~ age + Sex")
>> fm2 <- lme(myModel, data = Orthodont, random = ~ 1)
>>
>> I get the following error:
>>
>> Anova(fm2)
>> Error: object of type 'symbol' is not subsettable
>>
>> How to resolve the situation when the model formula is defined externally?
>>
>> Thanks,
>> Gang
>>
>> ______________________________________________
>> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-
>> guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> http://www.avast.com
>



More information about the R-help mailing list