I have a data set with a dependent variable "*met*" that has been measured
on several occasions (days).
My interest is in knowing if met depends on the treatment (*treat*).
Met is measured on 16 randomly selected samples (*a:p*) of which 8 have
been treated (levels* c* and *uc*).
Basically, across days, the levels of *met* shift up and down due to
differences in weather conditions during the day so i wish to use
*date*(the occasion on which we measured) as a random effect.
This is however a second random effect as *ID* would also constitute a
random effect.

The data set looks as follows:

ID    <- factor(rep(c("a", "b", "c", "d", "e", "f", "g", "h", "i", "j",
"k", "l", "m", "n", "o", "p"), 2))
treat  <- factor(rep(c(rep("c",8), rep("uc",8)), 2))
date   <- factor(rep(c(rep("10/12/2007",16), rep("11/12/2007",16)), 1))
met    <- c(rnorm(8,5,2),rnorm(8,7,2),rnorm(8,15,2),rnorm(8,17,2))
(dataframe  <-  data.frame(ID, treat, date, met))

In lme4 the coding is rather straigh forward:

library(lme4)
lmer.000  <-  lmer(met ~ treat + (1|date) + (1|ID), data = dataframe)

In nlme i have however some difficulties in defining the same model with
non nested random effects
I came to the following:

library(nlme)
lme.000  <-  lme(met ~ treat,
                 data = dataframe,
                 random = pdBlocked(list(pdIdent(~ date - 1), pdIdent(~ ID
- 1))),
                 method = "REML",
                 na.action = na.omit)

This does however result in the following error message:
Error in getGroups.data.frame(dataMix, groups) : invalid formula for groups

Who could help me out here?
Many thanks in advance,

Thijs

	[[alternative HTML version deleted]]

