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

lme specifying correlation structure for three-level model

I'm new to R and to multilevel modeling. I have a data set where I have a dependent variable y and predictor x, both of which are measured one time per day over a number of days within subjects. In addition, each subject is part of a twin pair. So…
katyt
  • 11
  • 1
1
vote
1 answer

What do the operators + * and : do in gls function

My code looks like this: Endo.v.Mass_Extant_Stages<-gls(log.Endo~log.Mb+Stage, data = CrocOntogenyData) My results change based on whether I'm using a +,*, or : between log.Mb (continuous) and Stage (categorical). Does anyone actually know what…
Arthur Erb
  • 21
  • 1
1
vote
1 answer

ggeffects::ggpredict() doesn't return population level prediction intervals for nlme::lme()

I'm trying to get population level prediction intervals (PI) from ggeffects:ggpredict() using type = "re" from an nlme:lme() model. ggpredict is not returning the expected data for the lme() model, while the equivalent lmer() model works fine. My…
Jem Arnold
  • 13
  • 1
  • 4
1
vote
0 answers

gnls model with tree measurements data

Im want make a model for understand the behaviour of trees (forest) data from Colombia. Im check information about this and suggest me make a Kozak model and run it. I get it with library(forestmangr) But I need present a model like gnls of nlme…
1
vote
1 answer

R: Mixed effects model with autocorrelated errors in nlme Package: How do I check model the ARMA assumptions?

I am setting up a LME model with the following structure in R, using the package nlme: model <- lme(y ~ x, random = ~ 1 | group, data = data, correlation = corARMA(form = ~ x | group, p=1, q=1) Comparing AIC values, this model seems to compare…
Pibil
  • 11
  • 1
1
vote
1 answer

Using purrr::possibly() to catch non-positive definite matrix

I am doing a stratified analysis of a mixed effect model using nlme's lme function and thus employing purrr's map function. At times, the number of observations is too small and I get errors from nlme that the matrix is non-positive definite. One of…
phargart
  • 655
  • 3
  • 14
1
vote
2 answers

how to apply lme function to each column of dataframe?

I'm using the lme function from the nlme package and having a hard time trying to apply it to each column of my tibble. I can successfully run it 'manually' with a single column, but fail when trying to use purrr::map. I feel like something is right…
phdj
  • 199
  • 1
  • 12
1
vote
0 answers

Fitting a NLME model in jags

Generate some data ##### Load packages library(nlme); library(lme4) library(dclone) ### GENERATE SOME DATA ## Example data with a weibull curve k <- 120; nindivs <- 30; pwr <- 0.2 a <- 500 set.seed(123) sim.data <-…
Constantin
  • 132
  • 9
1
vote
2 answers

Extracting individual growth constants using population growth curve model in R

I would like to derive individual growth rates from our growth model directly, similar to this OP and this OP. I am working with a dataset that contains the age and weight (wt) measurements for ~2000 individuals in a population. Each individual is…
Blundering Ecologist
  • 1,199
  • 2
  • 14
  • 38
1
vote
0 answers

Coefficient matrix not invertible with a corARMA model

I am currently working on a project involving the nlme package in R. The acf plots are showing that there is autocorrelation, so I've decided to define an autocorrelation structure by using an autoregressive moving average (ARMA) correlation…
1
vote
1 answer

How to resolve GLMM residuals pattern , spatial correlation and zero distance error?

When I conducted data analysis, I encountered an serious problem. I want to research how a Treatment intensity would influence response variable y. The field investigation was conduced at different SITES on two years in long time ago. According to…
PeterPanPan
  • 151
  • 4
1
vote
0 answers

summary of nlme model not producing fixed effects

I am trying to extract fixed effects from two nlme models. my reprex is SAC<-data.frame( row.names = c("1", "3", "4", "5", "6", "7"), SZCug_dL = c(46.875, 50, 65.625, 62.5, 40.625, 62.5), UrineZN_Cr = c(545.719546038266, …
1
vote
1 answer

Plotting a 95% confidence interval band around a predicted regression line from a linear mixed model

To make the results that I obtained from a linear mixed model more insightful, I'm trying to plot the predicted values with a 95% confidence interval. The data and the model that I specified look as…
tcvdb1992
  • 413
  • 3
  • 12
1
vote
1 answer

Doing multiple regression models (8 in total: 2 models containing different predictors and on 4 different outcomes) more efficiently

For my current projects I'm repeatedly specifying regression models with differing amounts of predictors/covariates on different outcomes. Right now I'm just writing out each model in full, but I'm sure there is a (very much) faster way requiring…
tcvdb1992
  • 413
  • 3
  • 12
1
vote
0 answers

Specifying the identity variance-covariance matrix for nlme::lme in R?

I am assembling an R code file that exhibits various common variance-covariance (VCV) structures for use in nlme::lme. I currently have what I believe to be correct code examples for scaled identity, diagonal, compound symmetry, heterogeneous…
wobbrock
  • 11
  • 3