New answers tagged mixed-model
1
vote
Overfitting in lme4 package: which is the best choice when repoting several models in the same research?
First, it's useful to point out that the problem you're encountering is that the models have "singular fit", which isn't exactly the same thing as "overfitting" - see here for ...
5
votes
Accepted
A random effect nested in another random effect in R with mgcv package
If you have many schools, the factor by smooths may be appropriate, but you might get better/different results using a simple nested random effect.
From a technical point of view the factor by smooths ...
0
votes
Mediation model with covariates and between and within-person mediators
I would like the stress level (stress) without disentangling as a mediator (2-1-1 mediation)
Stress is the mediator, so it is an endogenous variable. The way this is modeled in MLSEM is that you ...
1
vote
Interpret results of a mixed effects model analyzing a 2x2 cross-over study?
Is my code and interpretation correct?
No! Your model has 2 large issues and the parameter you have extracted means something very different then what you think.
The issues with your model:
It is ...
1
vote
How to do the post-hoc analysis for three predictors (two factor variables and one numeric variable)
Typically, you shouldn't look at the 2-way interactions if you have included a 3-way interaction into the model. I find the emmeans package function emtrends easy to use when unpacking interactions ...
1
vote
R: Can judge significance based on overlap in graph produced by dotplot(ranef(model))?
No, this is not an appropriate way to evaluate if including the random effects improves the model fit. You could formally test that with a likelihood ratio test by comparing the model with and without ...
1
vote
How to structure higher level effect (between clusters) in mixed-effect models
The second option (... + (1|school)) is probably correct. In general the variables that you use as a grouping variable should be categorical and exchangeable (i.e.,...
2
votes
Accepted
How to write the results of an hierarchical regression into an equation?
If LaTeX output is OK, try equatiomatic::extract_eq(mdl).
For example, on this model:
...
0
votes
How to determine contrasts in combinations of categorical variables with emmeans
I think you have a nested fixed-effects structure, where group is nested in sub_type. Did not ...
0
votes
Interpreting Mixed Model ANOVA
There's some confusion here about null hypothesis statistical testing (NHST) and about causation.
In the first question, you would reject the null hypothesis of no effect. That does not automatically ...
6
votes
Accepted
Difference between four random effects structure
in general, terms shouldn't be in RE if they're missing from FE
(By "terms" here I mean "terms that vary among groups", not "grouping variables"; in formula notation, ...
2
votes
How to specify random effects for panel/longitudinal data with level 2 predictor?
ORIGINAL ANSWER
Without knowing much about this (interesting!) subject, I'm not sure you need the year in the model at all. Perhaps you need it for some other reason, but not to investigate gender ...
0
votes
Multinomial glmm with glmmADMB in R
mgcv package seems very slow and space inefficient. I was only able to estimate the binary model. The multinomial model could not complete the estimation.
0
votes
Bayesian mixture model with Random Effects in Linear Predictor
Here is a potential viewpoint of the sort of model that you can have:
$$y_i|z_i,x_i \sim \mathcal{N}(\mu_{z_i,x_i},\sigma_\epsilon)$$
where $x_i$ is an index for the individual. With priors
$$\begin{...
-1
votes
What is the meaning of $\oplus$ and $\otimes$?
Suppose $A=\begin{pmatrix}a&b\\c&d\end{pmatrix}$ and $B=\begin{pmatrix}e&f\\g&h\end{pmatrix}$
Then,
A$\otimes$B=$\begin{pmatrix}a&b\\c&d\end{pmatrix}$ $\otimes$ $\begin{pmatrix}...
0
votes
Mixed Effects or other Model for Binary Interventions and Binary Outcome
Since you don't seem to have a strong reason to consider effect of the course as random and with only 10 different courses I would recommend against random effects, based on the glmm-faq from Ben ...
2
votes
Multiple predictors that measure the same concept in regression
If you can reasonably assume that the three questionnaires measure the same dimension/latent variable representing musical training (MT), you could aggregate the three scores and use a single ...
0
votes
Normalizing Data in Multiple Categories
Since your goal is simply to identify the best/fastest user overall, I would start with a mixed/hierarchical model of the form:
...
0
votes
Unstructured model vs random slope model for repeated measures based on R functions lmer, lme and gls
The gls and lme models have an important difference. As this Stack Overflow answer quotes from Pinheiro and Bates:
The gls ...
1
vote
Accepted
Interpretation of lme4 output with different contrasts for variables
The unique rows of your fixed effects design matrix under your first contrast specification can be obtained via
...
0
votes
Mixed effects model to explore the linear relationship between two variables for each level of the repeated-measures in Rstudio using lme()
Using the data you provided: look at the model summary first:
...
3
votes
How 'by' factor works with 'fs' random smooth in gam?
You missed some important output from plot_smooth() and some critical understanding about what the function is doing. The reason I was confused absent knowledge ...
1
vote
Why are Bayesian mixed-effects models (e.g., brms) more able to estimate complex models than Frequentist mixed models (e.g., lme4)?
Random effects are used to capture correlations in the data, namely, within the same level of the corresponding grouping factors. The parameters that quantify the strength of these correlations are ...
2
votes
Why are Bayesian mixed-effects models (e.g., brms) more able to estimate complex models than Frequentist mixed models (e.g., lme4)?
When you “estimate” a Bayesian model most often what you do is you sample from the posterior distribution. Posterior is, by Bayes theorem, basically a product of the priors and the likelihood. If you ...

Tim♦
- 131k
4
votes
Why are "fixed" and "random" called that?
Because like many other fields (possibly all other fields), statistics terms were not created at the beginning, then used, but rather have evolved over time and many terms make sense from one ...
3
votes
Plotting a regression line with a different fit than the model it is supposed to illustrate
I assume that by 'size', you mean something like body length.
Your model is inconsistent with the data, and ignores much that is known about such scaling relationships in biology. As a start, it's ...
3
votes
Fitting a Markov chain with variable path lengths (survival analysis)
I'm worried about the effect of individual variance in this setup. For example… those individuals with a tendency to quickly transition into state 2, they will have a small impact on the transition ...
3
votes
Fitting a Markov chain with variable path lengths (survival analysis)
Technically, according to Wikipedia,
A Markov chain or Markov process is a stochastic model describing a sequence of possible events in which the probability of each event depends only on the state ...
5
votes
Accepted
Fitting a Markov chain with variable path lengths (survival analysis)
In the case of a single terminating event, a comparison with the Cox PH model as @sextus-empiricus suggested is a great idea and you'll find that the two will provide virtual identical standard errors ...
1
vote
Accepted
Examples for using mixed models in physics & engineering
As I see it, there is no reason why these models cannot be used in these domains. My feeling is that there is a degree of techniques falling in and out of fashion. Often students will learn the ...
1
vote
Accepted
Hierarchical gam (HGAM) with 'by' ordered factor and random smooth 'fs' effect: why so wiggly?
By removing 'k=20', the wiglyness disappears. I deduce (without being able to demonstrate it) that the ordered factor-based model as proposed here should not have too many degrees of freedom to be ...
0
votes
Should I pool multiple observations from the same experimental unit, or use mixed effects models
Thank you very much for this complete answer @BenBolker. I guess things do get messy with my data because my responses are non-Gaussian. Your example has quite the design I have (just simpler).
...
Top 50 recent answers are included
Synonyms
random-effects-modellinear-mixed-model
mixed-effect
random-eff-in-mixed-model
fixed-eff-in-mixed-model
Related Tags
mixed-model × 8973r × 2639
lme4-nlme × 2227
regression × 981
repeated-measures × 854
multilevel-analysis × 681
anova × 470
panel-data × 421
glmm × 382
fixed-effects-model × 379
generalized-linear-model × 362
logistic × 314
interaction × 232
nested-data × 212
linear-model × 168
multiple-regression × 160
interpretation × 155
hypothesis-testing × 146
time-series × 141
bayesian × 125
spss × 123
modeling × 117
residuals × 112
sas × 108
experiment-design × 103