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

Alternative solutions to multilevel modelling due to level 2 and 3 not having enough clusters

I have been running some multilevel models on my data but have now been told my clusters are too small and I need to consider taking out two of the levels and add them in as covaraites (dummy variables).I gave this a shot and it didn't work. To…
0
votes
1 answer

Interpreting 95% CI for model estimated difference between two level factor in linear mixed-effects model

This is my data frame (please copy and paste to reproduce): Control <- replicate(2, c("112", "113", "116", "118", "127", "131", "134", "135", "136", "138", "143", "148", "149", "152", "153", "155", "162", "163")) EPD <- replicate(2, c("101", "102",…
0
votes
1 answer

Comparing script for random intercept and slope independent between nlme and lme4

So for random mixed effects, I am making a comparison list of scripts between the 2 packages. For independent random intercept and slope, if I am using the following code in lme4 package, what is the corresponding script in nlme? model1 <- lmer(y~A…
0
votes
1 answer

Sample size calculation for mixed models - simr package

I am having a model built with nlme::lme, with only one random effect (ID) and one binary independent variable (x). I am now trying to use this model to do a sample size calculation. Linear mixed-effects model fit by REML Data: mydata2 AIC …
GiannisZ
  • 153
  • 5
0
votes
0 answers

NLME predictions at different effect levels in R

I have a simple made-up example of a field plot experiment with 3 locations, 4 blocks within each location, and 8 rates of fertilizer applied to these plots. a response was measured on those plots. This is the data: #dataframe loc <- c("Loc1",…
Giuseppe Petri
  • 604
  • 4
  • 14
0
votes
1 answer

Model fitting: From "nlmer" to "nlme"

How can I fit the following model BUT using "nlme" instead "nlmer"? The data (at the end of the post, you can find the data to reproduce the code written here). dd.gr <- groupedData(y ~ x | id, dd) Define some functions beta.model <- function(cl,…
Nicso
  • 143
  • 9
0
votes
1 answer

Can I use emmeans with LME model?

I am using LME model defined like: mod4.lme <- lme(pRNFL ~ Init.Age + Status + I(Time^2), random= ~1|Patient/EyeID,data = long1, na.action = na.omit) The output is: > summary(mod4.lme) Linear mixed-effects model fit by REML Data: long1 …
Lili
  • 547
  • 6
  • 19
0
votes
0 answers

Emmeans in LME and adjusting for "time since"

I would like to reassure myself that what I'm doing is right. I am applying an LME model to my data. And I would like to know if the use of EMMEANS to get multiple comparisons is right. emmeans(mod1.lme, pairwise ~ Status, adjust="bonferroni") The…
Lili
  • 547
  • 6
  • 19
0
votes
0 answers

Problem analysing LME outcomes when I reduce the number of factors in a variable

I have a variable with 4 factors that I put into the LME model as an independent variable (Status). The outcome in lme gives me 1 factor as a reference value and the other 3 referenced to that one. I have tried to apply 'emmeans' to get multiple…
Lili
  • 547
  • 6
  • 19
0
votes
0 answers

Possible Bug: R CMD check fails on Ubuntu 18.04 LTS when using nlme

Using devtools::check() gives the following error message: R CMD check results 1 error | 0 warnings | 0 notes checking whether package ‘abc’ can be installed ... ERROR Installation failed. See ‘/tmp/RtmpSpjP2M/abc.Rcheck/00install.out’ for…
MYaseen208
  • 22,666
  • 37
  • 165
  • 309
0
votes
1 answer

Can group by and tidy be used to fit multilevel models (lme) to repeated measures/longitudinal data?

Consider the following example longitudinal/repeated measures dataset library(tidyverse) library(broom) library(nlme) data <- read.csv("https://stats.idre.ucla.edu/stat/data/study2.csv") data <- data %>% mutate(dbp =rnorm(120, 30:150), sbp =…
aelhak
  • 441
  • 4
  • 14
0
votes
1 answer

Update model : 3-way interaction terms not dropped

My question is highly related to this one: R update() interaction term not dropped However, I don't have multiple categories in my predictor variables, so I don't understand how my issue relates to the answer. Maybe I'm just not understanding…
Briana
  • 11
  • 1
0
votes
0 answers

How can I change the legend size of qqnorm and pairs plot for LME models

How can I change the size of the labels and the axis in a qqnorm from a LME model? I am using qqnorm and pairs to evaluate the assumptions of LME models, using lme4 or nlme. However, I am not being able to change the axis and legend size using cex…
0
votes
0 answers

Reordering factor levels results in different anova p-value

I have a really bizzare problem. I am running an anova on an lme mixed effects model that has "city" as one of the factors. There are three cities total for this vairable, and the levels are organized alphabetically by defualt. However, if I reorder…
0
votes
0 answers

Summary report for each variable of a lme loop

I followed the suggestion about how make a loop for lme(). With both the suggestion I made my lme loop for my 64 dependent variables. My problem is the summary of the results. In the summary, the P Values are reported with scientific notation. I…