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,468
questions
0
votes
0
answers
11
views
Simulating Power Analysis for Mixed Models (lme4 and simr)
I would like to calculate an a-priori power analysis for a within-groups study with the following design:
participant_id
condition (within groups - A, B)
covariate (scale 1-7)
questionnaire items (...
1
vote
1
answer
69
views
How to deal with this very nested data
I have run so many models and am so, so confused.
I've attached an image of sample data that matches my structure. I have a single score per conversation (score is ...
0
votes
0
answers
41
views
My glmer output has my fixed effects are being split into the multiple factors of my dependant variables and I'm not sure why
I am being advised that the output for my GLMER model is not correct. I at this time am not being given more instruction outside of that.
To set up the data for analysis, the following was done to ...
0
votes
0
answers
13
views
Linear mixed models with and without interactions
Here is the context: I asked two types of questions 8 times (8 "sessions" with 2 questions, each question has a "number" i.e. whether it is the first or second question asked, and ...
2
votes
2
answers
32
views
Unreasonable estimate in mixed models with interaction terms
In a LMM with interaction effect, the estimate seems unreasonable because the Score suppose to range from 0-12.
...
1
vote
1
answer
18
views
Environmental variables explain hare weight - 80 traps in 4 zones where each trap caught unequal number of hares - Linear mixed effects model best?
Study design
So I have put out 80 hare traps in a forest area of 50 km^2. There forest area is split into 4 zones. Each zone is expected to be different because of different pollution input levels. In ...
0
votes
0
answers
34
views
Avoid singular fits in mixed models in R with blme - checking layman's priors
While fitting linear mixed models, I would like to avoid zero random-effects (ranef(model)) and cluster-level SD estimates (...
0
votes
1
answer
22
views
Additional covariate reduces AIC in mixed models (LMM, GLMM, GAM)
In repeated measure for timepoints in different Group, Age and Gender act as a covariate in ...
0
votes
0
answers
24
views
In a mixed effects model, can leaving out the intercept-slope correlation parameter inflate type I error?
I am considering leaving out the intercept-slope correlation parameter in a mixed effects model to avoid convergence issues (i.e., in nlme::lme, ...
1
vote
0
answers
13
views
Why does the ICC differ when comparing multilevel models (log transformations vs regular scale) of the outcome variable in R using lme4?
I'm currently working on a multilevel modeling project in R utilizing the lme4 package. The primary aim of the research is to assess the relative importance of between-family and within-family ...
0
votes
0
answers
10
views
Why does the ICC differ when comparing multilevel models with using log transformations of the outcome variable in R using lme4?
I'm currently working on a multilevel modeling project in R utilizing the lme4 package. The primary aim of the research is to assess the relative importance of between-family and within-family ...
-1
votes
0
answers
16
views
Is there a way to specify multiple covariance structures in nlme for spatio-temporal longitudinal data?
I am trying to build mixed effects models for longitudinal data with spatio-temporal trends. Is there a way to specify multiple covariance structures in nlme or other packages (e.g. both a corARMA()...
1
vote
1
answer
57
views
r mixed model unstructured and ar1 covariance matrices
My goal is to specify two different covariance matrices for two different random intercepts.
Briefly, this is my dataset.
Outcome is continuous (school test scores)
13 Schools in my study. Random ...
0
votes
0
answers
22
views
Regression model detects effects that are much smaller than it was powered to detect
I have a mixed-effects regression model with n=250 in each condition. My power analysis predicted that the model would be able to detect effects larger than Cohen's D = 0.20. However, the model ...
0
votes
1
answer
60
views
Nonparametric version of lme- gamm function in R
Is there a non-parametric version of a linear mixed model? I've seen some people cite gamm in R as one but unsure of how I would go about using it.
In R, the code I ...
1
vote
0
answers
28
views
confusion about random effects summaries from lme and tab_model SjPlot
I am running into two issues.
As such, I am not confident in my interpretation of summary estimates from the Random Effects part of lme function.
I used the ...
6
votes
2
answers
331
views
AIC model selection is keeping a variable with p = 0.47
I am modeling migration departure timing for swallows to try and figure out which of the predictor variables that I have data for influenced departure timing. All of the predictors are variables that ...
0
votes
0
answers
49
views
lmer (lme4) nested random structure gives singular fit
I'm running the following model on some reaction time data:
...
1
vote
2
answers
49
views
Model selection for glmer in R
I am trying to make a model for the different amount of species caught in different traps in 3 different locations on 3 height levels, along with 3 transects per location (resulting in 9 traps per ...
1
vote
0
answers
23
views
Establishing the Smallest Effect Size of Interest (SESOI)
In my experiment design, I will be testing subjects multiple times under two conditions: in a controlled lab setting and in real-life situations. Testing subjects repeatedly is necessary as ...
0
votes
0
answers
28
views
Beta coefficients vs. Model Comparisons in LME models
I have run three non-hierarchical LME models testing how certain variables predict ratings.
...
3
votes
1
answer
38
views
Specifying random effects in R
I have a dataset with repeated measurements among participants (subjects). Each subject is tied to a site (Iowa, Kansas, Tennessee, ....). A subject can only be in one site and does not appear in two ...
6
votes
2
answers
199
views
exclude random effects component for a repeated measure
I'm analyzing a dataset on the Nurse Licensure Exam, comprising 3000 participants. (n)
These 3000 participants were randomly recruited from 13 Sites across the US. (group level variable)
About 40% of ...
0
votes
0
answers
27
views
Effect size for marginal means of a model with an interaction term
I'm wondering what is the correct way to calculate the eff_size() of a lmer model with an interaction term. I'm following this ...
0
votes
0
answers
23
views
Which strategy to use to analyze my repeated measures data? SE clustered at evaluator level, or mixed-effects modelling?
I ran an experiment in which 104 people evaluated 12 ideas. I manipulated the source of the ideas to see if they influenced idea evaluation (internal vs. external). Each respondent evaluated all 12 ...
1
vote
0
answers
17
views
Meta regression as mixed model: time interaction
In our meta-analysis, we have several potential moderators, both categorical (e.g. disease type, outcome type), and continuous e.g. publication year. Suppose we wish to investgate the effect of ...
0
votes
1
answer
36
views
GLMM with negative binomial- narrowing down variables & choosing a model
I'll start by saying apologies for perhaps not wording things correctly, as stats is not my first language (lol). Please let me know if there is any other info I need to provide to make this easier to ...
1
vote
0
answers
21
views
is it acceptable to do pairewise comparisons for mixed regressions that aren't independent?
I have a model specified as lmer(log(dv) ~ chosen*tasktype +(1|id)+(1|qs), data)
The key issue in the data is that the groups are not indepedent, i.e., ...
0
votes
0
answers
8
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
14
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
39
views
mixed effect model in R with unstructured covariance [closed]
Can the following SAS model be fit in R?
proc mixed data = df;
class grp week;
model y = grp week grp*week / ddfm = km;
repeated week / subject type = un r;
run;
The data df is of the following format ...
0
votes
0
answers
23
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
32
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
19
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
38
views
Nested effects in lmer model
I have the following data structure:
...
1
vote
1
answer
21
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
17
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
261
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
16
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 (...
2
votes
1
answer
53
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
36
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
86
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
45
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
23
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
469
views
P value equal to 1?
I am running the following logistic mixed model in lme4:
...
1
vote
1
answer
32
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
19
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
54
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
26
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), ...