11
votes
Accepted
Is it normal to have thousands of df in a logistic regression model?
The discrepancy between DF for different estimates likely means that these are the results of a mixed model. There were probably a bit more than 25.69 participants in the study (leading to 25.69 DF ...
9
votes
Is a tilde or an equals sign correct in linear mixed model formulas?
If the journal is typesetting in LaTeX, the formula needs to be in math mode and use the \sim expression $\sim$ which is different from ~ in text mode - you can see the difference, no? But that's not ...
8
votes
Accepted
The difference between control variable and a random effect?
I'm not sure that there is a "correct" way "to model the effect of the expression of gene A on the size of the tumor," as tumor size typically has a lot more to do with the ability ...
8
votes
Is a tilde or an equals sign correct in linear mixed model formulas?
The tilde as a relational operator is frequently used in a statistical context to indicate "is distributed as," and read "the term(s) on the left are distributed as indicated by the ...
7
votes
Accepted
Logistic regression model for hospital readmissions: accounting for multiple admissions
If you have actual discharge and readmission dates for each patient, then this might best be handled with repeated-event survival analysis. That's presented in the main R ...
6
votes
Accepted
Preparing data for modelling
Would it be correct to use the following data format for such modelling?
Yes, the model:
offer ~ year + population + (1 | county)
adjusts for the repeated ...
6
votes
Accepted
How to predict ln(odds) with rcs term in mixed effects logistic model?
Your code fits a binomial model for r2 with main effects Anger (transformed with a restricted cubic spline with 5 knots), ...
6
votes
Why is my lm() model unaltered by addition of a random effect?
lm is a function for estimating fixed-effects regression only, it does not handle random effects. For random effects, you need to use libraries such as nlme or lme4....

Tim♦
- 117k
5
votes
Accepted
Likelihood ratio test for random intercept (MATLAB)
Is there a way of generating a LinearMixedModel object which does not include any random effects?
I am not a MATLAB expert, and programming questions are off-topic here anyway (so you might try ...
5
votes
Accepted
Possible to use linear regression instead of paired t test?
A paired t-test is a test of whether the mean difference between conditions among individuals is different from 0. (It doesn't require normal distributions of the individual measurements among ...
5
votes
Accepted
Are mixed models necessary if random effects estimates are close to zero?
To summarize the useful information provided in comments: you don't necessarily have to use a mixed model, but you do have to take the lack of independence among the measurements into account in some ...
5
votes
Accepted
How to interpret the standard deviation of the slope random effect in a multilevel model
I am assuming you have fit a model in which you have estimated an overall average (fixed) effect of time and allowed the effect of time to vary by region (random slope). The model then estimates the ...
4
votes
Nested repeated measures linear mixed-effects model without time as a variable
Are the specifications in model1 correct to answer the question?
No.
The random structure (1|groups_2/record_id) does not make sense. Assuming that ...
4
votes
Multilevel Model or Simple Correlation Coefficients
As mentioned in the comments, there are repeated measures within id, so fitting a mixed model with random intercepts for id ...
4
votes
What are the consequences of not including random effects in a linear model when they should be added?
There are 2 questions here:
...the population level predictions (based on the fixed effects coefficients) are virtually identical between these two models (standard vs. mixed). Interestingly, however,...
4
votes
Accepted
Why does this 3-level multilevel logistic regression fail to converge?
I'm going to answer this with two pictures and a lot of code.
The underlying difficulty with your model is that you have a very uneven distribution of samples, with very few samples in the early years ...
4
votes
Accepted
Mixed effect Cosinor model
Below is an example to get the derived values such as the amplitude $\sqrt{\hat{\beta_1}^2+\hat{\beta_2}^2}$.
It demonstrates how the model fits the coefficients $\beta_1$ and $\beta_2$ in a linear ...
4
votes
Accepted
Beta-Binomial mixture vs Beta-Binomial multilevel model?
They are both pieces of the beta-binomial model. In beta-binomial model, the predicted variable $y$ follows the binomial distribution, where the number of samples $n$ is known and we want to learn the ...

Tim♦
- 117k
4
votes
Accepted
How do I use the within transformation for logistic regression?
The within transformation will not work because of the non-linearity of the logit function. There are some possible solutions:
Fit a panel linear probability FE model
Conditional logit
Unconditional ...
4
votes
Accepted
Back transforming standard errors in a GLMM with a log-link
Standard errors do not transform. If uncertainty intervals on the link scale are symmetric (as they often approximately are), when you anti-log parameter estimates the uncertainty on the anti-logged ...
4
votes
Accepted
How to understand the following linear mixed model?
(I strongly prefer using $\gamma$ or $u$ instead of $b$ when using "random effects" notation. Otherwise, if we accidentally capitalise something we might do a mistake. I don't understand why ...
4
votes
Accepted
Linear mixed effects modeling with MZ and DZ twin pairs
Comments:
To understand the statement "This step allows the method to be generalizable to other cohorts since we are treating the individuals as if they were unrelated.", consider Figure 1 ...
4
votes
Accepted
Why does this mixed model produce discrepant output in SPSS and R?
Okay, so I think that I have an answer here that is explaining the differences. The model in lme4 results in a singular fit. Looking at the model summary, this is happening because the correlation ...
3
votes
Interpret Generalized linear mixed model output
I've built a generalized linear mixed model due to non-normal data (no transformation will make it normal). I'm new to mixed models and I'm unsure how to report the output in a paper.
One of the ...
3
votes
Accepted
Mixed effects model for longitudinal data with nested random effects?
Assuming that each subject is only in one group, you have a nested design. Conceptually, it makes more sense to treat group as a fixed effect. As you have only three groups, it wouldn't make much ...
3
votes
Accepted
Using Linear Mixed Models with two fixed factors and a random factor
Assuming that RATE is the response then in R the model would be:
RATE ~ ANTS + LABEL + (1|STATE)
3
votes
Can Machine Learning Models Recover "Experimental, Design and Hierarchical Structures" Within the Data?
Oh yes, that can happen. And it can have majorly adverse and unlooked-for impacts.
We may not feed a job candidate's ethnicity into the ML system that parses all submitted CVs for equity reasons - but ...
3
votes
Accepted
What is the most reliable way to visualize the mixed model?
You will have to apply your knowledge of the subject matter to decide the most reliable way to proceed. First some general considerations, then some warnings about your application.
In general, with ...
3
votes
Is z-transforming continuous variables always necessary?
There is no need to Z-transform a continuous predictor for standard types of regression models.* Some prefer to center such predictors about their mean values when there are interactions, as it puts ...
3
votes
Which distribution family for generalized linear-mixed model based on the plots?
You might be able to do something simple with your Likert-scale outcome values that doesn't require a generalized linear model. A prior square-root or logarithmic transformation of those values might ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
mixed-model × 5562r × 2065
lme4-nlme × 1708
random-effects-model × 814
regression × 710
repeated-measures × 683
multilevel-analysis × 495
anova × 410
generalized-linear-model × 294
glmm × 272
logistic × 244
panel-data × 236
interaction × 186
nested-data × 151
linear-model × 140
fixed-effects-model × 134
multiple-regression × 124
interpretation × 123
time-series × 120
hypothesis-testing × 115
spss × 107
modeling × 96
bayesian × 86
residuals × 86
sas × 86