Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [lme4-nlme]

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

0
votes
0answers
19 views
0
votes
0answers
8 views

R GLMER Output - why isn't there information about the null model? [on hold]

With a glm() model there's information about the null deviance, which can be used to test whether the model significantly improves on the null. This isn't present ...
1
vote
1answer
24 views

R: How to fit a GLMM in nlme

I want to compare lme4 and nlme packages for my data. But I'm confused by how to use syntax in nlme. I'm working with Mixed-Effects Models in S and S-Plus (Pinheiro, Bates 2000) and the current ...
0
votes
1answer
17 views

Comparing mixed models - understanding anova output in R

I am comparing mixed models in R using anova. My model m5 has one of the variables from model m4 omitted and I want to compare the 2 models to see if the dropped variable was significant. Comparing ...
0
votes
1answer
21 views

Calculate $\eta^2$ for repeated measures anova with lme4 in R

I know this is a subject of controversy, but I'm not interested in why p-values and effect sizes are bad but how I can calculate the latter based on the lmer() ...
1
vote
1answer
29 views

How to correctly model repeated-measures random effects in a linear mixed effects model

I have a mixed design data set where participants respond to each of three interventions and also report various demographics. The intervention is thus repeated-measures and each demographic measure ...
0
votes
0answers
29 views

R: Interpreting the emmeans' t-tests [duplicate]

Since the df are different between t-tests and emmeans ones (cf. https://stats.stackexchange.com/a/369671/217618), how then should I interpreted the results?
0
votes
1answer
13 views
1
vote
0answers
23 views

How do you stratify a Poisson regression in GLM?

I would like to obtain a stratified baseline hazard in a Poisson regression model. What is the correct way to do it ? Let A (=0/1) be the binary covariate on which I wish to stratify my baseline ...
0
votes
1answer
17 views

Proportion/Rate data and zero-inflation (two counts)

I have an experimental dataset which makes use of two counts. Using vague terms, we are studying animals as they become behaviourally inactive and then apply a stimulus once an hour. One of the counts ...
0
votes
1answer
66 views

How can I better predict with (g)lmer with missing values?

Suppose I'm building a mixed model in R, and I want to use that model to predict new data for which I might not know the value of all the features. Or in some cases, it might not be so much that I don'...
1
vote
1answer
26 views

specify random effects for multiple time series?

I want to specify a mixed effects model using lme4:lmer() to determine if sex (M vs. F) and treatment group (control vs. test) are related to how people's memory ...
0
votes
0answers
8 views

Interpreting Linear Trends in Residuals of Mixed Effects Model

I've created a mixed effects logistic regression model using proportional data, and I'm having trouble interpreting my residual plot. I've been taught that when looking at the residuals, I should be ...
1
vote
0answers
22 views

Receiving singular fit error while using lmer on one computer but not another [closed]

I have a script with a multi-level models that appears as follows. X1 is continuous, X2 is dichotomous, there are 45 of subID and 296 trials for each subID.: Y ~ X1 * X2 + (X1 * X2| subID) When I ...
2
votes
1answer
40 views

Why use Linear Mixed Models instead of Repetead Measures ANOVA?

Well, here's some background before the question: I have an experiment where I evaluate the heart rate of subjects in 4 different conditions (4 time points). The subjects also answer a psychometric ...
0
votes
0answers
27 views

Repeated measures design and covariate using nlme & lme4

I conducted a full 3x2x2 (W1,W2,W3) within design with every participant experiencing the ...
2
votes
0answers
18 views

Planned Contrasts in Mixed models: group with 3 levels

This analysis is based on data from https://stats.idre.ucla.edu/r/seminars/repeated-measures-analysis-with-r/ with some modifications. Pulse measurements were made at 3 time points (1,2,3) for study ...
1
vote
0answers
29 views

How to build a LME with nested random effects? A study with a very comlicated experimental design

I am trying to analyse the data on the climbing behaviour of flies. The design of the experiment was rather complicated, so I am currently struggling to build a propper LME model. The flies have ...
2
votes
0answers
12 views

Is inference after model selection a real problem when few models are manually compared?

I performed an experiment that went wrong, but the error made it possible to test another hypothesis that I generated upon noticing the error (and before knowing the outcome). Parameter A should have ...
0
votes
0answers
19 views

How to back-transform glmer() cbind() proportion data

I have fit a binomial GLMM (glmer) to a response variable that is a proportion. How my data looks: ...
0
votes
0answers
43 views

Nonparametric for lmer

I am trying to fit a model based on the df dataframe, where I want to be able to compare all of the levels between/within the treatments (...
0
votes
1answer
18 views

R: How to use lmer for more than two levels?

I want to fit a model with 5 levels. All levels are hierarchical. That is, level 5 is nested in level 4, level4 is nested in level 3, etc. level 2 is nested in level 1. All levels are factors. Single ...
2
votes
1answer
53 views

How to code random slopes random intercept model with quadratic term and covariance unstructured in lme4

I've worked through quite some documentation about both the nlme and lme4 package, (and quite some fora) but am still unsure whether I'm doing the right thing. Here's what I want to do: I want to ...
1
vote
1answer
44 views

Running a mixed effects model in R with lmer()

I am currently trying to run a mixed effect model in R for a study I am conducting. I am looking at the effect of target ethnicity on objectification and whether affinity mediates this relationship. ...
2
votes
0answers
21 views

Cholesky Decomposition (in lmer from lme4)

When I retrace the implementation of lmer from lme4 I faced a question regarding cholesky decomposition used for solving penalized least squares. Consider a Cholesky decomposition of a matrix M with ...
3
votes
1answer
53 views

Multilevel model with 4 levels?

My dataset is a pretty typical educational dataset: we have data about students, courses, faculty, schools, and I plan to include partially-crossed random effects because students could enroll in ...
0
votes
0answers
7 views

Creating a weighted composite score from standardized lavaan latent beta weights that retains the scale of the original measures?

I did a latent factor analysis in Lavaan which had a good fit and gave me the following estimates of standardized beta weights for three latent variables called Eta1, Eta2, and Eta3. ...
1
vote
1answer
36 views

Unbalanced longitudinal model with lmer

I would like to asses the treatment effect on blood hormone concentration. Data are collected in 10 centers, at 4 time points (0,6,12,and 18 months). However four centers used both treatments a and b, ...
1
vote
1answer
29 views

Mixed effects model with 1 observation per level of categorical predictor

I have looked at the other questions similar to this one (e.g. here and here), but I don't think that they are quite the same as my situation, although please correct me if I am wrong. I am trying ...
1
vote
0answers
14 views

How to include survey weights into a random intercept model? [duplicate]

I'm trying to run a random intercept model in R on an adolescent dataset with >100 schools (the school being the intercept). The data include a survey weight value for each observation, however lme ...
5
votes
4answers
230 views

Accounting for grouped random effects in lme4

I am editing my question as it was not detailed enough. I made an (unsuccessful) shortcut. Sorry, here is the entire story. In my experiment I test subjects' reactions to some (simulated) situations....
2
votes
1answer
28 views

In lme4, how to specify a one-way ANOVA within or between subject?

Using the lme4 package for mixed effect models in R, I am trying to figure out what is the difference in modelling a one-way ANOVA within subject and a one-way ANOVA between subject. Suppose first, ...
0
votes
1answer
18 views

How does R compute lmer() and glmer() from lme4?

I have another question regarding the lmer() and glmer() functions from the lme4 package. Consider three models ...
0
votes
0answers
12 views

How to model repeated measures data to control variation due to subject?

So I have data where I am predicting the effect of 4 different shoes weights(ranging from 10-25 grams in 5 gram increments... its a made up example) on a runners speed. It's listed as in the ...
0
votes
0answers
17 views

Predict a disease with a compositionnal count data

I am trying to predict a disease (binomial response TRUE or FALSE) with count data (16S microbiom count) and I got one random effect (person's mother). Actually, im working on count's proportion ...
3
votes
1answer
115 views

Which random effects to include in this GLMM?

In my study growth of plants was measured in different years on different plots (all plants were measured in all years). The question I'd like to answer with my model is: Which factors influence ...
0
votes
1answer
87 views

How to account for temporal autocorrelation in mixed effects logistic regression?

Apologies if this has been asked before-I've looked around but haven't found any questions regarding my exact situation. I am conducting a study aimed at determining the climate sensitivity of a bird ...
1
vote
0answers
389 views

Singular fit with simplest random structure in lmer (lme4), is a Bayesian approach the only option?

I'm running a mixed model with the lmer function from the lme4 package in R and ran into some issues with singular fits. I get the warning message 'singular fit', ...
2
votes
0answers
79 views

Formulating mutli-membership random effects in lme4/GAMM4

I'm trying to fit a GAM with multi-membership random effects and nested effects in the package GAMM4, which uses lme4 syntax. Does anyone have any experience doing this in either package? Is it ...
2
votes
0answers
54 views

Covariance structures in glmmTMB for temporal autocorrelation

I'm running a zero-inflated, mixed-effects negative binomial model with the glmmTMB package in R. My current format: ...
0
votes
1answer
32 views

With lme4, is it possible to weight group-level random effects by similarity?

I'm creating a model with two group-level random effects: district (factor) and age (factor) and a response, ...
1
vote
1answer
63 views

treatment and sum contrasts, inconsistent results

I am fitting a linear mixed effect models with two factors (mPair with 6 levels, and spd_des with 3 levels) and their ...
0
votes
0answers
8 views

Residual term for calculating F in factorial ANOVA with/without random factor

Manually calculating F in the following ANOVA without a random factor (using lm()) is fairly straightforward; divide the parameter MS by the residuals MS. Am I ...
2
votes
1answer
64 views

linear pattern in residual vs fitted

My question is about addressing linear relationships between model residuals and the response variable. I am using a linear mixed model to model the relationships between two response variables (...
3
votes
0answers
70 views

Generalized Linear Mixed Effects Logistic Regression with Repeated Measures

I have an experiment where subjects reported multiple results (binary) in two treatments. I have compared each subject separately to see if the treatment had an effect on a given subject, but would ...
2
votes
1answer
118 views

Estimates radically change when including Random Slopes in Multiple Logistic Regression

I am examining the fixed effects of two within-subject experimental manipulations (i.e., Ambiguity 0 = No / 1 = Yes, and Uncertainty 0 = No / 1 = Yes) on a dichotomized variable (i.e., Punishment, 0 ...
0
votes
0answers
23 views

R glmer.nb : how building model with interaction between categorial variables

Before posting this, I made some research but I am very struggle with my modelling approach, so I will try to be clear in what I want to do with my data. I want to apologize if my questions are close ...
0
votes
1answer
38 views

Covariance matrix for the random effect in mixed effects model

According to this post, matrix Omega and sigma are in the results of lmer when we fitting ...
2
votes
1answer
66 views

how to understand random factor and fixed factor interaction?

Let's say I fit this model to the Oats data set lmer(yield ~ Variety + (1|Block/Variety), data=Oats) ...
0
votes
1answer
390 views

singular fit in lmer, despite no high correlations of random effects

I ran a mixed effects model a few weeks ago, it all went fine, no errors. Here is the model: ...