|
Dear R Users,
I was hoping for some help with a recurrent error message in lmer. I am trying to model the effect of temperature on metabolic rate in animals (response = int.length) at different temperatures (mean.sst), with repeated measurements on the same individuals (random effect = female). Ideally I would make a random slope and intercept model where the rate can change differently with temperature for different individuals: model<-lmer(int.length~mean.sst+(mean.sst|female)) However, I get the following warning message: Warning message: Estimated variance-covariance for factor 'female' is singular in: `LMEoptimize<-`(`*tmp*`, value = list(maxIter = 200L, tolerance = 1.49011611938477e-08, summary(model) Linear mixed-effects model fit by REML Formula: int.length ~ mean.sst + (mean.sst | female) AIC BIC logLik MLdeviance REMLdeviance 155.4 164.5 -72.7 142.8 145.4 Random effects: Groups Name Variance Std.Dev. Corr female (Intercept) 6.8459e-10 2.6165e-05 mean.sst 6.8169e-10 2.6109e-05 -0.065 Residual 1.3634e+00 1.1676e+00 number of obs: 46, groups: female, 18 Fixed effects: Estimate Std. Error t value (Intercept) 48.8249 6.5895 7.409 mean.sst -1.3609 0.2518 -5.406 Correlation of Fixed Effects: (Intr) mean.sst -1.000 If I try and run just a random intercepts model I get similar problems: model2<-lmer(int.length~mean.sst+(1|female)) Warning message: Estimated variance for factor 'female' is effectively zero in: `LMEoptimize<-`(`*tmp*`, value = list(maxIter = 200L, tolerance = 1.49011611938477e-08, I have tried disabling PQL iterations using control = list(usePQL = FALSE, msVerbose=TRUE), following Douglas Bates' recommendation on the mailing list archives but I still get a similar message. Does this mean that the variance among subjects is too close to zero for estimation of the random effects? I compared the random effects model to a linear model with just lm(int.length ~ mean.sst) using a likelihood ratio test and got p = 1.0 (which is always suspicious). It would actually make sense for there to be negligible variation among subjects in their response to temperature, however I am concerned that I am making a fundamental error somewhere along the line. I would greatly appreciate any suggestions you may have. Best regards Sam Weber University of Exeter, UK. [[alternative HTML version deleted]] ______________________________________________ [hidden email] 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. |
|
Hi Sam,
Just a stab in the dark here, but is your grouping variable really female? What does str(data.frame(mean.sst, female) look like? How many levels does female have? -Ista On Thu, Oct 29, 2009 at 7:10 AM, Weber, Sam <[hidden email]> wrote: > Dear R Users, > > I was hoping for some help with a recurrent error message in lmer. I am trying to model the effect of temperature on metabolic rate in animals (response = int.length) at different temperatures (mean.sst), with repeated measurements on the same individuals (random effect = female). Ideally I would make a random slope and intercept model where the rate can change differently with temperature for different individuals: > > model<-lmer(int.length~mean.sst+(mean.sst|female)) > > However, I get the following warning message: > > Warning message: > Estimated variance-covariance for factor 'female' is singular in: `LMEoptimize<-`(`*tmp*`, value = list(maxIter = 200L, tolerance = 1.49011611938477e-08, > summary(model) > > Linear mixed-effects model fit by REML > Formula: int.length ~ mean.sst + (mean.sst | female) > AIC BIC logLik MLdeviance REMLdeviance > 155.4 164.5 -72.7 142.8 145.4 > Random effects: > Groups Name Variance Std.Dev. Corr > female (Intercept) 6.8459e-10 2.6165e-05 > mean.sst 6.8169e-10 2.6109e-05 -0.065 > Residual 1.3634e+00 1.1676e+00 > number of obs: 46, groups: female, 18 > Fixed effects: > Estimate Std. Error t value > (Intercept) 48.8249 6.5895 7.409 > mean.sst -1.3609 0.2518 -5.406 > Correlation of Fixed Effects: > (Intr) > mean.sst -1.000 > > > > > > If I try and run just a random intercepts model I get similar problems: > > > > model2<-lmer(int.length~mean.sst+(1|female)) > > Warning message: Estimated variance for factor 'female' is effectively zero in: `LMEoptimize<-`(`*tmp*`, value = list(maxIter = 200L, tolerance = 1.49011611938477e-08, > > > > I have tried disabling PQL iterations using control = list(usePQL = FALSE, msVerbose=TRUE), following Douglas Bates' recommendation on the mailing list archives but I still get a similar message. Does this mean that the variance among subjects is too close to zero for estimation of the random effects? I compared the random effects model to a linear model with just lm(int.length ~ mean.sst) using a likelihood ratio test and got p = 1.0 (which is always suspicious). It would actually make sense for there to be negligible variation among subjects in their response to temperature, however I am concerned that I am making a fundamental error somewhere along the line. > > > > I would greatly appreciate any suggestions you may have. > > > > Best regards > > > > Sam Weber > > > > University of Exeter, UK. > > > > > [[alternative HTML version deleted]] > > ______________________________________________ > [hidden email] 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. > -- Ista Zahn Graduate student University of Rochester Department of Clinical and Social Psychology http://yourpsyche.org ______________________________________________ [hidden email] 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. |
|
Hi Ista, The command looks like: $ female : Factor w/ 18 levels "2","4","5","8",..: 1 1 1 1 2 2 2 3 4 4 ... Female is a factor with 18 levels, so I assume this is how the analysis is being grouped. Best Sam ________________________________________ From: Ista Zahn [[hidden email]] Sent: 29 October 2009 14:35 To: Weber, Sam Cc: [hidden email] Subject: Re: [R] singular variance-covariance warning in lmer Hi Sam, Just a stab in the dark here, but is your grouping variable really female? What does str(data.frame(mean.sst, female) look like? How many levels does female have? -Ista On Thu, Oct 29, 2009 at 7:10 AM, Weber, Sam <[hidden email]> wrote: > Dear R Users, > > I was hoping for some help with a recurrent error message in lmer. I am trying to model the effect of temperature on metabolic rate in animals (response = int.length) at different temperatures (mean.sst), with repeated measurements on the same individuals (random effect = female). Ideally I would make a random slope and intercept model where the rate can change differently with temperature for different individuals: > > model<-lmer(int.length~mean.sst+(mean.sst|female)) > > However, I get the following warning message: > > Warning message: > Estimated variance-covariance for factor 'female' is singular in: `LMEoptimize<-`(`*tmp*`, value = list(maxIter = 200L, tolerance = 1.49011611938477e-08, > summary(model) > > Linear mixed-effects model fit by REML > Formula: int.length ~ mean.sst + (mean.sst | female) > AIC BIC logLik MLdeviance REMLdeviance > 155.4 164.5 -72.7 142.8 145.4 > Random effects: > Groups Name Variance Std.Dev. Corr > female (Intercept) 6.8459e-10 2.6165e-05 > mean.sst 6.8169e-10 2.6109e-05 -0.065 > Residual 1.3634e+00 1.1676e+00 > number of obs: 46, groups: female, 18 > Fixed effects: > Estimate Std. Error t value > (Intercept) 48.8249 6.5895 7.409 > mean.sst -1.3609 0.2518 -5.406 > Correlation of Fixed Effects: > (Intr) > mean.sst -1.000 > > > > > > If I try and run just a random intercepts model I get similar problems: > > > > model2<-lmer(int.length~mean.sst+(1|female)) > > Warning message: Estimated variance for factor 'female' is effectively zero in: `LMEoptimize<-`(`*tmp*`, value = list(maxIter = 200L, tolerance = 1.49011611938477e-08, > > > > I have tried disabling PQL iterations using control = list(usePQL = FALSE, msVerbose=TRUE), following Douglas Bates' recommendation on the mailing list archives but I still get a similar message. Does this mean that the variance among subjects is too close to zero for estimation of the random effects? I compared the random effects model to a linear model with just lm(int.length ~ mean.sst) using a likelihood ratio test and got p = 1.0 (which is always suspicious). It would actually make sense for there to be negligible variation among subjects in their response to temperature, however I am concerned that I am making a fundamental error somewhere along the line. > > > > I would greatly appreciate any suggestions you may have. > > > > Best regards > > > > Sam Weber > > > > University of Exeter, UK. > > > > > [[alternative HTML version deleted]] > > ______________________________________________ > [hidden email] 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. > -- Ista Zahn Graduate student University of Rochester Department of Clinical and Social Psychology http://yourpsyche.org ______________________________________________ [hidden email] 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. |
| Powered by Nabble | Edit this page |
