[R] How to specify Variance Covariance matrix of residuals?

dan metes danmetes at hotmail.com
Mon Mar 19 05:54:23 CET 2007


       Hi guys! I have a problem regarding a binary logistic hierarchical 
model I am trying to use. The model contains various covariates that depend 
on the location the response was measured at but do not depend on time 
(year). I also have a spatial covariate that depends both on location and 
time. I have been trying to use the lme4 pack but the package only allows me 
to model variance covariance information for random effects. What I am 
interested in is to actually specify a variance covariance matrix of the 
residuals within year that would describe the unexplained spatial dependence 
of the errors within each year. I had a look at the nmle pack in Splus and 
it appears that the nmle function in that package is able to describe such a 
var-covar matrix via the var.function option. So I was wondering if lmer can 
do that in R.
       I also looked at the MCMCpack in R since I might decide to actually 
use Bayesian modeling when using my hierarchical model. From what I saw 
logistic regression can be dealth with using this package but I'm not sure 
if hierarchies can be specified, or if residuals can be given a variance 
covariance structure.
       I included my model below: (l - location index, t-time index)

                     Y[l,t] | p[l,t] ~ Bernoulli (p[l,t])

    logit( p[l,t] | SpTimeCov, X1,...,Xp) = B0 + B1*X1[l]...+ Bp*Xp[l] + 
A*SpTimeCov[l,t] + Err[l,t]

                     Err[1:L,t] ~ MVN(0, V)

            where V is an L*L variance covariance matrix of the residuals 
that I have to specify.

        I would really appreciate if you guys had any suggestions as to what 
package I should use in R (since I don't really have access to Splus) and if 
I can use the MCMC pack later on if I decide to modify my model so that I 
can use Bayesian methodology together with the residual structure in the 
above model. Thank you very much!


Sincerely,
Dan Metes
University of Alberta.



More information about the R-help mailing list