[R] question on multilevel modeling

Chuck Cleland ccleland at optonline.net
Tue Nov 7 11:00:22 CET 2006


Christoph Buser wrote:
> Dear Christine
> 
> I think the problem in your second model is that you are
> including "CORUMTO" both as a fixed effect and as a random
> effect. 

  That by itself should not be a problem.  Here is an example in which
age appears in both the fixed and random part of a model:

> fm1 <- lme(distance ~ age, random = ~ age | Subject, data = Orthodont)

> fm1
Linear mixed-effects model fit by REML
  Data: Orthodont
  Log-restricted-likelihood: -221.3183
  Fixed: distance ~ age
(Intercept)         age
 16.7611111   0.6601852

Random effects:
 Formula: ~age | Subject
 Structure: General positive-definite, Log-Cholesky parametrization
            StdDev    Corr
(Intercept) 2.3270340 (Intr)
age         0.2264278 -0.609
Residual    1.3100397

Number of Observations: 108
Number of Groups: 27

  I think it's actually quite common to have the same variable appear in
the fixed and random parts of a model.
  Christine, to better understand what's happening it would be useful to
know a bit more about what BDIAFTER, BDI, WEEK, and CORUMTO are and see
the model summaries.  The fact that the error message depends on the
specific variables in the model may mean that one of the variables is a
linear combination of other variables.

> Regards,
> 
> Christoph 
> 
> --------------------------------------------------------------
> 
> Credit and Surety PML study: visit our web page www.cs-pml.org
> 
> --------------------------------------------------------------
> Christoph Buser <buser at stat.math.ethz.ch>
> Seminar fuer Statistik, LEO C13
> ETH Zurich	8092 Zurich	 SWITZERLAND
> phone: x-41-44-632-4673		fax: 632-1228
> http://stat.ethz.ch/~buser/
> --------------------------------------------------------------
> 
> 
> Christine A. Calmes writes:
>  > Hi,
>  >  
>  > I am trying to run a multilevel model with time nested in people and
>  > people nested in dyads (3 levels of nesting) by initially running a
>  > series of models to test whether the slope/intercept should be fixed or
>  > random.  The problem that I am experiencing appears to arise between the
>  > random intercept, fixed slope equation AND.
>  >  
>  > (syntax:
>  > rint<-lme(BDIAFTER~BDI+WEEK+CORUMTO, random=~1|DYADID/PARTICIP,
>  > data=new) 
>  > summary(rint))
>  >  
>  > the random slope, random intercept model 
>  >  
>  > (syntax: 
>  > rslint<-lme(BDIAFTER~BDI+WEEK+CORUMTO, random=~CORUMTO|DYADID/PARTICIP,
>  > data=new) 
>  > summary(rslint))
>  >  
>  > at which point I obtain the exact same results for each model suggesting
>  > that one of the model is not properly specifying the slope or intercept.
>  >  
>  > Or, I receive the following error message when I try to run the random
>  > slope/random intercept model.
>  >  
>  > Error in solve.default(pdMatrix(a, fact = TRUE)) : 
>  >         system is computationally singular: reciprocal condition number
>  > = 6.77073e-017
>  >  
>  > (whether I receive an error message or the same results depends on the
>  > specific variables in the model).
>  >  
>  > It has been suggested that I may need to change the default starting
>  > values in the model because I may be approaching a boundary-is this a
>  > plausible explanation for my difficulties?  If so, how do I do this in R
>  > and can you refer me to a source that might highlight what would be
>  > reasonable starting values?
>  > If this does not seem like the problem, any idea what the problem may be
>  > and how I might fix it?
>  >  
>  > Thank you so much for your assistance,
>  > Christine Calmes
>  >  
>  >  
>  > Christine A. Calmes, MA
>  > Dept of Psychology
>  > University at Buffalo: The State University of New York
>  > Park Hall 216
>  > Buffalo, NY 14260
>  > ccalmes at buffalo.edu
>  > (716) 645-3650 x578
>  >  
>  > 
>  > 	[[alternative HTML version deleted]]
>  > 
>  > ______________________________________________
>  > R-help at 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
>  > and provide commented, minimal, self-contained, reproducible code.
> 
> ______________________________________________
> R-help at 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
> and provide commented, minimal, self-contained, reproducible code.
> 

-- 
Chuck Cleland, Ph.D.
NDRI, Inc.
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 512-0171 (M, W, F)
fax: (917) 438-0894



More information about the R-help mailing list