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
0
votes
1 answer

Unequal variance in R linear mixed model post-hoc lsmeans issue

I fitted a linear mixed model to agricultural data, accounting for unequal variances across groups (cultivars) by passing weights = varIdent(...) to lme. lsmeans is showing standard errors that do not align with significant differences. An example…
0
votes
0 answers

R can't compute a random slope growth model with nlme

I am using the nlme package in R (4.1.1) to fit a hierarchical growth model. The data are longitudinal (therapy sessions on level 1) nested within patients (level 2). The data are called as follows: value = the session score I'm predicting EMA_Nr =…
0
votes
1 answer

Error in MEEM(object, conLin, control$niterEM) / fixed-effect model matrix is rank deficient

I'm trying to make a multilevel mediation analysis (as done here and here). library(data.table) library(lme4) library(nlme) library(magrittr) library(dplyr) set.seed(1) # Simulated data…
MDSF
  • 123
  • 6
0
votes
0 answers

Is it possible to specify a continuous AR1 correlation structure in a GEE model using R?

I've got repeated measurements data in which patients are measured an irregular amount of times (2 through 6 times per patient) and also with unequally spaced time intervals (some subsequent measures are 6 months apart, some 3 years). Is it possible…
tcvdb1992
  • 413
  • 3
  • 12
0
votes
1 answer

using weights in a glmmPQL

Using the 'baltimore' housing data from SpData, I want to model the presence of a patio as the response variable, with house price as the explanatory variable. I also want to include weights in my model by housing area. My…
0
votes
1 answer

Plotting population-level predictions from lme model on repeated measurements data using nlme, ggeffects, and sjplot

I have a dataset in a long format of 60 repeated measurements taken within 19 patients (ID). Patients have had a differing amount of measurements (2 measurements [n=11], followed by 5 measurements [n=5], 3 [n=1], 4 [n=1], and 6 measurements [n=1],…
tcvdb1992
  • 413
  • 3
  • 12
0
votes
0 answers

Convergence issue using a LMM with random intercepts and slopes per patient, and with a continuous AR1 correlation structure

Without providing a reproducible example (because that converged, and my data did not), my data is in a long format and includes 104 patients of which 304 measurements were taken. Most only have 2 measurements (n=68), followed by 5 (n=32), 4 (n=3),…
0
votes
1 answer

Get varcov matrix LMM with random intercept and continuous first order autoregressive correlation structure with heteregenous variances?

I have repeated measurements data on 66 patients with either endogenous or exogenous depression (endo) and depression scores measured weekly for 0-5 weeks (hdrs and week, so six measurements per patients including baseline). The data is in a long…
tcvdb1992
  • 413
  • 3
  • 12
0
votes
1 answer

Extract AR coefficient from nmle::gls

I am running a gls model with 1 AR term and would like to see what the coefficient is and whether it is significant within the model; however, it is not printed as part of the summary() output. Is there any way to extract it? data(iris) gls =…
Francesca
  • 63
  • 1
  • 7
0
votes
0 answers

How do I correct this error when running a nonlinear regression model?

Heights for both studies (years combined) over time Average of Dryland heights(avgheight) over time (adjdap) I am trying to run a nonlinear model for a growth curve that is following a sigmoidal pattern but am having some issues with one of my…
Lauren
  • 1
  • 1
0
votes
1 answer

Plot predicted values of linear mixed model over the observed values?

I have repeated measurements on a continuous outcome that looks as follows: library(magrittr) library(ggplot2) library(nlme) mydata <- structure(list(ID = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 5L, 5L, 5L, 6L, 6L,…
tcvdb1992
  • 413
  • 3
  • 12
0
votes
0 answers

nlme with correlation structure not fitting and crashes R

I have a mixed model with a non-linear term, so I would like to use the R package nlme instead of lme. However, switching to nlme, even without adding anything to the model, causes Rstudio and R to crash. I have found that even generated data, which…
LBogaardt
  • 402
  • 1
  • 4
  • 25
0
votes
0 answers

plotting semivariograms with non-nlme package models

I am trying to plot a semivariogram of my model residuals for a generalised mixed effect model in R. Doing this for a mixed effect model with normal distribution is straightforward with the nlme package, and using the quakes dataset as an…
0
votes
0 answers

Quadratic function implementation error in R's nlme

I'm trying to fit a quadratic function to an HLM model using R's nlme. My data looks like this: Data <- structure(list(X = c(2L, 3L, 4L, 5L, 22L, 23L), userId = c("0014","0014", "0014", "0014", "0059", "0059"), who_score = c(24L, 60L, 40L,…
Navot Naor
  • 59
  • 5
0
votes
2 answers

nlminb problem, convergence error code = 1 message = iteration limit reached without convergence (10)

I am trying to find a best model fitting on my data using library(nlme) and lme function in R. Here is my model when the slope is fixed: FixedRopeLength <- lme(EnergyCost~ RopeLength, data = data, random=~1|Subject, method =…