[R] LME gives estimates with a random factor that has one 1datapoint per group

Bert Gunter gunter.berton at gene.com
Wed Oct 15 20:26:42 CEST 2008


Surely you jest! You need to consult your local statistician.

-- Bert Gunter

-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On
Behalf Of mirre simons
Sent: Wednesday, October 15, 2008 2:08 AM
To: r-help at r-project.org
Subject: [R] LME gives estimates with a random factor that has one
1datapoint per group

Dear all,

I have been fitting models to do meta-analysis in R. This includes a
mixed effect model with a weighting function. This weighting function
is the sample size and the random factor is study or species for
instance (Nakagawa 2007). I have tried this method and I find some
strange things. I can fit a model that has a random factor that has
only one data point per group and this influences the effect the
weight function has on the intercept. I do not get how this works
because with one datapoint there is no within group variance. Please
see the code below. I really appriciate if someone could explain me
what happens, because I want to use this method to do some
meta-analyses.

Mirre
Univ. of Groningen
The Netherlands

library(nlme)
rm(list=ls())
Status<-read.csv("Status2.csv",header=T)
attach(Status)
str(Status)
model1<-glm(ES~1)
model2<-lme(ES~1,random=~1|ID)
model3<-gls(ES~1,weights=varFixed(~(Size)))
model4<-lme(ES~1,random=~1|ID, weights=varFixed(~(Size)))
summary(model1)
summary(model2)
summary(model3)
summary(model4)

The data file is:
ID,ES,Size
1,0.53,25
2,0.57,13
3,0.52,10
4,0.89,14
5,0.32,9
6,0.04,6
7,0.33,11
8,0.54,9
9,0.33,9
10,0.88,10
11,0.483,19
12,0.488,41
13,0.147,20
14,0.37,22
15,0.1,28

______________________________________________
R-help at r-project.org mailing list
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.



More information about the R-help mailing list