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

Error message with qqnorm

I have used the lme function in the nlme package to create a linear mixed effects model of data from a two-factor biological experiment, where both factors are categorical: model<-lme(responsevariable~factor1*factor2, data=dataset) I am trying to…
Rob M
  • 11
  • 2
1
vote
1 answer

extract variance components from lme

I have measurements of a given trait (TRAIT1) in individuals from different genotypes that were reared at either temperature1 or temperature2. I want to test for the effect of genotype (random effect) and temperature (temperature is crossed with…
1
vote
3 answers

Making a loop for lme() in r

I am trying to use lme function from nlme package inside a for loop. I have tried (almost) everything now, but without any luck. Without the loop my lme function are working fine. I have 681 different lipids to analyse, so i need the loop. Bonus…
Witzan
  • 33
  • 1
  • 5
1
vote
1 answer

Random effect predictions from gamm model error: cannot evaluate groups for desired levels on 'newdata'

I am trying to generate predictions from a gamm model (from the mgcv package) using the newdata argument. I would like to make the predictions on the lme part of the model, so that the predictions include the random effects. I am, however, running…
user2957945
  • 2,353
  • 2
  • 21
  • 40
1
vote
1 answer

Display MY model-based predictions with ggvis?

I'd like to display the prediction lines of a model on a ggvis plot, so I can dynamically change the scale on the x-axis. I can plot the model predictions in ggplot easily enough: But when I try to do it in ggvis, I get strange behaviours - I…
Nova
  • 5,423
  • 2
  • 42
  • 62
1
vote
0 answers

Using a random factor in lme

I have a problem which is extra irritating, as my colleague gets all done properly in an old standalone version of JMP, but I can't get it right in R :-( I have a dataset with measurements per site per year: SITE Year N 1 8 1990 7.33 2 8…
1
vote
1 answer

Error in pars[, nm] : incorrect number of dimensions

I am new to coding as well as posting on forum but I will do my best to explain the problem and give enough background so that you're able to help me work through it. I have done a lot of searching for solutions to similar errors but all of the code…
1
vote
1 answer

gls object produced with wrapper function fails for prediction with new data

In the following example, I'm using a wrapper function to fit a gls object. I can successfully return the model prediction for the original data, but not when using newdata, which returns the error "Error in eval(expr, envir, enclos) : 'nthcdr'…
Marc in the box
  • 11,769
  • 4
  • 47
  • 97
1
vote
0 answers

How to use the `vcconv` command in lme4 for serial correlation?

I'm working with a large longitudinal dataset of firm-year observations. For some time now I have been using lme4to implement crossed (non-nested) effects for year and firm-ID groups. My goal is now to correct for the serial correlation in the…
Tony Beans
  • 175
  • 1
  • 11
1
vote
1 answer

dredge an nlme model with multiple parameters

Disclaimer: Firstly, I have tried to create a mock dataset for a reproducible example, but whenever I create a random set or take a portion of the real data, the model does not converge. I can't see a way of providing the necessary material for a…
1
vote
1 answer

Model matrix has multicollinearity

I am using lme function in R to run a model: f0 <- lme(value ~ -1 + cs_d0 + va_d0 + cs_d0:visitmse + va_d0:visitmse + cs_d0:ageb + va_d0:ageb + + cs_d0:lesionse + va_d0:lesionse, random = + ~ -1 + (cs_d0 + va_d0) + visitmse:(…
R. Saeiti
  • 89
  • 3
  • 11
1
vote
1 answer

How to include heteroscedasticity in the predict function of a mixed model in lme

Helloy everybody, I plotted a mixed model from "nlme" with "ggplot2" and I would like to consider different variance in my category variable in the model (weights=varIdent(form = ~1 | category)). When I checked the plot I realised that the model…
Kev
  • 425
  • 3
  • 8
1
vote
1 answer

different random effects in nlme and lme4

I fit this model in nlme: library(nlme) data("Machines") fit1 <- lme(score ~ - 1 + Machine, random=~1|Worker, data=Machines) I can get the coefficients with > fit1$coefficients $fixed MachineA MachineB MachineC 52.35556 60.32222 66.27222…
spore234
  • 3,550
  • 6
  • 50
  • 76
1
vote
0 answers

Illustrate back transformed GLS with visreg()

I have a GLS with a logarithmic transformed dependent variable. Using visreg() for visualization gives an error code: library(visreg); library(nlme) fit1 <- gls(log(Ozone) ~ Wind , data=na.omit(airquality)) …
Stefan
  • 13
  • 4
1
vote
0 answers

R: Decomposing an interaction using nLme and multcomp

I'm trying to understand an interaction for a mixed-design study. variable is a repeated measure and status is between-subjects factor library("multcomp", lib.loc="~/R/win-library/3.2") library("nlme", lib.loc="C:/Program…
Derek
  • 11
  • 2