[R-sig-ME] Chisq = 0 and p = 1 with nested lmer models

Ben Bolker bbolker at gmail.com
Thu Sep 15 18:52:23 CEST 2011


On 11-09-22 04:43 AM, Joshua Wiley wrote:
> On Fri, Sep 16, 2011 at 3:18 PM, Ben Bolker <bbolker at gmail.com> wrote:
>> Geoff Brookshire <creepingbrain at ...> writes:
>>

> I could be way off mark, but given that most model functions accept
> matrices directly, isn't the easy way something like:
> 
> tmp <- model.matrix(~ hp + factor(am) * factor(vs), data = mtcars)
> summary(lm(mtcars$mpg ~ tmp - 1))
> summary(lm(mpg ~ hp + factor(am) * factor(vs), data = mtcars))
> 
> tmp2 <- tmp[, -3]
> lmer(mpg ~ -1 + tmp2 + (1|cyl), data = mtcars)
> 
> ?
> 
> lmer even seems fine with it.
> 

  Didn't realize lmer took matrices as input.

  Ben




More information about the R-sig-mixed-models mailing list