New answers tagged

0 votes

My glmer output has my fixed effects are being split into the multiple factors of my dependant variables and I'm not sure why

This is work in progress as the OP hasn't yet fully clarified why the GLMM output is incorrect. What I've done so far is to simplify the data wrangling steps (fewer steps, fewer opportunities to make ...
dipetkov's user avatar
  • 9,910
1 vote
Accepted

Using participant-specific slopes in correlations and dependent variables in subsequent models

This is a good question and the concerns you have are justified. I will address the second and third questions you asked. I honestly have no idea what they were trying to accomplish in the first ...
Erik Ruzek's user avatar
  • 4,715
0 votes

Why should one use EM vs. say, Gradient Descent with MLE?

This is only a partial answer to OP's question In the context of Gaussian Mixture models, there are a few pros and cons of both these methods. Advantages of EM EM does not require hyper-parameters ...
honeybadger's user avatar
  • 1,562
0 votes

Fixed vs random: how can a fixed effect be constant across individuals?

I am not sure if I fully understand your question, but imagine that instead of having plant as category (A/B) you had two identical plants but the variable was "put on a small pedestal of 9.4 ...
Niklas's user avatar
  • 21
2 votes

Estimating risk ratio instead of odds ratio in mixed effect logistic regression in `R`

This is an older question, but might benefit from some newer approaches using marginaleffects. The difference here is that we use post estimation techniques to ...
Demetri Pananos's user avatar
0 votes

Estimating risk ratio instead of odds ratio in mixed effect logistic regression in `R`

GLMMAdaptive solved this annoying problem for me, it seems to converge better for binomial with log link, but may need adjusting your control parameters, I set update_GH_every=50) ...
Ronin scholar's user avatar
1 vote

Variance partitioning with crossed and nested factors: A simulation study

I've come across another option to simulate data from a linear mixed-effects model: designr::simLMM. (Aside: One weakness of the {designr} package is that Google is ...
dipetkov's user avatar
  • 9,910
1 vote

Additional covariate reduces AIC in mixed models (LMM, GLMM, GAM)

If you are going to use AIC as your sole criterion for model selection, then yes. But I wouldn't recommend that, for most cases. You don't say what your dependent variable was or what sort of study ...
Peter Flom's user avatar
  • 120k
0 votes

Linear model with nested random effects

First of all, it's not feasible to use variables with only two levels (such as design) as random effect grouping variables. Second, in your first model, you have specified design as both a fixed ...
Sointu's user avatar
  • 1,958
1 vote

Model selection for glmer in R

One comment which stuck out to me: I have been told that this model may be too complex, and that I should try model selection to solve this. Based on the AIC (430.7), I think that this is indeed the ...
Shawn Hemelstrand's user avatar
0 votes

Model selection for glmer in R

As noted by Gregor above, there are a few different ways to compare models, but all will involve running additional models and comparing the AICs (or BICs) to see if the random effects structure is ...
Paul's user avatar
  • 56
1 vote

Sample size calculation for a multicenter RCT

Let me see if I understand: Your main outcome here is time until stopping of treatment. While the paper you linked mentions sample size calculations for medians, I think a time-to-event analyses is ...
Demetri Pananos's user avatar
3 votes

Sample size calculation for a multicenter RCT

Given your non-trivial design, I would suggest you turn this task a bit onto its head and use a simulation-based sample size planning approach. A nice intro to this would be: External validation of ...
usεr11852's user avatar
  • 44.2k
2 votes

Mixed models - interactions or individual regression

In general, the interaction model would enable you to test if a treatment works better for one group than for another. With separate groups you would only see that there is a difference in treatment ...
BenP's user avatar
  • 1,169
2 votes

Nonparametric version of lme- gamm function in R

I think there is some confusion on the terms and the programming elements, so let me explain a bit what each is: A linear mixed model (LMM) is a linear regression technique that incorporates random ...
Shawn Hemelstrand's user avatar
4 votes

Sample size calculation for a multicenter RCT

Most statisticians ignore centers when doing sample size calculations. That doesn't cause too much of a problem. The best models for duration of treatment are the Cox proportional hazards model or ...
Frank Harrell's user avatar
8 votes

AIC model selection is keeping a variable with p = 0.47

Shawn's idea of avoiding stepwise variable selection should be heeded. As has been discussed countless times on this site, variable selection is a disaster. The first thing it does is to ruin ...
Frank Harrell's user avatar
2 votes

Mixed effects clarification - Ecology

With six observations per site I'd think a random effect for siteID will do the better job here, although the other idea with variables that characterise the sites could also be considered. I'd ...
Christian Hennig's user avatar
10 votes

AIC model selection is keeping a variable with p = 0.47

I really don't like the approach you have proposed here for model selection. If you have a set of a-priori defined models, test those directly. Then calculate AIC and see which fits look better (...
Shawn Hemelstrand's user avatar
0 votes

Calculating confidence interval in linear mixed effect model

You can recast your system of linear equations into form: $$ \left(\begin{array}\\ 1 & 0 & 0 & 0 & \dots & 0 & 0 & X_{11} \\ 1 & 0 & 0 & 0 & \dots & 0 &...
Cryo's user avatar
  • 586
4 votes
Accepted

In multilevel logistic regression, can pooled data return significant variables when the same variables in stratified data are not significant?

Your main question here is: Can a variable (for example, sleeping outdoors) be statistically significantly associated with infection in the pooled data with random effects for household and village (...
Shawn Hemelstrand's user avatar
1 vote

Priors in a bayesian model? Equivalent GLMM

Brief Answer I would heavily recommend reading up on Bayes before using Bayes. There is a serious danger of the defaults (Gelman & Yao, 2021; Moyé, 2008; Smid & Winter, 2020), which are the ...
Shawn Hemelstrand's user avatar
2 votes

Priors in a bayesian model? Equivalent GLMM

The posterior and likelihood, and their marginals, are equivalent when you use uniform priors. So the maximum likelihood estimate and maximum a posteriori estimate are equivalent when you use uniform ...
Sextus Empiricus's user avatar
2 votes
Accepted

Specifying random effects in R

This specification looks correct to me (see relevant code on p.7 of the original paper on lme4). It fits the relationship between the outcome and $x_1$ and $a_1$ ...
Shawn Hemelstrand's user avatar
6 votes

exclude random effects component for a repeated measure

Although the (ICC) based on SubjectID suggests moderate correlation (0.5-0.7), I've opted not to include SubjectID as a random component in the model due to lack of interest in predicting individual ...
Christian Hennig's user avatar
7 votes
Accepted

exclude random effects component for a repeated measure

If you want to capture the subject correlation in a multilevel model, I think you have to include it as a random effect, and this doesn't really depend on wanting to predict individual scores over ...
Peter Flom's user avatar
  • 120k
0 votes

How should I analyse my ordinal data when there is a between-groups design?

Since the dependent variable for each question is ordinal, if you want to model each one separately you should use ordinal regression to start. But, when the proportional odds assumption is violated ...
Peter Flom's user avatar
  • 120k
1 vote

How to include higher-level grouping into lmer model?

For the counts a few models might be compared. I assume that parishes are numbered from 1 to 8000 across all the counties. 1 Random county and parish effects. ...
BenP's user avatar
  • 1,169
1 vote

What does the iteration limit warning message I get when using ordinal::clmm mean?

The related relevant code is in this function https://github.com/runehaubo/ordinal/blob/master/src/utilityFuns.c ...
Sextus Empiricus's user avatar
2 votes
Accepted

How to include higher-level grouping into lmer model?

Normally, you should have time (year) at both levels like pastorale and the variable RC at ...
POC's user avatar
  • 668
1 vote

Test for significant difference between two groups measured across time

Mixed effects models can still have a nonlinear function of time, e.g., a spline function in time as a fixed effect. But random effects usually don't capture the correct correlation pattern in ...
Frank Harrell's user avatar
2 votes
Accepted

Error in mixed-models. Which to detect? Collinearity? Singularity in backsolve at level 0, block 1

Preliminary Responses I provide an answer for now in case others do not respond. I first address some of your initial questions, then move on to more important matters that are visible in your ...
Shawn Hemelstrand's user avatar
10 votes

Visualization of a mixed effect logistic regression model?

There are a number of ways to visualize logistic GLMMS. For my examples, I use a logistic GLMM from here using their same code in R (with some minor changes): ...
Shawn Hemelstrand's user avatar
2 votes
Accepted

The Concept of Mixed-Effect Modeling in Gardening

If I understand your terminology correctly: "Flower Nested in Gardener": each Gardener scored several Flowers, but each Flower was scored by only one Gardener "Allotment Nested in ...
Ben Bolker's user avatar
  • 43.7k
6 votes
Accepted

Insights in a more complex multilevel model

You can just add another more random term. But it might be useful to move the fixed effect $\mu_\alpha$ and $\mu_\beta$ outside of the equation for the random effect. As you can add multiple random ...
Sextus Empiricus's user avatar
1 vote

mixed effect model in R with unstructured covariance

Although the question is formulated as a programming/syntax problem I will answer it, because I'm not sure if you are aware of the many other options to model (co)variance matrices over "weeks&...
BenP's user avatar
  • 1,169
3 votes

Should I contain time as a random variable in repeated measurement?

When thinking of time I think of fixed effects and serial correlation first as detailed here. A semivariogram is a must-do graphical diagnostic to understand correlation patterns. Correlation ...
Frank Harrell's user avatar
3 votes

LMM and RM-ANOVA differences. Which one is preferable?

I think you should use neither. I don't understand why you fit separate models instead of including the phase in the model. Your dependent variable looks like you should be using a GLMM with a ...
Roland's user avatar
  • 6,661

Top 50 recent answers are included