Dear friends when I use sd(coef(mymodel)$myvariable) I get 0.21 However, the summary of the model gives Error terms: Groups Name Std.Dev. myvariable (Intercept) 0.33 Residual 0.76 Why dont I get the same value (0.21 instead of 0.33)? Thanks for the help. Dr. Iasonas Lamprianou Department of Education The University of Manchester Oxford Road, Manchester M13 9PL, UK Tel. 0044 161 275 3485 iasonas.lamprianou at manchester.ac.uk
--- On Sat, 20/12/08, r-sig-mixed-models-request at r-project.org <r-sig-mixed-models-request at r-project.org> wrote:
From: r-sig-mixed-models-request at r-project.org <r-sig-mixed-models-request at r-project.org> Subject: R-sig-mixed-models Digest, Vol 24, Issue 28 To: r-sig-mixed-models at r-project.org Date: Saturday, 20 December, 2008, 11:00 AM Send R-sig-mixed-models mailing list submissions to r-sig-mixed-models at r-project.org To subscribe or unsubscribe via the World Wide Web, visit
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models or, via email, send a message with subject or body 'help' to r-sig-mixed-models-request at r-project.org You can reach the person managing the list at r-sig-mixed-models-owner at r-project.org When replying, please edit your Subject line so it is more specific than "Re: Contents of R-sig-mixed-models digest..." Today's Topics: 1. Problem updating to newer version of lme4 (Ben Zuckerberg) 2. Re: heteroscedastic model in lme4 (Alan Cobo-Lewis) 3. Re: heteroscedastic model in lme4 (Dimitris Rizopoulos) 4. naive questions about model building and error output (Luciano La Sala) 5. Re: heteroscedastic model in lme4 (Doran, Harold) ---------------------------------------------------------------------- Message: 1 Date: Fri, 19 Dec 2008 12:06:32 -0500 From: Ben Zuckerberg <bz73 at cornell.edu> Subject: [R-sig-ME] Problem updating to newer version of lme4 To: r-sig-mixed-models at r-project.org Message-ID: <494BD498.1070109 at cornell.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed I just updated to the new lme4 (v28), but now it will not load the library and I get the following message: Error in inDL(x, as.logical(local), as.logical(now), ...) : function 'cholmod_l_start' not provided by package 'Matrix' In addition: Warning message: package 'lme4' was built under R version 2.7.2 Error: package/namespace load failed for 'lme4' -- Benjamin Zuckerberg, Ph.D. Post-doctoral Associate Spatial Ecologist, Citizen Science Cornell Laboratory of Ornithology 159 Sapsucker Woods Road Ithaca, NY 14850 Tele: 607-254-2174 Fax: 607-254-2111 ------------------------------ Message: 2 Date: Fri, 19 Dec 2008 11:19:38 -0500 From: "Alan Cobo-Lewis" <alanc at umit.maine.edu> Subject: Re: [R-sig-ME] heteroscedastic model in lme4 To: r-sig-mixed-models at r-project.org Message-ID: <fc.004c4d193ab9516e3b9aca00882f2171.3ab97563 at umit.maine.edu> Content-Type: text/plain; charset=ISO-8859-1 Anna, lme4 cannot handle certain kinds of heteroscedasticity, but I believe it can handle the kind you have in mind. Search the r-sig-mixed-models archive for a discussion involving me and David Afshartous, especially the summary message titled "[R-sig-ME] random effect variance per treatment group in lmer" that David posted 07/13/2007 04:18:08 PM I can't be certain that the suggestion below would work without knowing more about your design, but if width were a factor with three levels then you might try setting up indicator variables Wind1, Wind2, and Wind3 (that each take on the value 1 when a site is at the indicator's target width and 0 otherwise) and then fit the model with something like mrem <- lmer( log(Nhat+1)~Group + GreenPerc + sess + crop + VegDensity + Group:sess + Group:VegDensity + (0+Wind1|site) + (0+Wind2|site) + (0+Wind3|site), data=all, method="REML" ) alan r-sig-mixed-models at r-project.org on Friday, December 19, 2008 at 6:00 AM -0500 wrote: Message: 1 Date: Thu, 18 Dec 2008 11:23:46 +0000 From: "Renwick, A. R." <a.renwick at abdn.ac.uk> Subject: [R-sig-ME] heteroscedastic model in lme4 To: "'r-sig-mixed-models at r-project.org'" <r-sig-mixed-models at r-project.org> Message-ID: <B9D1301370916C44B5874AF340C18B9B28AE890D50 at VMAILB.uoa.abdn.ac.uk> Content-Type: text/plain; charset="us-ascii" I have been using the nlme package to run some LMM's, however I would like to try rerunning them using the lme4 package so that I can use mcmc sampling. The data I am using shows some heteroscesdasticity of the within error group and so I have been using the 'weights' argument and the varIdent variance function structure to allow different variances for each level of my factor (patch width). My problem is how to code for a heteroscedastic model in lme4 and any suggestion wouuld be much apprecaited. The code I used in the nlme package: # model fit using "REML" mrem<-lme(log(Nhat+1)~Group + GreenPerc + sess + crop + VegDensity + Group:sess + Group:VegDensity ,random=~1|Site, data=all, method="REML",correlation=NULL,weights=varIdent(form=~1|width)) Many thanks, Anna Anna Renwick Institute of Biological & Environment Sciences University of Aberdeen Zoology Building Tillydrone Avenue Aberdeen AB24 2TZ The University of Aberdeen is a charity registered in Scotland, No SC013683. -- Alan B. Cobo-Lewis, Ph.D. (207) 581-3840 tel Department of Psychology (207) 581-6128 fax University of Maine Orono, ME 04469-5742 alanc at maine.edu http://www.umaine.edu/visualperception ------------------------------ Message: 3 Date: Fri, 19 Dec 2008 18:31:09 +0100 From: Dimitris Rizopoulos <d.rizopoulos at erasmusmc.nl> Subject: Re: [R-sig-ME] heteroscedastic model in lme4 To: Alan Cobo-Lewis <alanc at umit.maine.edu> Cc: r-sig-mixed-models at r-project.org Message-ID: <494BDA5D.3030808 at erasmusmc.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed I think not, because Anna wanted to model the variance of the within measurement error terms not the variance of the random effects. As far as I know, the design philosophy of lme4 is to allow for flexible specifications of the random effects part of the mixed model that is assumed to account for the main part of variability in the data. Best, Dimitris Alan Cobo-Lewis wrote: Anna, lme4 cannot handle certain kinds of heteroscedasticity, but I believe it can handle the kind you have in mind. Search the r-sig-mixed-models archive for a discussion involving me and David Afshartous, especially the summary message titled "[R-sig-ME] random effect variance per treatment group in lmer" that David posted 07/13/2007 04:18:08 PM I can't be certain that the suggestion below would work without knowing more about your design, but if width were a factor with three levels then you might try setting up indicator variables Wind1, Wind2, and Wind3 (that each take on the value 1 when a site is at the indicator's target width and 0 otherwise) and then fit the model with something like mrem <- lmer( log(Nhat+1)~Group + GreenPerc + sess + crop + VegDensity + Group:sess + Group:VegDensity + (0+Wind1|site) + (0+Wind2|site) + (0+Wind3|site), data=all, method="REML" ) alan r-sig-mixed-models at r-project.org on Friday, December 19, 2008 at 6:00 AM -0500 wrote: Message: 1 Date: Thu, 18 Dec 2008 11:23:46 +0000 From: "Renwick, A. R." <a.renwick at abdn.ac.uk> Subject: [R-sig-ME] heteroscedastic model in lme4 To: "'r-sig-mixed-models at r-project.org'" <r-sig-mixed-models at r-project.org> Message-ID: <B9D1301370916C44B5874AF340C18B9B28AE890D50 at VMAILB.uoa.abdn.ac.uk> Content-Type: text/plain; charset="us-ascii" I have been using the nlme package to run some LMM's, however I would like to try rerunning them using the lme4 package so that I can use mcmc sampling. The data I am using shows some heteroscesdasticity of the within error group and so I have been using the 'weights' argument and the varIdent variance function structure to allow different variances for each level of my factor (patch width). My problem is how to code for a heteroscedastic model in lme4 and any suggestion wouuld be much apprecaited. The code I used in the nlme package: # model fit using "REML" mrem<-lme(log(Nhat+1)~Group + GreenPerc + sess + crop + VegDensity + Group:sess + Group:VegDensity ,random=~1|Site, data=all, method="REML",correlation=NULL,weights=varIdent(form=~1|width)) Many thanks, Anna Anna Renwick Institute of Biological & Environment Sciences University of Aberdeen Zoology Building Tillydrone Avenue Aberdeen AB24 2TZ The University of Aberdeen is a charity registered in Scotland, No SC013683. -- Alan B. Cobo-Lewis, Ph.D. (207) 581-3840 tel Department of Psychology (207) 581-6128 fax University of Maine Orono, ME 04469-5742 alanc at maine.edu http://www.umaine.edu/visualperception _______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models -- Dimitris Rizopoulos Assistant Professor Department of Biostatistics Erasmus Medical Center Address: PO Box 2040, 3000 CA Rotterdam, the Netherlands Tel: +31/(0)10/7043478 Fax: +31/(0)10/7043014 ------------------------------ Message: 4 Date: Fri, 19 Dec 2008 11:28:44 -0800 (PST) From: Luciano La Sala <lucianolasala at yahoo.com.ar> Subject: [R-sig-ME] naive questions about model building and error output To: r-sig-mixed-models at r-project.org Message-ID: <447014.18802.qm at web59906.mail.ac4.yahoo.com> Content-Type: text/plain; charset=utf-8 Dear R-experts, Quite new to R on this end, so I hope toy can help me out here: I am running version 2.7.1 on Windows Vista. I have small dataset which consists of: # NestID: nest indicator for each chicken. Siblings sharing the same nest have the same nest indicator. # Chick: chick indicator consisting of a unique ID for each single chick. # Year: 1, 2. # ClutchSize: 1-, 2- , 3-eggs. # HO: hatching order within each clutch (1, 2, 3 [first, second and third-hatched chick]). # SibComp: sibling competence: present/ absent (0, 1) # Death10: death at ten days post-hatch (0, 1) In order to account for lack of independence at the nest level (many chicks are nested in nest... aha!), I'd like to run a GLMM with random slopes and intercepts for nests. Using lmer, my model for survival at 10 days, for example, would read (or not!) as follows: model1 <- lmer(Death10 ~ HO + ClutchSize + Sibcomp + Year + (HO+0|NestID) + (1|NestID), family=binomial, 1) summary(model) The output give me the following error: Error en mer_finalize(ans, verbose) : q = 416 > n = 198 1. Whay does this error mean? I was told that my model fails to converge. 2. If so, is there any solution to a lack of convergence? 3. Maybe I could use a model with only random intercept (See below)? model2 <-lmer(Death10 ~ HO + ClutchSize + Sibcomp + Year + (1|NestID), family=binomial, 1) I look forward to receiving your two cent?s worth. Best, Luciano ____________________________________________________________________________________ ?Busc? desde tu celular! Yahoo! oneSEARCH ahora est? en Claro http://ar.mobile.yahoo.com/onesearch ------------------------------ Message: 5 Date: Fri, 19 Dec 2008 14:52:14 -0500 From: "Doran, Harold" <HDoran at air.org> Subject: Re: [R-sig-ME] heteroscedastic model in lme4 To: "Alan Cobo-Lewis" <alanc at umit.maine.edu>, <r-sig-mixed-models at r-project.org> Message-ID: <ED7B522EE00C9A4FA515AA71724D61EE01C649D9 at DC1EXCL01.air.org> Content-Type: text/plain This isn't an entirely accurate statement. nlme has built-in functions that implement the methods for correlational and variance structures as described in section 5 of Pinhiero and Bates. lme4 doesn't have these functions built in as does nlme, but those same methods can be implemented by the user and then the data can be analyzed using functions in lme4. So, functions in lme4 can "handle" the same issues as nlme, it just requires the user to perform the steps described in PB section 5 et seq on their own. -----Original Message----- From: r-sig-mixed-models-bounces at r-project.org on behalf of Alan Cobo-Lewis Sent: Fri 12/19/2008 11:19 AM To: r-sig-mixed-models at r-project.org Subject: Re: [R-sig-ME] heteroscedastic model in lme4 Anna, lme4 cannot handle certain kinds of heteroscedasticity, but I believe it can handle the kind you have in mind. Search the r-sig-mixed-models archive for a discussion involving me and David Afshartous, especially the summary message titled "[R-sig-ME] random effect variance per treatment group in lmer" that David posted 07/13/2007 04:18:08 PM I can't be certain that the suggestion below would work without knowing more about your design, but if width were a factor with three levels then you might try setting up indicator variables Wind1, Wind2, and Wind3 (that each take on the value 1 when a site is at the indicator's target width and 0 otherwise) and then fit the model with something like mrem <- lmer( log(Nhat+1)~Group + GreenPerc + sess + crop + VegDensity + Group:sess + Group:VegDensity + (0+Wind1|site) + (0+Wind2|site) + (0+Wind3|site), data=all, method="REML" ) alan r-sig-mixed-models at r-project.org on Friday, December 19, 2008 at 6:00 AM -0500 wrote: Message: 1 Date: Thu, 18 Dec 2008 11:23:46 +0000 From: "Renwick, A. R." <a.renwick at abdn.ac.uk> Subject: [R-sig-ME] heteroscedastic model in lme4 To: "'r-sig-mixed-models at r-project.org'" <r-sig-mixed-models at r-project.org> Message-ID: <B9D1301370916C44B5874AF340C18B9B28AE890D50 at VMAILB.uoa.abdn.ac.uk> Content-Type: text/plain; charset="us-ascii" I have been using the nlme package to run some LMM's, however I would like to try rerunning them using the lme4 package so that I can use mcmc sampling. The data I am using shows some heteroscesdasticity of the within error group and so I have been using the 'weights' argument and the varIdent variance function structure to allow different variances for each level of my factor (patch width). My problem is how to code for a heteroscedastic model in lme4 and any suggestion wouuld be much apprecaited. The code I used in the nlme package: # model fit using "REML" mrem<-lme(log(Nhat+1)~Group + GreenPerc + sess + crop + VegDensity + Group:sess + Group:VegDensity ,random=~1|Site, data=all, method="REML",correlation=NULL,weights=varIdent(form=~1|width)) Many thanks, Anna Anna Renwick Institute of Biological & Environment Sciences University of Aberdeen Zoology Building Tillydrone Avenue Aberdeen AB24 2TZ The University of Aberdeen is a charity registered in Scotland, No SC013683. -- Alan B. Cobo-Lewis, Ph.D. (207) 581-3840 tel Department of Psychology (207) 581-6128 fax University of Maine Orono, ME 04469-5742 alanc at maine.edu http://www.umaine.edu/visualperception _______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models [[alternative HTML version deleted]] ------------------------------ _______________________________________________ R-sig-mixed-models mailing list R-sig-mixed-models at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models End of R-sig-mixed-models Digest, Vol 24, Issue 28 **************************************************