Thanks to Jose Pinheiro, Douglas Bates and coworkes for providing R with the nlme package.
Could someone help me, please, to specify a correct random formula for a
mixed model, that specifies no random effect on a higher level?
I have the following dataset of timeseries of respiration measurements
(column resp) of biomass including a parameter initial biomass x0. Respiration
measurements have been recorded in several experiments, each consisting
of several replicates.
groupedData( resp ~ time | experiment/replicate, data=rd)
Time is the first level at the same level as the dependent variable
resp, replicate is the second level, experiment the third. (In future
suite will be used as another level. For simplicity here, I first try
with data of only one suite)
I want to fit a mixed model to the data which includes random effects on
the replicate level but no random effects on the experiment level. The
random effects should have a distribution around 0 within each experiment.
I succeded to include random effects on both levels.
random=list( experiment=x0~1, replicate=x0~1 )
I succeded also to fit a model to only replicate level:
# replicate 1 in experiment i has nothing to do with replicate 1 in
rd$exprep <- paste( rd$experiment, rd$replicate, sep="_")
random=list( exprep=x0~1 )
However, this gives a single distribution across all replicates of all
Instead, I want to have a distribution of random effects across only
replicates of an experiment with mean zero for each experiment
I tried amongst others the following syntax without success:
random=list( experiment=~1, exprep=x0~1 )
random=list( experiment=1~1, exprep=x0~1 )
random=list( experiment=NULL, exprep=x0~1 )
I am using nlme version 3.1-86 on R 2.6.1 on Windows XP.
Is it possible to fit such a model with nlme?
What is the correct syntax?
Do I need the exprep- variable or is it clear with the grouping that
replicate=1 in experiment=1 is different from replicate=1 in other