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

Function predict() for object of segmented.lme()

I have previously run mixed model analyses using glmer() in package lme4. I applied functions dredge() and get.models() in package MuMIn to quantify the top.models. I then used a model.avg() approach in package MuMIn to create a fitted object for…
tabtimm
  • 411
  • 3
  • 6
  • 17
1
vote
1 answer

Specifying a non-linear relation between random effects in R

I'm working with multilevel models to try and describe different patterns in longitudinal change. Dingemanse et al (2010) describe a 'fanning out' pattern when the random effects are perfectly correlated. However I found that a similar pattern…
Niek
  • 1,594
  • 10
  • 20
1
vote
1 answer

lme: "Error in solve.default(estimates[dimE[1] - (p:1), dimE[2] - (p:1), drop = FALSE])"

When I fit the following model fullmod <-lme(rrF~Old_N_dep+Overstory_old+Altitude+MAT+MAP+EIV_R+EIV_F+Overstory_diff+SCA_old+SCA_diff,data = regdataOver,random = ~ 1|PlotNR, method = "REML") I get this error: Error in na.fail.default(list(rrF =…
Gabriele Midolo
  • 231
  • 1
  • 9
1
vote
1 answer

R: checking model assumptions with nlme

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)) I am fitting a nonlinear…
Adrian
  • 9,229
  • 24
  • 74
  • 132
1
vote
0 answers

how to estimate parameters for groups using nlslist function of r?

I want to fit the curve and estimate the parameters (a, b1 and b2) for each Id group using the following model: y= a + b1*exp^-0.05*dim + b2*dim the sample of my data file looks as follow (wt.txt) Id wt. dim 4 546.5 1 4 542.5 2 4 539…
Alula
  • 91
  • 6
1
vote
0 answers

Inconsistent predictions from lmList and data.table

I'm working on generating predictions from an lmList object holding some variables constant, but am finding inconsistent predictions between using a full cartesian product of data and using only a few rows. It doesn't seem to matter if I use lme4 or…
DP5000
  • 36
  • 6
1
vote
0 answers

Non linear regression with groups by nlsList in R

Take the example of mtcars in R: I want to make a non linear regression for the relationship between mpg and disp for each cylinder and each group of vs. In my case I have a dataframe much bigger than mtcars. I know there is not enough data. But to…
Yang
  • 21
  • 1
1
vote
1 answer

How to report overall results of an nlme mixed effects model

I want to report the results of an one factorial lme from the nlme package. I want to know the overall effect of A on y. To do so I would compare the model with a Null model: m1 <- lme(y~A,random=~1|B/C,data=data,weights=varIdent(form =…
OnLeRo
  • 83
  • 1
  • 6
1
vote
0 answers

How to estimate? "simple" Nonlinear Regression + Parameter Constraints + AR residuals

I am new to this site so please bear with me. I want to the nonlinear model as shown in the link: https://i.stack.imgur.com/cNpWt.png by imposing constraints on the parameters a>0 and b>0 and gamma1 in [0,1]. In the nonlinear model [1] independent…
1
vote
0 answers

Plot longitudinal data per subject

I would like to create a plot that looks like this: I have been trying to do this, but not sure how to do it. So here is my reproducible data: library(ggplot2) library(nlme) mydata <-…
user6121484
  • 143
  • 2
  • 15
1
vote
0 answers

mixed model with repeated measures and randomized blocks

I am trying to replicate a SAS model for a LINEAR MIXED MODEL WITH RANDOMIZED BLOCKS AND REPEATED MEASURES in R. My professor who works with SAS wrote the syntax in SAS for this test. My knowledge of SAS is very poor and hence my attempts in R. I am…
AKARVE
  • 11
  • 1
1
vote
0 answers

NLME GLS Model Formula

I have a script which, given a response variable and predictors, generates all possible model combinations. I have saved all combinations for my data in a list (length 155). I have written a loop which, on each iteration, uses the next formula on…
Simon
  • 991
  • 8
  • 30
1
vote
1 answer

lme with varIdent for repeated measures

I came across strange results when using lme with repeated measures and varIdent. Any help with this will be very appreciated! I am testing whether the 13C signal of leaves along a time series differs between 2 species (A and B). I am basically…
Alba
  • 11
  • 1
  • 3
1
vote
1 answer

Using anova() on reformulated() terms in R

Background: I wrote a wrapper function that allows the user to specify the names of variables in a data set to use as predictors in NLME's lme() function to fit a hierarchical linear model. The relevant part looks like this: predictors <-…
Jon
  • 753
  • 8
  • 18
1
vote
1 answer

Factors in nlme: singularity in backsolve error

I am parameterizing exponential fits for some metabolic scaling models. I have done this in lmer already, without problem, using logged dependent and independent variables. However, I would now like to incorporate other parameters that aren't…