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
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 (...
becbot's user avatar
  • 111
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 ...
user5826447's user avatar
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 ...
Myles Covington's user avatar
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 ...
statuser's user avatar
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. ...
hey0god's user avatar
  • 21
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 ...
Cordex's user avatar
  • 75
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 (...
Imsa's user avatar
  • 43
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 ...
hey0god's user avatar
  • 21
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, ...
Evan's user avatar
  • 205
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 ...
Max Herre's user avatar
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 ...
Max Herre's user avatar
-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()...
purplepotato's user avatar
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 ...
Science11's user avatar
  • 537
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 ...
Benji's user avatar
  • 365
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 ...
Kiara H's user avatar
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 ...
Science11's user avatar
  • 537
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 ...
purplebubbles93's user avatar
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: ...
Brechje van Osch's user avatar
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 ...
Fréderick Lescouhier's user avatar
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 ...
Simen Leithe Tajet's user avatar
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. ...
Shannon Cahalan's user avatar
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 ...
Sundown Brownbear's user avatar
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 ...
Sundown Brownbear's user avatar
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 ...
Larissa Cury's user avatar
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 ...
Daisy's user avatar
  • 1
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 ...
user167591's user avatar
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 ...
Adrianna Elihu's user avatar
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., ...
Jinjin's user avatar
  • 111
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 ...
user410044's user avatar
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 ...
Pablo's user avatar
  • 35
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 ...
user13154's user avatar
  • 1,173
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:...
ramateur's user avatar
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 ...
chris202's user avatar
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 ...
SilvaC's user avatar
  • 512
1 vote
1 answer
38 views

Nested effects in lmer model

I have the following data structure: ...
hilberthotel's user avatar
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). ...
doesnotcompute's user avatar
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: ...
brizzen's user avatar
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 ...
hilberthotel's user avatar
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 (...
Yun's user avatar
  • 13
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 ...
bioin4's user avatar
  • 255
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 ...
Anna's user avatar
  • 11
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 ...
Javier Hernando's user avatar
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 ...
vintio's user avatar
  • 1
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 ...
Paritosh ahmed's user avatar
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( \...
jan-glx's user avatar
  • 361
4 votes
1 answer
469 views

P value equal to 1?

I am running the following logistic mixed model in lme4: ...
SilvaC's user avatar
  • 512
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 ...
user947548's user avatar
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 ...
JED HK's user avatar
  • 409
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 ...
ramateur's user avatar
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), ...
Allyssa Hinkle's user avatar

1
2 3 4 5
70