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
0 answers

How to compute Cook's distances for generalized least squares models

Does anyone know how to compute Cooks' distances for a gls class object (obtained through the nlme package)? The standard cooks.distance function only seems to work for lm class objects.
user28719
  • 11
  • 2
1
vote
1 answer

add lines based on fitted values from lme to faceted ggplot in R

I am working on a multipanel plot using the package ggplot2 in R. My dataset consists of 20 species, 6 individuals per species, two cores per individual, and each core is composed of several segments. Here's the dput output from a subset of my…
atawewe
  • 11
  • 2
1
vote
1 answer

Why does predict, on a subset of the original data, fail using gls when lm does the trick?

The problem is illustrated using the code below. If you run it you will see that lm handles the predict gracefully while gls fails to do so. This is most likely a problem in predict.gls but I don't understand why. This is only an issue when using…
Dr. Mike
  • 2,451
  • 4
  • 24
  • 36
1
vote
0 answers

Two Error messages when fitting mixed effects nonlinear model in nlme

Here is my code: > pred4<-function(a1,b1,a3,b3,Pa,Temp,D) log(Pa)+a1+b1*(1000/(Temp+273.15) - 0.81)-log(1+Pa*exp(a3+b3*(1000/(Temp+273.15) - 0.81)))+D > nlme.fit <- nlme(ln.R. ~ pred4(a1,b1,a3,b3,Pa,Temp,Day), fixed = a1+b1+a3+b3 ~1,random =…
1
vote
1 answer

order random effects plot by size of parameter estimates (using nlme)

I want to make a random effects plot using the plot method for ranef objects (plot.ranef.lme). library(nlme) x <- Orthodont # change factor to unordered for this example x$Subject <- factor(x$Subject, ordered=FALSE) m <- lme(distance ~ age, x,…
Mark Heckmann
  • 10,943
  • 4
  • 56
  • 88
1
vote
0 answers

Adding covariates to nlme model in R

I've recently started learning to fit data using the nlme model. I was wondering if there was a more logical way of generating all possible combinations of covariates (for the variables asy and int) in the nlme model below: fmzeta.nlme <- nlme( …
John_dydx
  • 951
  • 1
  • 14
  • 27
1
vote
1 answer

Changing panel order in lattice plots within nlme

I would like to publish a augPred figure generated by nlme, so it needs to look a little nicer (say the reviewers). I want to reorder the panels and change the titles. I have tried using information I've found for lattice, but somehow it is not…
Nazer
  • 3,654
  • 8
  • 33
  • 47
1
vote
0 answers

R - standard errors on predictions from nlme

This question builds on Extract prediction band from lme fit but with non-linear mixed models. I have a dataset of response values that are grouped by "entry." I used an AIC-model selection procedure to test which type of model (linear, logarithmic,…
jslefche
  • 4,379
  • 7
  • 39
  • 50
1
vote
0 answers

Mixed effects model in R using lme

I am analysing data for an observational study on trout growth. So there are plenty of NAs in the dataframe. Also, different treatments have different numbers of observations. So I think this can be called an unbalanced design? Year Site …
Diarmuid Ryan
  • 71
  • 1
  • 5
0
votes
0 answers

Underlying data structure causing all models to break, "isSingular"

It seems like there's some underlying structure issue in my data that's causing all my models to break. I tried using a linear mixed effects models in nlme, lmer, and repeated measures anovas. Every time, I run into some variation of the 'model is…
Jane
  • 1
0
votes
0 answers

What package can you specify an autoregressive correlation structure (AR(1)) with multiple random effects in R?

I am analyzing a longitudinal dataset ("df") of ~3000 subjects who were evaluated six times over the course of the study. Subjects were recruited from 9 different sites and categorized into 1 of 3 groups based upon their mechanism of injury. I am…
Liz
  • 1
0
votes
0 answers

Sandwich method (using 'clubSandwich' package) for estimating 'lme' (nlme package in R) model

I encountered some error that I can't explain when I'm trying to use the vcovCR function from the clubSandwich package that's applied to a lme model estimating a multivariate multilevel model (i.e., mixed-effect model). I have been trying to fit a…
0
votes
0 answers

How To Fix R Error: unable to run for nonlinear mixed model with nlme()

I am interested in fitting both linear and nonlinear mixed-effects models. I would like to fit models to data that are grouped by two factors: yclass and d1. The variable y is a biological response measured once for every mice during the study. In…
aga
  • 1
  • 1
0
votes
1 answer

Error in NLME function: Singularity in backsolve at level 0, block 1

I'm trying to fit ELISA plate data to a non-linear mixed effect model, using the nlme function. Previously, I asked about how to make the syntax work for nested groups, though responses made it seem like that was a lost cause. However, I'm still…
AndyH
  • 1
  • 1
0
votes
1 answer

Calculqting leverage and Cook's distance in non-linear mixed effects model

I am trying to calculate leverage and cooks distance for the model that I developed using nlme, but I'm getting the error saying Error in cooks.distance.lme(model) : not implemented for "nlme" objects" What are the ways to calculate Cook's…
TKH_9
  • 105
  • 1
  • 7