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
1
vote
1 answer

R: gls error "false convergence (8)" and glsControl function

I've seen that a common error when running a generalized least squares (gls) from nlme package in R is the "false convergence (8)". I am trying to run gls models to account for the spatial dependence of my residuals, but I got stucked with the same…
1
vote
1 answer

Extracting the (i) estimated variance-covariance matrix of random effects and/or (ii) mixed model equation solutions from lme4 as matrices?

As the title says I am trying to extract matrices from an lme4 (or other packages?) object. To make clear what I want precisely I think it is easiest to refer to the SAS documentation:…
Paul Schmidt
  • 1,072
  • 10
  • 23
1
vote
1 answer

Can I use a covariance matrix to specify the correlation structure in the nlme function gls?

I wish to use the function gls in the R package nlme to analyse a set of nested spatial samples, in which many samples overlap in at least some spatial coordinates. I want to account for non-independence in the response variable (the thing I'm…
Roger
  • 677
  • 2
  • 8
  • 19
1
vote
0 answers

Proper way to set corARMA() correlation structure for lme {nlme}

I have a time series with temperature measures every 5-minutes over ca. 5-7 days. I'm looking to set the correlation structure for my model as I have considerable temporal autocorrelation. I've decided that moving averages would be the best form,…
Crow
  • 11
  • 4
1
vote
1 answer

Issue with gls model, singular convergence error

I would like to make a gls model using these vectors: v1 <- c( 3.27985464, -0.40586830, -0.40586830, -0.09872472, -0.09872472, -0.40586830, -0.40586830, 0.82270601, -0.40586830, -0.40586830, -0.25229651, -0.40586830, -0.40586830, -0.40586830) year…
Roxanne
  • 11
  • 3
1
vote
1 answer

nonlinear mixed model without group structure specification

I am trying to fit a very simple nonlinear mixed model (Gompertz curve) without any hierarchical structure (just repeated measures). First, I want to try it only with fixed and then with random effects. This is the data (I took a subset of 10…
user1157485
1
vote
0 answers

Add raw data points to jp.int (sjPlot)

For my manuscript, I plotted a lme with an interaction of two continuous variables: Create data mydata <- data.frame( SID=sample(1:150,400,replace=TRUE),age=sample(50:70,400,replace=TRUE), sex=sample(c("Male","Female"),200, replace=TRUE),time=…
user6121484
  • 143
  • 2
  • 15
1
vote
0 answers

Fitting ODEs with nonlinear mixed effects models (nlme) in R - error

I'm trying fit an ODE model (two equations to two variables) using mixed effects because the 'replicates' per time point are actually from different patients, meaning we're combining them to build one timeseries. (annotated code below) I get this…
LiaChica
  • 111
  • 3
1
vote
1 answer

R: extracting information from verbose output in nlme fit

library(nlme) fm2 <- nlme(height ~ SSasymp(age, Asym, R0, lrc), data = Loblolly, fixed = Asym + R0 + lrc ~ 1, random = Asym ~ 1, start = c(Asym = 103, R0 = -10, lrc = -8), verbose = TRUE) **Iteration…
Adrian
  • 9,229
  • 24
  • 74
  • 132
1
vote
0 answers

nlmeODE does not work when an additional parameter was added to the Theoph model example in R documentation for nlmeODE

I tried running the Theoph model provided in the R documentation for nlmeODE package with my own dataset and it was able to return the parameter estimates. However, when I added an additional parameter that I wanted to estimate, I received an error…
1
vote
0 answers

glmmPQL model comparison and selection in R

I am working with menstrual cycle data, and I want to investigate if carrying an infection predicts the occurence of pre-menstrual symptoms. In addition, I have no a priori reason to think that the pre-menstrual phase lasts for 3, 4 or 5 days (or…
Alex
  • 31
  • 2
1
vote
2 answers

predict.gls fails when the package "MuMin" is installed in R

I am getting an error message when using predict.gls when the package "MuMIn" is installed. The following (Ex. 1) works: ### EX. 1 library(nlme) # example code from https://stat.ethz.ch/R-manual/R-devel/library/nlme/html/predict.gls.html fm1 <-…
Asteraceae
  • 13
  • 2
1
vote
0 answers

error in nlme predict. Error in sprintf(ngettext(sum(wch)

I have built a linear mixed effects model which works well: MDA_counts_lme <- lme(fixed = counts ~ treatment, data = dt_meta, random = ~ 1 | participant) MDA_counts_lme new.dat <- data.frame(treatment = c("treatmentnat",…
Manasi Shah
  • 437
  • 3
  • 18
1
vote
1 answer

nlme: fit mixed model using CSH covariance model

I am trying to fit a mixed model with repeated measurements (MMRM) model in R using the nlme package. The structure of the data is as follows: Each patient belongs to one of three groups (grp) and is assigned to a treatment group (trt). …
W7GVR
  • 1,990
  • 1
  • 18
  • 24
1
vote
1 answer

R Ordering of LME covariates for level 1 and level 2 variables?

I have longitudinal data with level 1 and level 2 variables in R my dataframe (df): ID Year Gender Race MathScore DepressionScore MemoryScore 1 1999 M C 80 15 80 1 2000 M C 81 …
iPlexpen
  • 409
  • 1
  • 4
  • 13