Hi.
Here is a method to specify the var-cov matrix of the random effects
(suggested to me by Jose Pinheiro a while back):
##var-cov matrix for rand intercept and one rand slope
myfixedcov<-matrix(c(.09,-.01,-.01,.0075),2,2)
##Estimate the model specifying the form of the var-cov in pdSymm, and
##but not iterating, but only returning estimates that coincide with
#my choice of cov matrix.
themodel<-lme(Y~X+Z, data=thedata,
random=list(group = pdSymm(myfixedcov,form=~X)),
control=list(msMaxIter=0,niterEM=0))
##Check to see how close the resulting cov matrix is to myfixedcov.
(themodel$sigma^2) * pdMatrix(themodel$modelStruct$reStruct[[1]])
##Probably not exactly the same so:
##Repeat the estimation process, each time reweighting the cov matrix
##of random effects by sigma^2.
niter<-10
for(i in 1:10){
themodel<-update(themodel,
random=list(CD=pdSymm(myfixedcov/themodel$sigma^2,
form=~X)))
}
##Check again: Probably much closer.
(themodel$sigma^2) * pdMatrix(themodel$modelStruct$reStruct[[1]])
You could add some kind of convergence criterion inside the loop so
that you don't have to choose a specific number of iterations.
I hope this helps.
Best,
Jake
-----
Jake Bowers
Dept of Political Science
University of Michigan
On Thu, 17 Apr 2003, Naomi Altman wrote:
> "is there a way to set either the within group error to a specific, fixed
> value that does not change during the optimization (0 is one possibility
> but other values as well) or to set arbitrary elements of the between
> groups random effect covariance matrix to specific, fixed values."
>
> I asked this question a while back and the author says no.
>
> --Naomi Altman
>
>
> At 10:48 AM 4/17/2003 -0700, Mike Stoolmiller wrote:
> >I have some questions for the lme experts out there. First, in a two
> >level model for example, is there a way to set either the within group
> >error to a specific, fixed value that does not change during the
> >optimization (0 is one possibility but other values as well) or to set
> >arbitrary elements of the between groups random effect covariance matrix
> >to specific, fixed values. Second, is there a way to estimate models that
> >have no between group random effects but only the within group random
> >effects? Any help would be greatly appreciated.
> >Mike Stoolmiller
> >
> >"Darkness cannot drive out darkness, only light can do that. Hate cannot
> >drive out hate, only love can do that."
> >Dr. Martin Luther King, Jr.
> >
> >
> >--------------------------------------------------------------------
> >This message was distributed by s-news@lists.biostat.wustl.edu. To
> >unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
> >the BODY of the message: unsubscribe s-news
>
> Naomi S. Altman 814-865-3791 (voice)
> Associate Professor
> Dept. of Statistics 814-863-7114 (fax)
> Penn State University 814-865-1348 (Statistics)
> University Park, PA 16802-2111
>
>
> --------------------------------------------------------------------
> This message was distributed by s-news@lists.biostat.wustl.edu. To
> unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
> the BODY of the message: unsubscribe s-news
>
|