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
0 answers

Specific, custom contrasts in EMMEANs w/ multiple nested factor levels

Here is my data frame: rearing.temp<-c("15", "15", "15", "15", "15", "15", "15", "15", "19", "19", "19", "19", "19", "19", "19", "19") source<-c("field", "field", "woods", "woods", "field", "field", "woods", "woods", "field", "field", "woods",…
0
votes
1 answer

How to do specific, custom contrasts in EMMEANs with multiple nested factor levels but without subsetting data

Here is my data frame (my real DF has way more data points): rearing.temp<-c("15", "15", "15", "15", "19", "19", "19", "19") source<-c("field", "field", "woods", "woods", "field", "field", "woods", "woods") …
0
votes
1 answer

Problems with the lme function with nested variables: (any(notIntX <- !apply(X, 2, const))

I'm trying to fit a mixed-effects model in which I have covariates that are nested (VarX5 | VarX6) and are considered fixed effects. However, I am trying to adjust the data and the following message…
user55546
  • 37
  • 1
  • 15
0
votes
0 answers

Error in Initialising correlation structure in nlme

I am trying to run a regression (using the gls function in nlme) in which I account for shared phylogenetic history, and my tree isn't ultrametric. I made the correlation matrix myself (because some of my data points are along the same branch of a…
0
votes
1 answer

Error correcting for spatial autocorrelation with gls function in the nlme package

I am trying to connect for spatial autocorrelation using the gls function in the nlme package using the following code: modelExp<- gls(avg_diff ~ burnsev/Species, data= burn, na.action = na.omit, correlation =…
0
votes
0 answers

Can't seem to figure out how to use lapply with gls()

Hello I would like to regress each of the first 685 columns in a data set on a specified column contained in the data set. For example, I use lapply to collect the regression of the first 685 variables in the data set on variable mktrfbeta: So, if…
0
votes
1 answer

How to include the longitudinal effect into a linear mixed effect model

I need to ASSESS THE LONGITUDINAL CHANGE IN FAT BETWEEN 2 VISITS with a linear mixed effects model. I have some that will change from visit 1 to visit 2, as they are hypertension status, diabetis status, bmi, waist circunference, smoking_status etc.…
Lili
  • 547
  • 6
  • 19
0
votes
0 answers

Multiple random effects in a linear mixed model with nlme and lme4

I would like to study differences in fat between 2 visits with a linear mixed effects model. So everything would start as lme(fat~, now... for the coefficients, I have some that will change from visit 1 to visit 2, as they are hypertension status,…
Lili
  • 547
  • 6
  • 19
0
votes
0 answers

Can I reuse the Input withing params in a gnls?

a question I assume to know the anser, but none could tell me why. To make it short, I employ an example from Pinheiro & Bates (2000). library(nlme) fm1Dial.gnls <- gnls(rate ~ SSasympOff(pressure, Asym, lrc, c0), data =…
Qiyuan
  • 109
  • 10
0
votes
1 answer

Specifying that model is logit transformed to plot backtransformed trends

I have fitted a lme model in R with a logit transformed response. I have not been able to find a direct command that does the logit transformation so I have done it manually. logitr<-log(r/1-r) I then use this as response in my lme model with…
0
votes
1 answer

Error: $ operator is invalid for atomic vectors using ggplot2

I am a running a linear mixed model analyses using the nlme package in R. I get the above error when I try to plot the results from my model using ggplot. I have looked at other posts on stackoverflow but cant seem to see what the error is here. …
shrutigarg
  • 11
  • 3
0
votes
1 answer

Why does the degre of freedom of one level of a cathegoric variable is different from the other levels in lme?

I am doing mixed models with nested random effects. When I run the summary of the model I see that the number of degrees of freedom of the level "control fishless" of the variable "treatment 1" is 11 while the four other levels' df is 51. I would…
0
votes
1 answer

Bootstrapping "lme()", nlme, by lmeresampler

Does anyone know how to bootstrap a linear mixed-effect model constructed by lme function (nlme package)? Half year ago I was able to do that by "bootstrap" function from "lmeresampler" package, but it doesn't currently run with the same data and…
Mmm
  • 11
  • 1
0
votes
1 answer

How to restrict the number of comparisons between estimated marginal means using emmeans

I'm analyzing longitudinal hormonal data using lme (time entered as a categorical covariate), and would wish to test for the differences between study groups (control group and two experimental groups) as well as visualize the difference using…
jajoko
  • 1
  • 3
0
votes
0 answers

How can I get the relative importance of the predictors of a generalized least squares (gls) model?

I am currently running some generalized least squares (gls) models with a spatial correlation structure, using the R package nlme; they look like the following one: bodymeanee2 <-gls(BS_mean_SCALED ~ LAT2_SCALED + LAT_SQUARED2_SCALED +…
Diego Cepeda
  • 35
  • 1
  • 8