Dear All, I have a set of data which consist of?1575 groups with 11 temperature values?in each group. This temperature is recorded across 11 different depths of the sea. The?R script are shown below: ############################################################ #Temp : Temperature #dp1, dp2, dp3 : covariate with respect to linear, quadratic and cubic terms #group : 1575 groups in which there are 11 observations in each group #sub3 : Data set 1 #set3 : Data set 2 dp1 <- rep(rev(seq(1,51, by = 5)),1575) dp2 <- dp1^2 dp3 <- dp1^3 group <- rep(1:1575, each = 11) set3 <- data.frame(sub3, dp1, dp2, dp3) (lm.lme3 <- lmer(Temp ~ dp1 + dp2 + dp3 + (dp1 + dp2 + dp3|group), data = set3)) ############################################################ I tried to fit a linear mixed model via lmer function, with all the fixed and random effects are included, but there is a 'Warning' message given after the output, as shown below. ############################################## Linear mixed model fit by REML Formula: Temp ~ dp1 + dp2 + dp3 + (dp1 + dp2 + dp3 | group) ?? Data: set3 ?? AIC?? BIC logLik deviance REMLdev ?65627 65743 -32799??? 65539?? 65597 Random effects: ?Groups?? Name??????? Variance?? Std.Dev.?? Corr????????????????? ?group??? (Intercept) 4.8336e-01 6.9524e-01????????????????????? ????????? dp1???????? 5.2199e-04 2.2847e-02? 0.000?????????????? ????????? dp2???????? 3.0528e-07 5.5252e-04? 0.000? 0.000??????? ????????? dp3???????? 7.8888e-11 8.8819e-06 -0.966? 0.000? 0.000 ?Residual???????????? 1.9939e+00 1.4120e+00????????????????????? Number of obs: 17325, groups: group, 1575 Fixed effects: ????????????? Estimate Std. Error t value (Intercept)? 1.363e+01? 4.043e-02?? 337.1 dp1???????? -2.930e-01? 6.328e-03?? -46.3 dp2????????? 3.924e-03? 2.870e-04??? 13.7 dp3???????? -1.900e-05? 3.628e-06??? -5.2 Correlation of Fixed Effects: ??? (Intr) dp1??? dp2?? dp1 -0.739????????????? dp2? 0.616 -0.959?????? dp3 -0.563? 0.904 -0.982 Warning message: In mer_finalize(ans) : false convergence (8) ############################################# Does the output given is valid? Could someone please advice on this message. Thank you Fir
Warning message with lmer function
3 messages · FMH, Ken Beath, ONKELINX, Thierry
The random effects variances are close to zero, which will cause lots of problems. This is possibly a numerical problem, as the values of the fixed effect estimates are small. Maybe you could try scaling the covariate before creating the polynomial terms. Ken
On 16/09/2009, at 8:17 PM, FMH wrote:
Dear All,
I have a set of data which consist of 1575 groups with 11
temperature values in each group. This temperature is recorded
across 11 different depths of the sea. The R script are shown below:
############################################################
#Temp : Temperature
#dp1, dp2, dp3 : covariate with respect to linear, quadratic and
cubic terms
#group : 1575 groups in which there are 11 observations in each group
#sub3 : Data set 1
#set3 : Data set 2
dp1 <- rep(rev(seq(1,51, by = 5)),1575)
dp2 <- dp1^2
dp3 <- dp1^3
group <- rep(1:1575, each = 11)
set3 <- data.frame(sub3, dp1, dp2, dp3)
(lm.lme3 <- lmer(Temp ~ dp1 + dp2 + dp3 + (dp1 + dp2 + dp3|group),
data = set3))
############################################################
I tried to fit a linear mixed model via lmer function, with all the
fixed and random effects are included, but there is a 'Warning'
message given after the output, as shown below.
##############################################
Linear mixed model fit by REML
Formula: Temp ~ dp1 + dp2 + dp3 + (dp1 + dp2 + dp3 | group)
Data: set3
AIC BIC logLik deviance REMLdev
65627 65743 -32799 65539 65597
Random effects:
Groups Name Variance Std.Dev. Corr
group (Intercept) 4.8336e-01 6.9524e-01
dp1 5.2199e-04 2.2847e-02 0.000
dp2 3.0528e-07 5.5252e-04 0.000 0.000
dp3 7.8888e-11 8.8819e-06 -0.966 0.000 0.000
Residual 1.9939e+00 1.4120e+00
Number of obs: 17325, groups: group, 1575
Fixed effects:
Estimate Std. Error t value
(Intercept) 1.363e+01 4.043e-02 337.1
dp1 -2.930e-01 6.328e-03 -46.3
dp2 3.924e-03 2.870e-04 13.7
dp3 -1.900e-05 3.628e-06 -5.2
Correlation of Fixed Effects:
(Intr) dp1 dp2
dp1 -0.739
dp2 0.616 -0.959
dp3 -0.563 0.904 -0.982
Warning message:
In mer_finalize(ans) : false convergence (8)
#############################################
Does the output given is valid? Could someone please advice on this
message.
Thank you
Fir
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
Use poly() instead of calculating the polynomials by hand. And note that your current random effect requires 10 parameters. And you have only 11 data point within each group. Therefore I would simplify it to the model below. lmer(Temp ~ poly(dp1, 3) + (poly(dp1, 1)|group) data = set3) HTH, Thierry ------------------------------------------------------------------------ ---- ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest Cel biometrie, methodologie en kwaliteitszorg / Section biometrics, methodology and quality assurance Gaverstraat 4 9500 Geraardsbergen Belgium tel. + 32 54/436 185 Thierry.Onkelinx at inbo.be www.inbo.be To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher The plural of anecdote is not data. ~ Roger Brinner The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey -----Oorspronkelijk bericht----- Van: r-sig-mixed-models-bounces at r-project.org [mailto:r-sig-mixed-models-bounces at r-project.org] Namens Ken Beath Verzonden: woensdag 16 september 2009 12:35 Aan: FMH CC: r-sig-mixed-models at r-project.org Onderwerp: Re: [R-sig-ME] Warning message with lmer function The random effects variances are close to zero, which will cause lots of problems. This is possibly a numerical problem, as the values of the fixed effect estimates are small. Maybe you could try scaling the covariate before creating the polynomial terms. Ken
On 16/09/2009, at 8:17 PM, FMH wrote:
Dear All,
I have a set of data which consist of 1575 groups with 11
temperature values in each group. This temperature is recorded
across 11 different depths of the sea. The R script are shown below:
############################################################
#Temp : Temperature
#dp1, dp2, dp3 : covariate with respect to linear, quadratic and
cubic terms
#group : 1575 groups in which there are 11 observations in each group
#sub3 : Data set 1
#set3 : Data set 2
dp1 <- rep(rev(seq(1,51, by = 5)),1575)
dp2 <- dp1^2
dp3 <- dp1^3
group <- rep(1:1575, each = 11)
set3 <- data.frame(sub3, dp1, dp2, dp3)
(lm.lme3 <- lmer(Temp ~ dp1 + dp2 + dp3 + (dp1 + dp2 + dp3|group),
data = set3))
############################################################
I tried to fit a linear mixed model via lmer function, with all the
fixed and random effects are included, but there is a 'Warning'
message given after the output, as shown below.
##############################################
Linear mixed model fit by REML
Formula: Temp ~ dp1 + dp2 + dp3 + (dp1 + dp2 + dp3 | group)
Data: set3
AIC BIC logLik deviance REMLdev
65627 65743 -32799 65539 65597
Random effects:
Groups Name Variance Std.Dev. Corr
group (Intercept) 4.8336e-01 6.9524e-01
dp1 5.2199e-04 2.2847e-02 0.000
dp2 3.0528e-07 5.5252e-04 0.000 0.000
dp3 7.8888e-11 8.8819e-06 -0.966 0.000 0.000
Residual 1.9939e+00 1.4120e+00
Number of obs: 17325, groups: group, 1575
Fixed effects:
Estimate Std. Error t value
(Intercept) 1.363e+01 4.043e-02 337.1
dp1 -2.930e-01 6.328e-03 -46.3
dp2 3.924e-03 2.870e-04 13.7
dp3 -1.900e-05 3.628e-06 -5.2
Correlation of Fixed Effects:
(Intr) dp1 dp2
dp1 -0.739
dp2 0.616 -0.959
dp3 -0.563 0.904 -0.982
Warning message:
In mer_finalize(ans) : false convergence (8)
#############################################
Does the output given is valid? Could someone please advice on this
message.
Thank you
Fir
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models Druk dit bericht a.u.b. niet onnodig af. Please do not print this message unnecessarily. Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is door een geldig ondertekend document. The views expressed in this message and any annex are purely those of the writer and may not be regarded as stating an official position of INBO, as long as the message is not confirmed by a duly signed document.