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

mirre simons mirresimons at gmail.com
Wed Oct 15 11:07:34 CEST 2008


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



More information about the R-help mailing list