[R-sig-ME] nlme issue since 3.40

Philippi, Tom tom_philippi at nps.gov
Wed May 10 22:54:02 CEST 2017


Jochen--

Using R 3.4 and nlme 3.1-131 on MS win7 and the data you included in the
other message thread, I cannot duplicate your error.  It also runs fine
under MRAN 3.3.2 on MS win7 which uses the Intel MKL.  I haven't yet
updated R to 3.4 on my linux ubuntu box to test there, but my best guess
now is that something failed in your update to 3.4.


> library(nlme)
> library(broom)
>
> data2 <- structure(list(Place = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L,
+ 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L,
+ 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L,
+ 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L), .Label =
+ c("Cambridge Bay",
+ "Iqaluit", "Rankin Inlet"), class = "factor"), year_c = c(-2,
+ -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, -2,
+ -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, -2,
+ -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15), SR_Total_ctd
+ = c(NA,
+ NA, 5.48961420000001, 7.24637679999999, 3.76569040000001, 6.9014085,
+ 9.3088858, 5.1771117, 7.51366120000002, 7.18157180000001, 3.7275064,
+ 5.7397959, 6.87500000000001, 6.25, 5.84577109999999, 6.2421973,
+ 4.70446319999999, NA, NA, NA, 11.9192688, 9.6291013, 8.54640980000001,
+ 8.7893297, 7.42343539999999, 5, 5.3674121, 6.1322261, 6.4182843,
+ 5.75692960000001, 6.3861534, 6.6706021, 7.76642339999999,
6.91983119999999,
+ 5.3634631, NA, NA, NA, 0.0870321999999959, -1.19047620000001,
+ -1.8723404, -0.4244482, 1.18443319999999, 2.19594590000001,
+ 1.57545610000001,
+ 3.080766, 1.8744906, 5.51053480000002, 6.31412790000002, 7.4451411,
+ 8.1226054, 9.52743899999999, 9.4339623, NA)), .Names = c("Place",
+ "year_c", "SR_Total_ctd"), row.names = c(NA, -54L), class = "data.frame")
>
>
> uncmod <- lme(fixed = year_c~1, random = ~1|Place, data = data2,
method="ML")
> tidy(uncmod)
  group         level        term estimate
1 Place Cambridge Bay (Intercept)      6.5
2 Place       Iqaluit (Intercept)      6.5
3 Place  Rankin Inlet (Intercept)      6.5
> summary(uncmod)
Linear mixed-effects model fit by maximum likelihood
 Data: data2
       AIC      BIC    logLik
  337.0536 343.0206 -165.5268

Random effects:
 Formula: ~1 | Place
         (Intercept) Residual
StdDev: 0.0001350644 5.188127

Fixed effects: year_c ~ 1
            Value Std.Error DF  t-value p-value
(Intercept)   6.5 0.7126441 51 9.120962       0

Standardized Within-Group Residuals:
          Min            Q1           Med            Q3           Max
-1.638356e+00 -8.673650e-01 -1.193490e-15  8.673650e-01  1.638356e+00

Number of Observations: 54
Number of Groups: 3
> VarCorr(uncmod)
Place = pdLogChol(1)
            Variance     StdDev
(Intercept) 1.824240e-08 0.0001350644
Residual    2.691667e+01 5.1881274721
>
> sessionInfo()
R version 3.4.0 (2017-04-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] broom_0.4.2  nlme_3.1-131

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.10     lattice_0.20-35  tidyr_0.6.1      psych_1.7.3.21
 [5] dplyr_0.5.0      assertthat_0.2.0 grid_3.4.0       R6_2.2.0
 [9] plyr_1.8.4       DBI_0.6-1        magrittr_1.5     stringi_1.1.5
[13] lazyeval_0.2.0   reshape2_1.4.2   tools_3.4.0      stringr_1.2.0
[17] foreign_0.8-67   parallel_3.4.0   compiler_3.4.0   mnormt_1.5-5
[21] tibble_1.3.0


Tom 2


On Wed, May 10, 2017 at 1:05 PM, Jochen Wirsing <jw1085 at wildcats.unh.edu>
wrote:

> Dear All,
>
>
> thanks again for your nice feedback. The Session Info etc was mentioned
> in the previous email, but one of the folks here on the list asked me to
> use dput() so I could paste my data in textform here.
>
> So here you go:
>
> structure(list(Place = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L,
> 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L,
> 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L,
> 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L), .Label =
> c("Cambridge Bay",
> "Iqaluit", "Rankin Inlet"), class = "factor"), year_c = c(-2,
> -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, -2,
> -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, -2,
> -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15), SR_Total_ctd
> = c(NA,
> NA, 5.48961420000001, 7.24637679999999, 3.76569040000001, 6.9014085,
> 9.3088858, 5.1771117, 7.51366120000002, 7.18157180000001, 3.7275064,
> 5.7397959, 6.87500000000001, 6.25, 5.84577109999999, 6.2421973,
> 4.70446319999999, NA, NA, NA, 11.9192688, 9.6291013, 8.54640980000001,
> 8.7893297, 7.42343539999999, 5, 5.3674121, 6.1322261, 6.4182843,
> 5.75692960000001, 6.3861534, 6.6706021, 7.76642339999999, 6.91983119999999,
> 5.3634631, NA, NA, NA, 0.0870321999999959, -1.19047620000001,
> -1.8723404, -0.4244482, 1.18443319999999, 2.19594590000001,
> 1.57545610000001,
> 3.080766, 1.8744906, 5.51053480000002, 6.31412790000002, 7.4451411,
> 8.1226054, 9.52743899999999, 9.4339623, NA)), .Names = c("Place",
> "year_c", "SR_Total_ctd"), row.names = c(NA, -54L), class = "data.frame")
> >
>
>
> I was also asked, whether using lme4 would be an option, but I don't
> think that this will help fix the issue that I believe occurred through
> updating to R 3.40. Also, nlme provides some information in a nicer way
> (covariances etc, if I remember correctly - all this is still very new
> to me....), so I'd really rather see nlme fixed.
>
>
> Thanks again!
>
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
>

	[[alternative HTML version deleted]]



More information about the R-sig-mixed-models mailing list