[R] glmmPQL

Spencer Graves spencer.graves at pdf.com
Wed Nov 30 12:03:22 CET 2005


	  1.  Did you try "anova(f1)"?  The documentation for "glmmPQL" says it 
produces an object of class lme, and "anova.glm" might not work properly 
for it.  Also, did you try "summary(f1)", as suggested in the example in 
"?glmmPQL"?

	  2.  Have you considered using "lmer" in the "lme4" package?  As far 
as I know, this is the most up-to-date and state-of-the art function for 
this kind of analysis.  For documentation on "lmer", I'd start with Doug 
Bates, "Fitting linear mixed models in R", R News, 5(1):  27-30, May 
2005, and "Linear mixed model implementation in lmer", July 26, 2005, 
distributed with lme4 and stored on my hard drive under 
"~\R\R-2.2.0\library\lme4\doc\Implementation.pdf".  I might also consult 
Pinheiro and Bates (2000) Mixed-Effects Models in S and S-PLUS 
(Springer), which is my primary source for mixed models generally.

	  3.  If you'd like more help with this, I suggest you PLEASE do read 
the posting guide! "www.R-project.org/posting-guide.html", especially 
the bit about supplying a simple, reproducible example that someone like 
me can copy from your email into R to see if they get the same error 
message.  I and others are much more likely to have the time to test a 
simple, self-contained example than to try to replicate your problem 
from scratch.

	  hope this helps.
	  spencer graves

jmgreyes at ugr.es wrote:

> Hi,
> 
> My name is José María Gómez, and I am pretty new in R. Thus, I apologize
> deeply if my questions are extremmely naïve.I have checked several
> available books and URL's, without finding any answer.
> 
> I'm trying to fit Generalized Linear Mixed Models via PQL. Below I provide
> the structure of my data set. Year and Plot are random variables. Fate is
> the binomial dependent. I have severe problems after calling glmmPQL:
> 
> 1) I would like to nest Plot within Year, but I don't know how to argument
> it.
> 
> 2) I'm not sure the analysis I fit (see below) is actually considering
> Year and Plot as random.
> 
> 3) No way to obtain an analysis of deviance for the GLMM fit.
> 
> 4) Year appears without degrees of freedom.
> 
> As you see, too many problems. Thank you very much for any help.
> JM
> _____________________________________________
> 
> 
>>summary (Ifate)
> 
>  Year    Plot        Fate         Hab           Peso             Dist
>  A:664   A:359   cache :  91   Oak  :621   Min.   :0.1903   Min.   :1.362
>  B:574   B:427   comida:1147   Open : 94   1st Qu.:0.5515   1st Qu.:1.847
>          C:135                 Pine :159   Median :0.6670   Median :2.137
>          D: 97                 Rock : 23   Mean   :0.6674   Mean   :2.200
>          E:220                 Shrub:341   3rd Qu.:0.7597   3rd Qu.:2.476
>                                            Max.   :1.1386   Max.   :3.872
> 
>>library (MASS)
>>library (nlme)
>>f1<-glmmPQL(Fate~Year+Plot+Hab+Peso+Dist, random=~1|Year/Plot,
> 
> family=binomial, data=Ifate)
> 
> 
>>anova.glm(f1)
> 
> Error in eval(expr, envir, enclos) : Object "Fate" not found
> 
> 
>>anova(f1)
> 
>             numDF denDF   F-value p-value
> (Intercept)     1  1223 124.10634  <.0001
> Year            1     0   0.00271     NaN
> Plot            4     3   0.96230  0.5343
> Hab             4  1223   6.03162  0.0001
> Peso            1  1223   4.34225  0.0374
> Dist            1  1223   5.97248  0.0147
> Warning messages:
> 1: NaNs produced in: pf(q, df1, df2, lower.tail, log.p)
> 2: NAs introduced by coercion
> 
> ______________________________________________
> 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

-- 
Spencer Graves, PhD
Senior Development Engineer
PDF Solutions, Inc.
333 West San Carlos Street Suite 700
San Jose, CA 95110, USA

spencer.graves at pdf.com
www.pdf.com <http://www.pdf.com>
Tel:  408-938-4420
Fax: 408-280-7915




More information about the R-help mailing list