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

What is a dimnames error when estimating GLS?

I've Googled around quite a bit and can't find documentation on this. I'm trying to estimate a feasible generalized least squares (FGLS) model on cross-sectional time series data in R. For example: library(nlme) foo <- gls(Y ~ factor(panel_ID) + X1…
Matt
  • 646
  • 4
  • 11
1
vote
1 answer

How to extract metafor::rma.mv() equivalent of lme4::VarCorr() for multilevel mixed effect meta-regression with random slopes

I am attempting to calculate pseudo R squared's for a multilevel mixed-effect meta-regression that includes random slopes in the metafor package (i.e., rma.mv() object) using a similar approach to the following…
zr2015
  • 13
  • 3
1
vote
1 answer

fitted mixed models in the sommer package

I have observed in the literature that the sommer package brings possibilities associated with the inference of the parameters of a mixed model, in comparison with classic packages: nlme or lme4. Due of this, I'm trying to adjust some models via the…
1
vote
0 answers

Fit a spatial model in spaMM, glmmTMB, or R-INLA

I have a dataset that contains two sites (i.e., sites 1 and 2). The data in each site is arranged in a row-column layout (e.g., 3 rows by 4 columns). Below is an example for my dataset, where trt is the main factor of interest, and row, column, and…
nhavt
  • 349
  • 2
  • 10
1
vote
1 answer

Converting mixed model with correlation structure from nlme to glmmTMB

I wanted to use predict on some averaged models which were built in nlme to plot confidence intervals of modelled relationships. But, I've found this is not possible using nlme and MuMIn::model.avg. Instead, I plan to use glmmTMB, as suggested here.…
pajul
  • 123
  • 9
1
vote
0 answers

using sjPlot with different random covariance structure

In a mixed model design, I changed the random covariance structure to diagonal: library(sjPlot) library(nlme) model<- lme(fixed= DV~ IV1*IV2+ IV3 + IV4 + IV5, control=list(opt="nlminb"), data=data, random =…
Elad
  • 33
  • 6
1
vote
1 answer

exponential decay - from NLS to nlme

I am somewhat familiar with lme4, but not with the nlme package, and I struggling to fit the mixed-effects that I desire. I ran the following model with NLS. (Comments about the starting values are welcome too) m3 <- nls(s ~ f0 + f1 * 2^(-MINUTES /…
jtjtjtjt
  • 105
  • 6
1
vote
1 answer

How to use correlation argument of nlme model in rpy2

I want to estimate the model fit <- nlme::lme(y ~ T + t, random = ~ 1 | sub, correlation = corAR1( form = ~ 1 | sub)) in rpy2. I am running the following without problems: formula = robjects.Formula('y0 ~ T + t + c0') random =…
1
vote
2 answers

Use of "algorithm = 'port' and control lower limit in nlsList

I am using the data from How can I get the coefficients from nlsList into a dataframe? library(nlme) dat<-read.table(text="time gluc starch solka 1 6.32 7.51 1.95 2 20.11 25.49 6.43 3 36.03 47.53 10.39 6 107.52 166.31 27.01 12 259.28 305.19…
hnguyen
  • 772
  • 6
  • 17
1
vote
1 answer

variance function on a mean polynomial (nlme R package)

I want to fit a variance function that involves polynomial terms of the mean I know that I can fit the variance function using varExp() (without arguments). Reading the documentation of varExp() it defaults to ~ fitted(.), however using varExp(~…
Nicolas Molano
  • 693
  • 4
  • 15
1
vote
1 answer

confint vs intervals for gls (nlme package) models

There are two methods available to estimate confidence intervals for a gls model in R: using function confint and function intervals. The results are not the same and I want to know what are the causes of the differences and which one is the…
1
vote
1 answer

ggpredict not working as expected for lme, however works for lmer

I was fitting a mixed model with random intercept and random slope for longitudinal data using the nlme package in R, similar to the model below (using an artificial and very small dataset for illustration, but the types of variables are…
yentl02
  • 25
  • 4
1
vote
0 answers

Single-level expression of linear mixed model with addition of covariates

For the Oats dataset in nlme, page 162 of "Mixed-effects models in S and S-PLUS" provided a way to express multilevel model through single-level expression in nlme. More specifically, the following is a multilevel model in which Variety is nested in…
Patrick
  • 1,057
  • 9
  • 23
1
vote
1 answer

Why running into convergence issue in nlme?

I am using nlme to run the following models: library(nlme) fm4Oats <- lme( yield ~ nitro, data = Oats, random = ~ 1 | Block/Variety ) fm4Oats2 <- lme( yield ~ nitro, data = Oats, random = ~ nitro | Block/Variety ) fm4Oats3 <- lme( yield ~…
Patrick
  • 1,057
  • 9
  • 23
1
vote
1 answer

How to determine if a linear mixed model is overdetermined in lme4/nlme?

In the Orthodont dataset in nlme, there are 27 subjects and each subject is measured at 4 different ages. I wish to use this data to explore at what condition the model will be overdetermined. Here are the models: library(nlme) library(lme4) m1 <-…
Patrick
  • 1,057
  • 9
  • 23