# Questions tagged [lme4-nlme]

lme4 and nlme are R packages used for fitting linear, generalized linear and nonlinear mixed effects models. For general questions about mixed models use [mixed-model] tag.

3,425 questions
Filter by
Sorted by
Tagged with
21 views

### Variance of random intercept in a linear mixed model (LMM) versus fitted random intercepts

I am struggling to understand the relationship between the variance of the random intercept in a linear mixed model (LMM) and the fitted random intercepts of the clusters. Suppose the following model. ...
6 views

### Assigning variance-covariance matrix in generating artificial data for mixed-effect model

I can’t understand specifying correlation between within-participant conditions when generating artificial data for mixed-effect model regression. It would be grateful if you could help me. My story ...
• 21
1 vote
28 views

### GLS Function - Fitting and Interpretation Issues

I am well aware, that this is a FAQ, but other questions could not provide me answers to my question. Also, I hope this will not be considered a double post, since I have posted this issue with a ...
• 83
29 views

### Linear Mixed Models: Accounting an effect as a random intercept or slope

My goal is to test whether reaction is significantly different between tasks (a, b, and c). However, the order in which I run the tasks in my experiment may affect the reaction. But I'm not interest ...
1 vote
19 views

### How well does my model fit? Specifying a null-model in non-linear mixed models

I want to fit a model y ~ b * exp(-exp(a) * x), but including a random effect, with this data: ...
• 23
11 views

### how to calculate means for mixed effect model [closed]

I'm analyzing data from a randomized controlled trial, the outcome was continuous and was measured four times during the trial. I used multiple imputation to handle missing data, and used mixed effect ...
1 vote
36 views

### Checking for temporal autocorrelation in experience sampling data - how to interpret the variogram?

I have day-level data from about 100 participants from 11 days (EDIT. a subset of participants responded for 12 days, which is why there's a distance of 11 in the variogram table). I'm interested in ...
• 1,471
1 vote
44 views

### Why does centering predictors resolve non-convergence in lme4?

I run quite a few mixed models in lme4. I've found that fairly often models don't converge unless the predictors are centered. I found online that convergence warnings can sometimes be resolved by ...
• 472
24 views

### Multivariate analysis with lmer and lmerTest

I'm dealing with compositional data (data that sum to 1). They are inherently multivariate. One way to analyse compositional data is with a ilr (isometric log-ratio) transformation. I'm following the ...
• 11
21 views

### Random effect variance with or without fixed-effects intercept

I'm fitting some hierarchical models in R using lmer, and am trying to understand why the results change as they do when I either include or exclude a fixed-effects ...
• 11
8 views

### Structuring new data when predicting via predict.merMod

I am trying to obtain predictions, given new data, from within a loop using the gamm4() function in the mgcv package of R. However, I run into an error message ...
• 131
12 views

### Are these glmer and mblogit models equivalent?

I'm trying to eventually fit a multinomial mixed effects model. It seems mclogit::mblogit can do this, so I'm trying to compare it with ...
• 1,572
22 views

### When analysing time series data with lme4, how do you include both a step-change and a slope-change?

I have some time series data including four different locations. There is an intervention at a certain point in time (different in each location). ...
• 535
24 views

### Significant effects but very small differences between contrasts

I am puzzled by some results and I would like to ask for some advice. I have been fitting linear mixed-effects models on a rather small dataset (N = 30) and unlike I have seen before, pretty much all ...
• 123
66 views

### Random intercept

I have the following model, how do I add a random intercept(no random effects included yet): ...
1 vote
10 views

### Is repeated measures appropriate for testing for a difference in repeated paired group measurements?

I'm new to repeated measures and am trying to understand how it maps to lmer. I have measurements from two time periods: $t_1, t_2$. At each measurement period, the same 50 different foods are scored ...
112 views

### Error: PIRLS loop resulted in NaN value in GLMM (glmer) model with Gamma distribution

I have a problem fitting a GLMM model with a Gamma distribution (my outcome variable is strictly positive and right-skewed) and an identity link using glmer in R. ...
1 vote
32 views

### Possible to estimate random effects of a two-level factor? [closed]

I want to conduct a two-way ANOVA with a mixed effect model using lme4. The trial detail is Factor A with 3 levels and Factor B with two levels (3x2) replicated on ...
• 11
24 views

### What is the correct way to analyze this data in a mixed model approach?

I have an experiment with rates of an waste in complete randomized blocks designs, with evaluation of soil fertility and tree heights/diameters over the years. Which is the best model to fit this data?...
1 vote
53 views

### Specifying a model with random effects for a strip-plot designed experiment in R

I am currently trying to understand the analysis of strip-plots (in R) and I came across the example described here (https://www.statforbiology.com/_statbookeng/a-brief-intro-to-mixed-models): ...
• 23
49 views

### Nonlinear relation between two variables as affected by two interacting treatments

I experimentally tested the relation between dependent variable y (continuous) and independent variable x (continuous) for 6 replicates x 2 genotypes (categorical) x 3 species (categorical) each (= ...
• 53
53 views

### ANOVA, ANCOVA, linear mixed effect model

I experimentally tested the relation between dependent variable $y$ (continuous) and independent variable $x$ (continuous) for $10$ replicates of $2$ plant varieties (categorical) of $3$ species (...
• 53
30 views

### Rank deficiency and interaction term not estimated

I am trying to inspect the data from a 2 x 2 factorial design. The experiment was run by other researchers and the design was settled upon before. Participants were tested 3 times using 3 different ...
23 views

### Plotting confidence and means from logistic regression in ggplot2

My data are for an experiment asking participants to detect a tone (Response= 1 or 0) in different (within-participant) conditions. I am interested in how participants' scores on separate ...
• 472
84 views

### Modeling repeated measures data in R - Interpretation and Validation

I am currently working on a control-case study where patients and controls are assessed at five different time intervals. The aim of the study is to assess possible differences in the response ...
• 181
1 vote
36 views

### Understanding equatiomatic output

I have fit a lmer model as follows: ...
• 79
87 views

### How to add interaction and covariates to linear mixed effects model in R

I have some data ($x$ and $y$) collected over multiple days for multiple people. I want to test whether the contemporaneous associations between $x$ and $y$ (measured daily) is stronger depending on ...
• 31
101 views

### Cautions or considerations when setting coefficients from linear model into the fixed-effects component of a mixed effects model

A straightforward (single level) regression model, showing the connection between the reading scores of Year 5 students and their corresponding scores when they were in Year 3. Might be formulated ...
• 63
1 vote
25 views

### Interpretation of Intercept in mixed model with repeated contrasts

I am running the following logistic mixed model in lme4: ...
• 472
48 views

### Mixed Effects model with and without nesting: assumptions and residuals?

1. Residual distribution for mixed effects model with nested random effects - why do they look like this? Does it matter? Code: ...
• 85
42 views

### Correlations Fixed Effect

I am fitting a generalised mixed linear model using the lme4 package and glmer. Each time I fit the model, I get this error ...
• 885
56 views

### Solutions to a 'singular fit' in generalized linear mixed-effects models

What are common causes of a 'singular fit' in generalized linear mixed-effects models (GLMMs), especially when including random intercepts for grouping variables? When using the ...
• 177
28 views

### What does it mean that deviance(model) = NA?

I am trying to run a GLM model using the lme4 package. My variable is so I used a Poisson distribution, However, I'm encountering an issue with a significantly ...
• 33
1 vote
89 views

### How to interpret the output of 'Linear mixed model fit by REML' in R?

I made a mixed model to investigate the effect of 2 interventions (strength or endurance) on physical activity. Here are descriptions of my variables: PA = Physical Activity (measured in minutes of ...
59 views

### Mixed model in lme4 package is singular

I am running this model: ...
185 views

### What is the optimal method for distinguishing lack of power from non-significance in linear mixed models?

I have a linear mixed model and am interested in the significance of the fixed effects. I run run 2 identical models, except the second eliminates data points that are outliers (i.e., a sensitivity ...
• 472
1 vote
46 views

### Comparing mixed effect models fitted to two different datasets

I have two different time series data which are the results of running a simulation model with different sets of parameters and configurations. The datasets each contain 100 time series which indicate ...
• 13
1 vote
24 views

### A complex crossover study: addressing unbalance and time effects

I'm analyzing a crossover study, where subjects are measured at two time points during each treatment phase (Placebo or Treatment). Additionally, baseline measurements were taken before the experiment ...
• 337
1 vote
38 views

### How to code a lme, lmer, or glmer model for a split-plot design (ANOVA)?

I have a study where the initial height of seedlings were measured at year 0 and again 11 years after treatments were applied and a net change in height was recorded. I have a split-plot design as ...
1 vote
92 views

### Random Intercept vs. Random Slope Linear Mixed Effects Model with Nested Data

I have read a lot about random intercepts vs. random slopes in linear mixed effects (LME) models, but I am confused on how to think about them when it comes to nested data. I have looked at other ...
• 41
114 views

### Mixed-effects model of nested time series [closed]

I have time series data for a variable from different climate models, each with multiple runs using different initial conditions (ensemble members). A small subset of the data to see how its laid out (...
45 views

### Is there a by-group interaction issue after the Box-Cox transformation?

I've come across a question that has me a bit stumped and hope to seek your valuable insights. Specifically, I've been working with the Box-Cox Transformation to normalize dependent variables within ...
49 views

### Do these graphs show normality of model residuals? [closed]

I have a linear mixed-effects model (lme4 R package) and I am trying to work out whether the model residuals meet the assumption of normality. However, by looking at the graphs below (model residuals ...
• 223
53 views

### Equivalence test with random effects

I am designing an experiment where I will test different subjects’ multiple times under two different conditions (lab and real life) My hypothesis Is that that the subject will perform equivalent in ...
72 views

### Specific group effects (coefficients) in mixed-effect modeling in R (lmer)

Just assume a situation like this: "A" is the independent variable, which is as both between- and within-level. "B" is another independent variable, which is only as within-level. &...
• 33
63 views

### Which dependent variable is mostly impacted by predictor?

Usually one wants to identify the most important predictors (x1, x2, x3..., xn) in a regression model. My question is reversed: I have a data set that contains a risk factor risk and several outcomes ...
• 375
1k views

### Is parsimony crucial for statistical inference?

This question is based on using a regression for statistical inference (not prediction). I have conducted hierarchical (logistic mixed effects) regression. The first model includes the predictors of ...
• 472
1 vote
74 views

### How do interactions between multiple spline terms for different variables work in lme4? Is my approach/syntax valid?

I am currently analyzing a dataset from an experiment I ran in which I investigated the effects of different tone combinations on frog calling responses. Each stimulus presented to the frog was a ...
1 vote