[R] lmer and negative binomial family
Dear listers, One of my former students is trying to fit a model of the negative binomial family with lmer. In the past (two years ago), the following call was working well: m1a-lmer(mapos~ninter+saison+milieu*zone+(1|code),family=neg.bin(0.451),REML=TRUE,data=manu) But now (R version 2.9.2 and lme4 version 0.999375-32), that gives (even with the library MASS loaded): m1a-lmer(mapos~ninter+saison+milieu*zone+(1|code),family=neg.bin(0.451),REML=TRUE,data=manu) Error in famType(glmFit$family) : unknown GLM family: 'Negative Binomial' Any idea about what happens ? Patrick [[alternative HTML version deleted]] __ R-help@r-project.org 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] lmer and negative binomial family
Dear listers, One of my former students is trying to fit a model of the negative binomial family with lmer. In the past (two years ago), the following call was working well: m1a-lmer(mapos~ninter+saison+milieu*zone+(1|code),family=neg.bin(0.451),REML=TRUE,data=manu) But now (R version 2.9.2 and lme4 version 0.999375-32), that gives (even with the library MASS loaded): m1a-lmer(mapos~ninter+saison+milieu*zone+(1|code),family=neg.bin(0.451),REML=TRUE,data=manu) Error in famType(glmFit$family) : unknown GLM family: 'Negative Binomial' Any idea about what happens ? Patrick [[alternative HTML version deleted]] __ R-help@r-project.org 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.
Re: [R] lmer and negative binomial family
Patrick Giraudoux a écrit : Dear listers, One of my former students is trying to fit a model of the negative binomial family with lmer. In the past (two years ago), the following call was working well: m1a-lmer(mapos~ninter+saison+milieu*zone+(1|code),family=neg.bin(0.451),REML=TRUE,data=manu) But now (R version 2.9.2 and lme4 version 0.999375-32), that gives (even with the library MASS loaded): m1a-lmer(mapos~ninter+saison+milieu*zone+(1|code),family=neg.bin(0.451),REML=TRUE,data=manu) Error in famType(glmFit$family) : unknown GLM family: 'Negative Binomial' Any idea about what happens ? Patrick Oups. Sorry to reply to myself, but the answer was here: http://www.nabble.com/What-happen-for-Negative-binomial-link-in-Lmer-fonction--td26013041.html [[alternative HTML version deleted]] __ R-help@r-project.org 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.
Re: [R] lmer and negative binomial family
Patrick, I am not sure about this but (1) I think you need to load the lme4 package, not MASS (2) I don't think neg.bin is allowable. I suggest you load lme4 and then type ?family John John David Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics University of Maryland School of Medicine Division of Gerontology Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1524 (Phone) 410-605-7119 (Fax) 410-605-7913 (Please call phone number above prior to faxing) Patrick Giraudoux patrick.giraud...@univ-fcomte.fr 10/29/2009 8:43 AM Dear listers, One of my former students is trying to fit a model of the negative binomial family with lmer. In the past (two years ago), the following call was working well: m1a-lmer(mapos~ninter+saison+milieu*zone+(1|code),family=neg.bin(0.451),REML=TRUE,data=manu) But now (R version 2.9.2 and lme4 version 0.999375-32), that gives (even with the library MASS loaded): m1a-lmer(mapos~ninter+saison+milieu*zone+(1|code),family=neg.bin(0.451),REML=TRUE,data=manu) Error in famType(glmFit$family) : unknown GLM family: 'Negative Binomial' Any idea about what happens ? Patrick [[alternative HTML version deleted]] __ R-help@r-project.org 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. Confidentiality Statement: This email message, including any attachments, is for th...{{dropped:6}} __ R-help@r-project.org 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.
Re: [R] lmer and negative binomial family
John Sorkin wrote: Patrick, I am not sure about this but (1) I think you need to load the lme4 package, not MASS (2) I don't think neg.bin is allowable. I suggest you load lme4 and then type ?family John This conversation would probably go better on r-sig-mixed-mod...@r-project.org ... In the meanwhile -- for a long time (I thought always, but I guess that's not true) the allowable families have been hard-coded within lme4, for purposes of efficiency. The bottom line is that you can only use the following families: famNms - c(binomial, gaussian, Gamma, inverse.gaussian, poisson, quasibinomial, quasipoisson, quasi) 'quasipoisson' might be good, if you're willing to settle for a quasi- answer, although you should be careful with random effects variances -- in earlier versions there are some problems with the scaling there If you really need NB I would suggest glmmADMB ... -- View this message in context: http://www.nabble.com/lmer-and-negative-binomial-family-tp26112313p26115443.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org 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.