Skip to content
Back to formatted view

Raw Message

Message-ID: <CAKFxdiRy5-5Ed0RU_ShftJkpYBddkDbAJn8K7Qp8DrKZd1TDug@mail.gmail.com>
Date: 2022-03-09T22:14:08Z
From: Kevin Wright
Subject: linear mixed model using lmer
In-Reply-To: <306704552.453726.1646440917947@mail.yahoo.com>

I think the best analysis of this data is:

library(lattice)
dotplot(yield ~ batch, daty)
bwplot(yield ~ batch, daty)

There is no detectable difference between batches.

But, if you insist, try removing the overall intercept.

m1 <- lmer(yield~0+(1|batch),daty)
coef(m1)
summary(m1)
VarCorr(m1)



On Fri, Mar 4, 2022 at 6:44 PM array chip via R-help
<r-help at r-project.org> wrote:
>
> Dear all, I have this simple dataset to measure the yeild of a crop collected in 2 batches (attached). when I ran a simple inear mixed model using lmer to estimate within-batch and between-batch variability, the between-batch variability is 0. The run showed that data is singular. Does anyone know why the data is singular and what's the reason for 0 variability? is it because the dataset only has 2 batches?
> > daty<-read.table("datx.txt",sep='\t',header=T,row.names=NULL)
> > library(lme4)> lmer(yield~1+(1|batch),daty)
> boundary (singular) fit: see ?isSingular
> Linear mixed model fit by REML ['lmerMod']
> Formula: yield ~ 1 + (1 | batch)
>    Data: daty
> REML criterion at convergence: 115.6358
> Random effects:
>  Groups   Name        Std.Dev.
>  batch    (Intercept) 0.000
>  Residual             2.789
> Number of obs: 24, groups:  batch, 2
> Fixed Effects:
> (Intercept)
>       5.788
>
> Thanks!
> John______________________________________________
> 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.



-- 
Kevin Wright