From: William Valdar <valdar_at_well.ox.ac.uk>

Date: Tue 17 May 2005 - 21:40:37 EST

# ...works fine also

1: lme(response ~ 1, data = data.df, random = list(batch = pdSymm(value = batch.mat,

https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue May 17 21:45:33 2005

Date: Tue 17 May 2005 - 21:40:37 EST

Consider the following simple and self-contained example:

# make response and batch data

batch.names <- c("A", "B", "C")

data.df <- data.frame(

response = rnorm(100), batch = factor(sample(batch.names, 100, replace=T)) )

# make covariance matrix for batch

batch.mat <- matrix(c(1,.5,.2, .5, 1, .3, .2, .3, 1), ncol=3)
colnames(batch.mat) <- batch.names

rownames(batch.mat) <- batch.names

# fit batch as a simple random intercept

lme(response ~ 1, data=data.df, random=~1|batch)

# ...works fine

# do the same using pdSymm notation

lme(response ~ 1, data=data.df,

random=list( batch=pdSymm(form=~1) ) )

# ...works fine also

# specify cov structure using value arg

lme(response ~ 1, data=data.df,

random=list( batch=pdSymm( value=batch.mat, form=~1, nam=batch.names) ) )

# throws error below

---snip---

Error in "Names<-.pdMat"(`*tmp*`, value = "(Intercept)") :

Length of names should be 3

> traceback()

7: stop(paste("Length of names should be", length(dn))) 6: "Names<-.pdMat"(`*tmp*`, value = "(Intercept)") 5: "Names<-"(`*tmp*`, value = "(Intercept)") 4: "Names<-.reStruct"(`*tmp*`, value = list(batch = "(Intercept)")) 3: "Names<-"(`*tmp*`, value = list(batch = "(Intercept)")) 2: lme.formula(response ~ 1, data = data.df, random = list(batch = pdSymm(value = batch.mat, form = ~1, nam = batch.names)))

1: lme(response ~ 1, data = data.df, random = list(batch = pdSymm(value = batch.mat,

form = ~1, nam = batch.names)))

---snip---

The length of batch.names is 3, so I find this error enigmatic. Note that I had to specify all three of value, form and nam otherwise I got missing args errors. Also note that doing

pdSymm(value=batch.mat, form=~1, nam=batch.names)

Can anybody show me what I should be doing instead? Some successful code will greatly clarify the issue. (My version details are below). Also, I notice the pdMat scheme is absent from lme() in lme4. Is this functionality deprecated in lme4 and excluded from lmer?

Many thanks,

William

Version details: running R 2.1.0 on windows XP, using nlme 3.1-57.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Dr William Valdar ++44 (0)1865 287 717 Wellcome Trust Centre valdar@well.ox.ac.uk for Human Genetics, Oxford www.well.ox.ac.uk/~valdar ______________________________________________R-help@stat.math.ethz.ch mailing list

https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue May 17 21:45:33 2005

*
This archive was generated by hypermail 2.1.8
: Fri 03 Mar 2006 - 03:31:47 EST
*