# Tag Info

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 ...
• 461

### 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 ...
• 53.6k
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 ...
• 66.5k

### 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 ...
• 26.7k
Accepted

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 ...
• 66.5k
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 ...
• 50.3k
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), ...
• 99.5k

### 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....
• 117k
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 ...
• 50.3k
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 ...
• 66.5k
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 ...
• 66.5k
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 ...
• 511

### 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 ...
• 50.3k

### 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 ...
• 50.3k

### 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,...
• 13.2k
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 ...
• 36k
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 ...
• 49.8k
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 ...
• 117k
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 ...
• 31.5k
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 ...
• 76.9k
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 ...
• 36.2k
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,207
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 ...
• 549

### 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 ...
• 50.3k
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 ...
• 26.2k
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)
• 50.3k

### 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 ...
• 99.5k
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 ...
• 66.5k