All Questions
3,532 questions
0
votes
0
answers
11
views
nlme prediction differs largely from a 3 way interaction model to its post-hoc follow up
I'm trying to predict that speed at which people complete a walking test, where they perform this test for multiple trials and overall increase their performance on each trial. They perform as many ...
0
votes
0
answers
15
views
How to distinguish event effects from seasonal influence
I am working on a study that investigates the effects of recurrent annual flooding on ammonia concentrations in a certain region. The flooding event occurs consistently on the same days each year. My ...
0
votes
1
answer
123
views
mixed effect model in R with unstructured covariance [closed]
For the longitudinal data provided below, we have the following variables: the response variable y, the time variable 'week', 'grp' (with two levels: grp1 and grp2), and 'subject'. My objective is to ...
0
votes
0
answers
27
views
How do you interpret the results of an anova(model)?
This seems like a simple question, so apologies if it is already repeated elsewhere (though I could not find the answer when I searched for it).
I coded a linear mixed effects model as follows using R:...
0
votes
0
answers
65
views
Calculating the fitted values from a gls() object in R
I have created a gls() object to create a linear model with AR(1) errors. By all indications this model is a good fit for the data and the resulting model appears ...
0
votes
0
answers
31
views
Handling Non-normality of Reaction Time Data in Mixed Models
I am examining the effect of 'Phase' on reactions time (RT) data using a mixed model in lme4.
However, as is common with RT data, the residuals are non-normal.
This is the first model, which is a ...
1
vote
1
answer
78
views
Nested effects in lmer model
I have the following data structure:
...
1
vote
1
answer
30
views
How to specify a model with multiple treatment groups, measured twice, repeatedly across a time period (lme4)?
I have 30 animals (factor: animal_id, 30 levels) which have been treated with a drug or a vehicle (factor: treatment, 2 levels). ...
0
votes
0
answers
22
views
Is a multicategorical multilevel mediation even possible?
I've tried to model a multicategorical multilevel mediation by using the logic of Hayes et al., 2014 on multicategorical mediation and an implementation of a multilevel mediation.
Here's a MWE:
...
3
votes
2
answers
1k
views
Heteroscedasticity in linear mixed effects models (lmer)
I am computing the following model in R, using lme4::lmer:
m3 = lmer(e ~ (X*Y*Z) + (1|ID/R), data = data_transform)
e is a continuous variable. X, Y, and Z are ...
1
vote
1
answer
79
views
How to set contrasts for contrast in post-hoc comparison of linear mixed effect model in R?
i am new in R and studying statistical analysis for experiments, please help me~
I have 3 age groups (Y/HO/LO) and 2 conditions (Related/Unrelated). I am running a linear regression model on RT (...
3
votes
1
answer
92
views
Mixed effects models - clarification on random effects
I'm hoping to get some clarification on a "mismatch" between some simulated data I'm creating and the resulting model fit by R's nlme library. Specifically the random effects parameter ...
1
vote
0
answers
37
views
How to specify mixed-effects using lme4 in r for a within-subjects experiment [closed]
Now I want to regress the overall quality of the ideas (DV) on the source interacting with a continuous variable. I was advised to use the lme4 package, but I am ...
3
votes
1
answer
140
views
Error in mixed-models. Which to detect? Collinearity? Singularity in backsolve at level 0, block 1
Firstly, I would like to admit that even though it is not the first time I am working with linear mixed models, the mathematical foundations escape me. I am running a linear mixed-effects model using ...
0
votes
0
answers
69
views
Normalized dependent variable in a linear mixed-effects model
I have data (y) from experiment with three drugs (D={D1, D2, D3}), two treatments (T={T1, T2}) within each drug and several ...
1
vote
0
answers
28
views
Choosing different random effects structures for mixed-effects models with multiple response variables in R
I'm working on a project where I have two response variables of animal behaviour: one is count data (Poisson distribution), and the other is proportion data (Binomial distribution). I constructed GLMM ...
1
vote
0
answers
20
views
How /can one fit a LMM with non-factor grouping variables in lme4?
I understood that lme4 can be used to fit LMMs including:
$$
\begin{align}
\boldsymbol{\mathcal{Y}} \,|\, \boldsymbol{\mathcal{B}} = \boldsymbol b \;
&\sim \;
\mathop{\mathcal N_n}
\left(
\...
4
votes
1
answer
474
views
P value equal to 1?
I am running the following logistic mixed model in lme4:
...
2
votes
1
answer
527
views
Correct interpretation of conditional and marginal R squared in mixed effect models
I am currently running models with both random slopes and intercepts and am curious about the correct interpretation of the marginal and conditional $R^2$. From reading into them, I understand the ...
0
votes
0
answers
26
views
lme4 convergence warning in specific subset of data
Our main analysis consists of univariate logistic mixed models using lme4’s glmer to check for an association between plasma ...
1
vote
2
answers
76
views
How do you determine what interaction terms to include in your linear mixed effects model? [duplicate]
I am currently trying to compute a linear mixed effects model and am unsure about which interaction terms to include or not include.
For example, I have the following model, where I have included ...
0
votes
1
answer
42
views
glmer problems in seeing all variables
I am trying to run a binomial glmm to understand the relationship between various concentrations of a compound sensed by different castes of ants. We have 5 different compound concentrations (a-e), ...
2
votes
1
answer
98
views
Mixed model that tests for within-subject differences between two conditions while including covariates
I would like to use a mixed model to test if the values in a response variable differ between two conditions that each subject underwent. On top, I would like to control for the influence of other ...
3
votes
1
answer
105
views
Added more data and suddenly GLMM fails to converge (R)
I have a dataset where I randomly sampled housing developments, and then within these I systematically sampled every habitat patch. I now have a dataset where each observation is a patch_ID, and I ...
3
votes
2
answers
242
views
How to include higher-level grouping into lmer model?
I have a panel dataset and my dependent variable is the logit-transformed share of farm workers on long-term contracts. I am particularly interested in the effect of pastoral focus in agriculture, ...
0
votes
0
answers
28
views
Is this the correct conversion form an lme4 Generalised Linear Mixed Model glmer or lmer R script to a formula?
I conducted a randomized block design experiment to measure a traits in a population of plants in a growth chamber.
I have 3 blocks (shelf heigh) each containing 3 subblocks (shelf position), each ...
3
votes
2
answers
95
views
Interpretation of coefficients from a mixed-effect linear model with an interaction
I have the following output from a mixed-effects linear regression model with an interaction. This model comprises:
A continuous outcome (ranging from 590 to 1401).
A group variable (binary; control ...
0
votes
0
answers
34
views
Apply custom (ANOVA-like) contrasts to all interactions in a mixed model (with a stacked dataset)
I am conducting a multilevel mediation analysis with a multicategorical X (4 levels from a 2-by-2 design) for which I want to apply custom contrasts that code two ...
6
votes
1
answer
103
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.
...
0
votes
0
answers
13
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 ...
1
vote
1
answer
77
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 ...
3
votes
1
answer
57
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 ...
2
votes
0
answers
70
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:
...
6
votes
1
answer
102
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 ...
2
votes
1
answer
83
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 ...
0
votes
0
answers
82
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 ...
0
votes
1
answer
44
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 ...
0
votes
0
answers
33
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 ...
0
votes
0
answers
59
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 ...
3
votes
2
answers
52
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).
...
0
votes
0
answers
30
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 ...
4
votes
1
answer
84
views
Random intercept
I have the following model, how do I add a random intercept(no random effects included yet):
...
5
votes
1
answer
53
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 ...
0
votes
1
answer
2k
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
0
answers
35
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 ...
0
votes
0
answers
26
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
1
answer
132
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):
...
4
votes
0
answers
70
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 (= ...
3
votes
1
answer
80
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 (...
0
votes
1
answer
35
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 ...