library(datasets) library(nlme) n1 <- nlme(circumference ~ phi1 / (1 + exp(-(age - phi2)/phi3)), data = Orange, fixed = list(phi1 ~ 1, phi2 ~ 1, phi3 ~ 1), random = list(Tree = pdDiag(phi1 ~ 1)), start = list(fixed = c(phi1 = 192.6873, phi2 = 728.7547, phi3 = 353.5323)))
I fit a nonlinear mixed effects model using
nlme in R, and here's my output.
> summary(n1) Nonlinear mixed-effects model fit by maximum likelihood Model: circumference ~ phi1/(1 + exp(-(age - phi2)/phi3)) Data: Orange AIC BIC logLik 273.1691 280.9459 -131.5846 Random effects: Formula: phi1 ~ 1 | Tree phi1 Residual StdDev: 31.48255 7.846255 Fixed effects: list(phi1 ~ 1, phi2 ~ 1, phi3 ~ 1) Value Std.Error DF t-value p-value phi1 191.0499 16.15411 28 11.82671 0 phi2 722.5590 35.15195 28 20.55530 0 phi3 344.1681 27.14801 28 12.67747 0 Correlation: phi1 phi2 phi2 0.375 phi3 0.354 0.755 Standardized Within-Group Residuals: Min Q1 Med Q3 Max -1.9146426 -0.5352753 0.1436291 0.7308603 1.6614518 Number of Observations: 35 Number of Groups: 5
Can someone help me understand why I'm getting slightly different estimates? I know that the
nlme uses the Lindstrom & Bates (1990) implementation. According to SAS documentation, SAS's integral approximation is based on Pinhiero & Bates (1995). I've tried changing the optimization method to Nelder-Mead to match that of
nlme, but the results are still dissimilar.
I've had other cases where the standard error and parameter estimate in R vs. SAS are vastly different (I don't have a reproducible example of this, but any insight would be appreciated). I'm guessing this has to do with how
nlmixed estimate the standard errors in the presence of random effects?