Questions tagged [nlme]

An R package for fitting Non-Linear Mixed Effects statistical models.

An package for fitting Non-Linear Mixed Effects statistical models ().

Repositories

Books

Other resources

Related tags

494 questions
6
votes
1 answer

fitting first order equation with nlme and lsoda

I a trying to fit a first order differential model using nlme and lsoda. Here is the basic idea: I first define the function allowing to generate the solution of the differential equation: library(deSolve) ODE1 <- function(time, x, parms)…
denis
  • 5,580
  • 1
  • 13
  • 40
6
votes
0 answers

Straight-forward AND open-source alternatives to asreml-r for spatial models?

In the past, I have used asreml-r to account for spatial auto-correlation in agricultural field trials that were laid out in a “row and range” design. It is relatively easy to use the asreml package to specify a spatial model (i.e.…
Nic George
  • 121
  • 6
6
votes
0 answers

Specified covariance matrix in lmer in R for penalized splines

I have been trying to fit a penalized spline regression model in R using the connection between penalized splines and linear mixed models. While I am quite familiar with the R function lme, using its competitor lmer presents some difficulties. Here…
JohnK
  • 1,019
  • 3
  • 14
  • 30
6
votes
1 answer

R: how to extract information from summary model fit

library(nlme) fm1 <- nlme(height ~ SSasymp(age, Asym, R0, lrc), data = Loblolly, fixed = Asym + R0 + lrc ~ 1, random = Asym ~ 1, start = c(Asym = 103, R0 = -8.5, lrc = -3.3)) > summary(fm1) Nonlinear…
Adrian
  • 9,229
  • 24
  • 74
  • 132
6
votes
1 answer

nlme fit : vcov versus summary

I have fitted a model using nlme() from the package nlme. Now I wish to simulate some prediction intervals, taking into account parameter uncertainty. To this end, I need to extract the variance matrix for the fixed effects. As far as I am aware,…
Ketil B T
  • 111
  • 5
6
votes
1 answer

lme() different results each run under Revolution R (MKL to blame?)

Update (Aug 2014): I never got to the bottom of this, and never got any feedback on Revolution's forum. This issue, however, seems to have been fixed in Revolution R 7.2 (with R 3.0.3, again the academic version). I ran the lme() test below a few…
Peter
  • 1,016
  • 9
  • 20
6
votes
2 answers

Extract the random effects design matrix in nlme

A linear mixed effects model is traditionally formulated in the following way. Ri = Xi × β + Zi × bi + εi where β represents estimated fixed effects and Z represents the random effects. X is thus the classical design matrix. Using R, I would like to…
iantist
  • 833
  • 2
  • 12
  • 27
5
votes
1 answer

Calculate and plot 95% confidence intervals of a generalised nonlinear model

I have built several generalised nonlinear least squares models (exponential decay) with the R package nlme and the contained gnls() function. The reason I do not simply build nonlinear least squares models with the base nls() function is because I…
5
votes
2 answers

AIC calculation doesn't match in R and SAS for mixed model

I try to reproduce some SAS output using R. the method I want to reproduce is : Two way anaysis of variance with repeated measures on factor time using mixed models (covariance matrix = CS, Estimation method = REML) Everything looks fine exept…
Vincent Guyader
  • 2,927
  • 1
  • 26
  • 43
5
votes
1 answer

R: using factor variables in nlme function

library(nlme) model <- nlme(height ~ (R0) + 1, data = Loblolly, fixed = list(R0 ~ 1), random = list(Seed = pdDiag(list(R0 ~ 1))), start = list(fixed = c(R0 = -8.5))) Here is a simple model…
Adrian
  • 9,229
  • 24
  • 74
  • 132
5
votes
1 answer

R: error with optim and nlme

library(nlme) mydat <- structure(list(class = c(91L, 91L, 91L, 91L, 91L, 91L, 92L, 92L, 92L, 92L, 92L, 92L, 92L, 92L, 92L, 92L, 92L, 92L, 92L, 92L, 92L, 92L, 93L, 93L, 93L, 94L, 94L, 94L,…
Adrian
  • 9,229
  • 24
  • 74
  • 132
5
votes
1 answer

Does the function y = at^b * exp(-ct) have a name? Can it be linearized? How can I estimate a, b, c?

I am trying to fit a non-linear model, but can not find any good examples online. Does this function have a name? Can it be linearized? I've attempted to estimate the parameters a, b, and c with a random effect g (as in group) as a function of…
Abe
  • 12,956
  • 12
  • 51
  • 72
5
votes
2 answers

R how to use bounds and the "port" algorithm in nlslist?

I would like to fit curves on a number of data sets, grouped by treatment. This was working very well with nlslist, but now I would like to introduce upper bounds to my parameters. Introducing bounds does work out very nicely when I fit each group…
5
votes
1 answer

Extract random formula from nlme objects

I'm trying to extract the random structure from models constructed using lme, but I can't seem to get anything other than the fixed formula. E.g., library(nlme) fm1 <- lme(distance ~ age, Orthodont, random = ~ age | Subject) deparse(terms(fm1)) #…
jslefche
  • 4,379
  • 7
  • 39
  • 50
5
votes
1 answer

Collinearity after accounting for random/mixed effects

could two/more predictors become more/less collinear after accounting for random effects? In my case I have tested for collinearity prior to modelling, e.g. using VIF, and everything checks out. However, the ranking (using IC) of different models…
ego_
  • 1,409
  • 6
  • 21
  • 31
1
2
3
32 33