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.

Filter by
Sorted by
Tagged with
1 vote
1 answer
25 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. ...
Lincoln's user avatar
  • 11
0 votes
0 answers
7 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 ...
AKIRA28's user avatar
  • 21
1 vote
1 answer
30 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 ...
Vik123's user avatar
  • 83
3 votes
1 answer
38 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 ...
Trudy's user avatar
  • 31
1 vote
0 answers
23 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: ...
quak's user avatar
  • 23
-1 votes
0 answers
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 ...
Zhiyi Xiong's user avatar
1 vote
1 answer
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 ...
Sointu's user avatar
  • 1,481
1 vote
1 answer
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 ...
SilvaC's user avatar
  • 472
0 votes
0 answers
27 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 ...
Nee's user avatar
  • 11
0 votes
1 answer
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 ...
neurobot's user avatar
0 votes
0 answers
9 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 ...
Bill Shipley's user avatar
0 votes
0 answers
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 ...
Spacedman's user avatar
  • 1,572
0 votes
2 answers
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). ...
Dan's user avatar
  • 535
0 votes
0 answers
25 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 ...
AmP's user avatar
  • 123
3 votes
1 answer
66 views

Random intercept

I have the following model, how do I add a random intercept(no random effects included yet): ...
Sandra Sørensen's user avatar
1 vote
0 answers
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 ...
Estimate the estimators's user avatar
0 votes
1 answer
116 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. ...
Maeldun's user avatar
1 vote
0 answers
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 ...
Workneh's user avatar
  • 11
0 votes
0 answers
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?...
ntrentin's user avatar
1 vote
1 answer
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): ...
quak's user avatar
  • 23
2 votes
0 answers
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 (= ...
unknown's user avatar
  • 53
3 votes
1 answer
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 (...
unknown's user avatar
  • 53
0 votes
1 answer
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 ...
xcvfg's user avatar
  • 1
0 votes
0 answers
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 ...
SilvaC's user avatar
  • 472
3 votes
1 answer
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 ...
Ed9012's user avatar
  • 181
1 vote
0 answers
36 views

Understanding equatiomatic output

I have fit a lmer model as follows: ...
Rabin KC's user avatar
3 votes
1 answer
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 ...
Lavdoy's user avatar
  • 31
5 votes
1 answer
103 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 ...
mkrasmus's user avatar
1 vote
1 answer
25 views

Interpretation of Intercept in mixed model with repeated contrasts

I am running the following logistic mixed model in lme4: ...
SilvaC's user avatar
  • 472
0 votes
0 answers
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: ...
DS14's user avatar
  • 85
2 votes
1 answer
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 ...
Carol Eisen's user avatar
3 votes
1 answer
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 ...
Wagathu's user avatar
  • 177
0 votes
0 answers
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 ...
MyName's user avatar
  • 33
1 vote
1 answer
91 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 ...
Nathan Vermaerke's user avatar
0 votes
1 answer
59 views

Mixed model in lme4 package is singular

I am running this model: ...
user avatar
4 votes
2 answers
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 ...
SilvaC's user avatar
  • 472
1 vote
0 answers
47 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 ...
szm's user avatar
  • 13
1 vote
0 answers
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 ...
Diego Pujoni's user avatar
1 vote
1 answer
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 ...
kryogenic7's user avatar
1 vote
2 answers
94 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 ...
rhingo3's user avatar
  • 41
2 votes
2 answers
115 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 (...
Elio Campitelli's user avatar
3 votes
0 answers
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 ...
Elizabeth's user avatar
3 votes
0 answers
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 ...
Darius's user avatar
  • 223
2 votes
0 answers
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 ...
Simen Leithe Tajet's user avatar
3 votes
1 answer
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. &...
Enmi's user avatar
  • 33
2 votes
0 answers
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 ...
a.henrietty's user avatar
7 votes
3 answers
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 ...
SilvaC's user avatar
  • 472
1 vote
1 answer
75 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 ...
Larterretral's user avatar
1 vote
0 answers
73 views

How my linear mixed effect model should look like? [duplicate]

I want to fit a linear mixed effect model with a response variable called "PhiPS2", along with independent variables such as habitat, season, and species. However, I'm not sure which of ...
scholar101's user avatar
3 votes
1 answer
66 views

Interaction in Linear mixed effect models (lmer) [closed]

I have activity levels of dogs and want to assess whether toy presence, toy groups, age, and the presence of toys on weekdays and weekends can affect the activity levels(DV). The best way I thought of ...
Guestuser2345's user avatar

1
2 3 4 5
69