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

Plotting random subset of individual quadratic growth curves in R from lme or lmerMod object?

I would like to plot a random subset of 10 individual's quadratic growth curves from lme4 or nlme in R using either ggplot2 or sjPlot. I know how to do this for a linear line, but not a quadratic one. Obviously the plot below with 105 participants…
1
vote
0 answers

Multiple random slopes & intercepts in lme with crossed variables

I'm creating a linear mixed model using the lme package because I need to specify an AR1 correlational structure and heterogenous variance to the data (it's time series data of 3 separate stimuli). I have 2 variables of interest - CS & sec - that…
chainhomelow
  • 347
  • 1
  • 12
1
vote
0 answers

Error in MEEM when I include a new fixed effect

I am unable to include more than 2 fixed effects in my LME without getting an error. When I include a variable called DD in my fixed effects. I get an error. R recognizes my previous model - which is a simplified model without DD. I know DD is the…
Lili
  • 547
  • 6
  • 19
1
vote
1 answer

Trouble with pairs() function in nlme

I am having trouble getting the pairs() function to work in nlme. Take this example from Pinhiero and Bates Mixed-Effects Models in S and S-Plus. The model itself runs just fine fm1Theo.lis <- nlsList(conc ~ SSfol(Dose, Time, lKe, lKa, lCl), data =…
llewmills
  • 2,959
  • 3
  • 31
  • 58
1
vote
0 answers

I get an error with functions of nlme package in R

I am trying to fit a linear growth model (LGM) in R, and I understand that the primary steps would be to fit a Null model with time as a predictor of my independent variable Y (allowing for random effects) and a Null model not allowing for random…
Federico
  • 11
  • 2
1
vote
1 answer

Passing strings into 'contrasts' argument of lme/lmer

I am writing a sub-routine to return output of longitudinal mixed-effects models. I want to be able to pass elements from lists of variables into lme/lmer as the outcome and predictor variables. I would also like to be able to specify contrasts…
llewmills
  • 2,959
  • 3
  • 31
  • 58
1
vote
0 answers

Using influence.lme (cars package) with cooks.distance function with lme model from nlme in R

I have currently built an mlm using the lme package in R. I am trying to get a measure of cook's distance from this model. I am using the influence function from the cars package, which the documentation says you can read into the cooks.distance…
Lili
  • 11
  • 3
1
vote
1 answer

Moving from SPSS to R: Defining a two-intercept model in gls with random effect and repeated measure

I am new to R and am trying to reproduce results from my SPSS analyses, but seem to be missing something. I am trying to run a linear mixed effects model using gls in the nlme package. The SPSS syntax I am trying to reproduce is: MIXED…
1
vote
1 answer

Cholesky transformed residuals in lmer

I am currently working with linear mixed models (LMM) and want to perform some residual analyses. Since the residuals from linear mixed models "are correlated and do not necessarily have constant variance", they are inadequate to check the…
Phil
  • 595
  • 1
  • 5
  • 15
1
vote
0 answers

R lmer with variance structure

i want to fit a mixed model but with variance structure. I create my data frame DTF <- data.frame(Y = rnorm(7*4, 0, 1), TIME = rep(1:7, 4), GROUP = c(rep(1,7), rep(2,7), rep(3,7), rep(4,7)), X =…
1
vote
1 answer

New Self-start function

I´m following Pinheiro & Bates 2000 pp.345. I want to fit a nls model, and modified a bitt the logistic model. I want to create a self-start function, but an error shows. When I run "logist3P" the error "parameter ‘scal’ does not occur in the model…
1
vote
1 answer

Covariance structure in lme - AR(1)

My response variable is Yijk corresponding to the recovery time of patient i (i=1,...,I) with treatment j (j=1,...,J) and measured at time k (k=1,...,K) I would like to fit the following model:Model equation, where: μ is a global fixed…
Jack4280
  • 35
  • 1
  • 6
1
vote
0 answers

Specify multiple nested random effects in lme with heteroskedastic variance across group

I want to fit a random effects model with two separate nested random effects. I can easily do this using the lmer package in R. Here's how: model<-lmer(y ~ 1 + x + (1 | oid/gid) + (1 | did/gid), data=data) Here, I'm fitting a random intercept for…
quantdaddy
  • 1,375
  • 4
  • 19
  • 29
1
vote
0 answers

How to compute standard error with prediction::prediction() R when using a lme model?

I would like to use the prediction function from the package "prediction" in R (April 19, 2017 - Thomas J. Leeper) and compute the standard error of my predictions. I have an lme model from the "nlme" package. This is an example of how my data…
Luc
  • 33
  • 4
1
vote
0 answers

R Structural Equation Model in R with random effect error

Constructing a nonlinear structural equation model with random error term in R library(piecewiseSEM) library(lme4) library(nlme) head(VTmodelmeansadults) id Round Cycle Day Stage Temp Type Sample Pos md possal posabd mat.max…