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: incorrect factor names with NA?

Basically, I am running nlme::lme with a missing value. The model fits fine with na.action=na.omit, but how come the name of the fitted/residuals/coef all seem to be shifted by a row? ## Generate data…
qoheleth
  • 2,219
  • 3
  • 18
  • 23
0
votes
2 answers

extract estimate of a gls

I'm trying to extract a parameter from a model fit by ML which has a correlation structure obtained from corPagel (defined in package ape). The parameter of interest is within the element named apVar in the summary. library(ape);…
Santi XGR
  • 185
  • 2
  • 13
0
votes
1 answer

lme - Error: object of type 'closure' is not subsettable

I am trying to run a linear mixed-effects model (package nlme) but I am repeatdly getting the Error: object of type 'closure' is not subsettable. > apoeht <- read.csv("apoeht.csv") > library(nlme) > model.a <- lme(Timmrec ~ age, data = apoeht,…
Andrews
  • 325
  • 3
  • 13
0
votes
1 answer

Two random terms with nlme

I am performing a mixed model with nlme package in R. My situation is: The mixed model is: MY = DFC + DFC2, random=~DFC|Animal, data=my_data) where Animal is the random effect. However, if I write the model like this, I can only obtain random…
hn.phuong
  • 835
  • 6
  • 15
  • 24
0
votes
0 answers

Multivariate mixed model using nlme

I have two correlated response variables (y1,y2) explained by the same covariate set (x1,x2), each with mean = 0. I have a random grouping factor ('group') which is heteroskedastic (group ~ N(0,sigma_u1) for y1 and N(0,sigma_u2) for y2). I would…
user969524
  • 75
  • 1
  • 2
  • 6
0
votes
0 answers

The names of the levels in a factor variable matter

I have fitted an lme model using a factor variable studytreat. It appears in the model in two places, as a fixed effect, and also to model heterogeneity in the residual variance so that each level of studytreat has its own variance. This is the…
0
votes
0 answers

nonlinear mixed model using R?

I have a data set like this example data, which includes three sites. I want to model the trend of "cumSR" along "timeInt". I did it for each site using the following model ("cumSR~b/(cc+(timeInt)^(-z))"). Now I want to use the same model to get…
Jian Zhang
  • 1,173
  • 5
  • 15
  • 20
0
votes
1 answer

Fitting repeated measures in R

Fitting repeated measures in R, convergence issues. I have the following fit which is one of many datasets and it doesn't converge. I do other sets that do. This dataset and model work in SAS... Could I get some direction in what to do to have this…
user2945234
  • 418
  • 6
  • 12
0
votes
1 answer

R error in lme function: NA/NaN/Inf in foreign function call (arg 3)

I'm running linear mixed model in nlme package. control <- lmeControl(maxIter=100,opt = c("optim")) lme(response ~ 0+factorA+covariate,random=~1|factorB, weights=varIdent(form= ~1|factorA),control=control), And, it come an error as…
Colin
  • 107
  • 2
  • 3
  • 5
-1
votes
1 answer

How to ensure reproducibility of nlme() function calls?

I recently began using the R package {nlme} to fit non-linear mixed-effects models with random effects. I have discovered that running exactly the same nlme() function call (i.e., the same line of code: same data, model, and starting parameters)…
Dan K.
  • 19
  • 3
-1
votes
1 answer

Convert gamlss object to lme?

I have a continuous response with three categorical variables, no random effects. I have fit a gamlss object using the zero-adjusted gamma distribution. Link to data here because it's large. I've can't get the data into a more standard distribution…
Tormey R
  • 11
  • 3
-1
votes
1 answer

2 PK samples for the same patient in Matlab Simbiology: how to calculate intra-individual variability?

Sorry I'm new to MatLab's Simbiology toolbox! I'm trying to build a population pharmacokinetics model that includes intra-individual variability / residual unexplained varibility. Would anyone kindly advise how to input the data if I have two…
-2
votes
1 answer

how to config nlme to give the same results as lme

The question looks naive but I am puzzled with the configuration of the nlme function in R to get equivalent results to a given lme model.
MyQ
  • 459
  • 3
  • 13
-2
votes
3 answers

How do I specify random factors in R?

How do I specify random factors in R ? If I have a factor x1 which is supposed to be random , can I try something like this ? lm(y ~ x1, data = p)
TKBell
  • 33
  • 1
  • 4
1 2 3
32
33