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

nlme package: augPred change the x axis with log='x'

Hi I am trying to change the scale on the x-axis to a log scale on a plot generated by model2 <- nlme(consumption~Q*10^(5*(exp(-alpha*Q*price)-1)), fixed=Q+alpha~1,`random=Q+alpha~1|ratid, groups = ~ treatment,`data = oxydata, start = c(Q=3,…
0
votes
0 answers

lme object within a function uses response variable from previous run

I am using a lme object within a function but it does not use the response variable that I feed it, instead it uses the response variable from the previous time I called the function. library(nlme) library(car) # DATA (Example) S1=data.frame(blok =…
Bas Allema
  • 11
  • 2
0
votes
1 answer

Categorical variable coding with 0s and 1s giving different outputs in R

What I did: I did a linear mixed effect model analysis in R with nlme library. I have a categorical fixed variable, Blurriness, with 2 levels: B standing for Blurred, N standing for Non-Blurred. Upon suggestion, I changed them into, 1(for B) and…
Yesim
  • 193
  • 1
  • 1
  • 7
0
votes
0 answers

How to construct custom correlation structure for mixed models in nlme

I am trying to fit a linear mixed model in the R package nlme, using the lme function. There are a number of commonly-used correlation structures available to be used as values for the correlation argument. However, I would like to define a custom…
BioBroo
  • 613
  • 1
  • 7
  • 21
0
votes
1 answer

'lme' error R "attempt to apply non-function

I'm conducting lme analysis using on my dataset with the following code M1 <- lme(VT ~ visit + sx + agevis + c_bmi + gpa + qa + BP + MH + ethn, data = Cleaned_data4t300919, random = ~ 1 + visit |id, corAR1(),method = "ML", na.action =…
sylvie
  • 3
  • 2
0
votes
0 answers

multiple random effects in nlme

I need to include one more random effect in my lme model. However, these 2 random effects are not related, therefore cannot be nested. I am not sure how to write the code for this. I've tried the following: modelA <- lme(FT~ Init.Age + Sex +…
Lili
  • 547
  • 6
  • 19
0
votes
1 answer

How to get predictions in NLME at the correct level instead of NAs?

I have a simple experiment (here is some made-up data) with 3 locations ("loc"), blocks within locations ("block"), a set of 8 treatments ("treat), and a response variable ("response"). An exponential plateau function was adjusted to this data…
Giuseppe Petri
  • 604
  • 4
  • 14
0
votes
1 answer

Calculating confidence intervals around lme.dscore Cohen's D for mixed effect models in nlme

I have a mixed effects model that I have calculated effect size using the package EMA tools and lme.dscore. However this only returns a single value of d and I would like the upper and lower CI as well. Is there a way to calculate this? Thank…
0
votes
1 answer

Nonlinear mixed model without random effects structure specification

I would like to fit a nonlinear model just with the fixed structure specification using nlme R package. model <- nlme(y ~ Asym/(1+exp((xmid-x)/scal)), data = data, fixed = list(Asym + xmid + scal ~…
user1157485
0
votes
1 answer

Cannot get ggpredict to work with results from lme model (after updating R)

I recently updated R, and now ggpredict gives me error when calculating the predictions for my mixed effects model (using lme() function). I want to analyse how anitoxidant activity varies between (plants at) different sites. In order to do that, I…
Mikel
  • 1
  • 3
0
votes
1 answer

LME error in model.frame.default ... variable lengths differ

I am trying to run a random effects model with LME. It is part of a larger function and I want it to be flexible so that I can pass the fixed (and ideally random) effects variable names to the lme function as variables. get() worked great for this…
TBP
  • 697
  • 6
  • 16
0
votes
1 answer

Nlmer rises is.numeric(nlpars <- start$nlpars) is not TRUE

When using nlmer: nlmer(velocity~musclemass+musclewidth+(1|muscletype)+(1|observer)) the error: Error in nlformula(mc <- match.call()) : is.numeric(nlpars <- start$nlpars) is not TRUE arises. What could be wrong with my model? I did not…
Veer
  • 1
  • 1
0
votes
0 answers

Is there a way to address overdispersion in a gls model?

I have autocorrelated data that show a positive linear increase. When I model them using gls, I think the summary shows overdispersion. When using GLMM etc I'd change error structure, but I don't think I can change family in gls. Is there a way…
Laura
  • 1
  • 1
0
votes
0 answers

How to obtain confidence intervals for non-linear mixed model (logistic growth curve) with an interaction

I'd like to calculate confidence intervals using the delta method, or bootstrapping, for a non-linear model (logistic growth curve) with a two-way interaction, but am unsure of how to code this. This post is similar to this one…
S.Bird
  • 102
  • 8
0
votes
0 answers

error in gls with unstructured correlation

I desperately need help. I have a continuous Response variable, a fixed Treatment effect (factor variable with three levels), a fixed Time effect (factor variable with nine fixed time points), and a Subject effect which is the random effect (I have…
user3339391
  • 11
  • 1
  • 2