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

Plotting beta coefficients from lmList?

I have used the following code to compute coefficients for a logistic regression: model<-lmList(VariableD ~ VariableE + VariableF + VariableG | Participant, database, family = binomial(link = "logit")) A sample of the output is: (Intercept) …
Chester
  • 67
  • 6
1
vote
1 answer

Multilevel R squared error in package 'mitml'

I am trying to use the package 'mitml' in R to calculate R squared measures for a multilevel model. I have tried using lme4 and nlme to specify my models. However, when I use lme4 to specify the model the R squared values are the same across all 4…
1
vote
1 answer

Updating nlme models after using reformulate()

Having a small issue with updating nlme models after using reformulate in the formula argument of lme() Here is some data set.seed(345) A0 <- rnorm(4,2,.5) B0 <- rnorm(4,2+3,.5) A1 <- rnorm(4,6,.5) B1 <- rnorm(4,6+2,.5) A2 <- rnorm(4,10,.5) B2 <-…
llewmills
  • 2,959
  • 3
  • 31
  • 58
1
vote
0 answers

How do I isolate pairwise differences after conducting a linear mixed model analysis?

I have collected data looking at the effect of three dietary treatment groups on protein synthesis across three time points. Because I have missing data, I have elected to conduct a linear mixed model analysis on the data as opposed to a two-way…
1
vote
2 answers

Extract a column from lme4 summary in R

I was wondering what is the most efficient way to extract (not print like HERE) only the Std.Dev. column from the vc object below as a vector? library(lme4) library(nlme) data(Orthodont, package = "nlme") fm1 <- lmer(distance ~ age + (age|Subject),…
rnorouzian
  • 7,397
  • 5
  • 27
  • 72
1
vote
0 answers

How to account for both spatial and temporal autocorrelation at the same in lme?

I would like to know how to account for both spatila and temporal autocorrelation at the same time using autoregressive models by lme() function. To account for the spatial autocorrelation, I use corSpher model_temp<-lme(Y~X1+Year, …
1
vote
1 answer

visualising linear mixed model in R

I am running a linear mixed model for a dataset Developmental trajectory of 2 groups- assessed at 3 timepoints on a number of different measures. Predictor variables are age and maternal education. I am using nlme and ggplot2 packages. Here is my…
shrutigarg
  • 11
  • 3
1
vote
0 answers

Error in X %*% fixef(object) : non-conformable arguments

I get this error when I try to predict the nlme. And I don't know how to solve it my code is the following: mod1.lme <- lme(pRNFL~ status + Time:status, random= ~1|DBID/Eye_ID, data = long, na.action =…
Lili
  • 547
  • 6
  • 19
1
vote
0 answers

Error with nlme: nlminb problem, convergence error code = 1 message = singular convergence (7)

I have a linear mixed model lme (from package nlme) with distance (log 10 transformed) as the response variable, a factor variable pre or post translocation as a predictor, time log10 transformed as an offset fixed effect, and then two nested random…
Brooklyn
  • 11
  • 3
1
vote
0 answers

Problem with flat residuals using lme with varIdent

i am having a weird problem running a hierarchical (mixed) model with nlme package. When adding heterogeneus variance along a factor, the residuals become flat in one of them. Here is the code: Creating data frame x <- data.frame("time" =…
Facu
  • 101
  • 6
1
vote
0 answers

R studio: First time running tests with Dependent variables. Using lmer and nlme packages. Some questions

I am trying to work with a dataset (see below). The Locality includes Rapsfeld and Bluhflache fields, which are not independent. I am setting SiteID as the random factor. I ran the test with both lmer and nlme packages, as this site explains:…
RBrock
  • 11
  • 1
1
vote
0 answers

How to model the residual variance using varFunc from nlme?

To see whether a linear trend exists between age and quartiles of some variable, I fitted a linear model using lm. Plots of the residuals against fitted values as well as residuals against the quartiles indicate heterogeneity of variance. This…
Dion Groothof
  • 1,406
  • 5
  • 15
1
vote
0 answers

How to get AIC or BIC for glmmPQL (from nlme package)

I am using glmmPQL (from nlme package) to run a multi-level glm with a dummy outcome. Unfortunately glmmPQL does not provide fit measures such as AIC, or BIC. I was wondering if there is a package that can calculate AIC, and BIC fromglmmPQL results.
UseR2001
  • 29
  • 4
1
vote
0 answers

Functions can't be found, but the packages are certainly installed and loaded

I'm trying to predict values with a linear mixed model and new data, but I keep getting errors that both functions I'm trying (predict.lme from nlme, and predict.merMod from lme4) do not exist. The packages are installed and loaded. I first tried…
Melissa
  • 41
  • 4
1
vote
2 answers

Was plot.ACF removed from the front end of NLME? Or did I change some setting on accident?

I'm using R to analyze a linear mixed effects model (nlme::lme). I want to plot the ACF values with a dashed line at the alpha level (as plot.ACF does). After I require(nlme), I can run ACF, but plot.ACF is still not available. I can access it via…