# Tag Info

## New answers tagged lme4-nlme

1 vote

### How do you determine if there is a significant relationship between two variables with several factors affecting it, using R?

We assume that the question is how to determine whether stimulus is statistically significant in the presence of the other variables. First let us try a mixed model with colony as a random effect. ...
• 1,435
Accepted

### What should be normally distributed for a two-way repeated measures ANOVA? R

The linear regression model gives us a prediction that theoretically can take on any value in a continuous range when the regressor input is changed. In your data with the two categorical regressors, ...
• 366

### What should be normally distributed for a two-way repeated measures ANOVA? R

In any kind of linear regression that requires normality, that normality applies to the error term. A) No, and this is impossible in an ANOVA, since your independent $x$ variables are categorical ...
• 35.4k

### How do you determine if there is a significant relationship between two variables with several factors affecting it, using R?

I disagree with @frank's advice to include interactions (with $x$) but no main effects for the stimulus, lighting and ...
• 5,662
1 vote
Accepted

### How to specify a repeated measure in a Mixed Effect ANOVA?

The core_id should be your random effect in this analysis. Those are the units over which there are multiple observations. By my count that's 24 "clusters"...
• 68.7k

### How do you determine if there is a significant relationship between two variables with several factors affecting it, using R?

I presume that you want to know whether the linear relation between $x$ and $y$ is different depending on those additional variables, which I also presume to not be confounders. Thus, you don't want ...
• 7,576
Accepted

### Error in Fixed Effects Model

There's no such thing as a linear mixed model with only fixed effects. That's just linear regression/ordinary least squares, and you fit it using the lm function: <...
• 6,161

### How to compare groups in different measurements using lmer (lme4)?

The article you refer to is: Watts JJ, Jacobson MR, Lalang N, et al. Imaging Brain Fatty Acid Amide Hydrolase in Untreated Patients With Psychosis. Biological Psychiatry, 88(9):727-735, 2020. DOI: 10....
• 5,662
1 vote

### Cross-validation/bootstrap validation for mixed models

I think CV is pretty directly possible for mixed models (not also that confidence interval estimation via bootstrap is done a lot for mixed models): I'd actually say that with a mixed model you have ...

### Backend process of lmer function

Check the paper by its authors that goes both through the math and implementational details: Bates, D., Mächler, M., Bolker, B., & Walker, S. (2015). Fitting Linear Mixed-Effects Models Using ...
• 120k

### Mixed effects model for paired subjects in a complex design

These are good questions you are asking before moving forward with this model, which, in my opinion, has some issues. I'll address each of your questions and that should also address the problems with ...
• 3,367
Accepted

### How do I specify which variables are at which levels in a hierarchical linear model?

Some notes on your model: You have coded race multiple times as variable. Don't. It makes far more sense to code it as one variable, Race, then it does to code it ...
Accepted

### Specify an lmer model for fully crossed data with replications

Each observation in the data you simulate is independent from all the other observations. This doesn't match your $2 \times 2 \times 3$ within-subjects design with $50$ observations per cell and ...
• 2,350
1 vote
Accepted

### Choosing experimental design and sample size based on power analysis for mixed models using pilot data

Here's the problem: the estimated effect sizes you used for your power analysis are likely to be highly noisy because they come from a small dataset of 20 subjects. So much so that you probably ...
• 14.3k
1 vote

### How do I calculate weights for weighted means?

The lmer function in the lme4 package allows you to specify an argument weights that gives ...
• 102k
Accepted

### Can we have NAs (missing data) in a linear-mixed model?

Software like lmer() will typically omit any row of data that has an NA value for any variable that's in the model, outcome or predictor. From that perspective, if ...
• 68.7k

### Can we have NAs (missing data) in a linear-mixed model?

Part 1 of the question For the outcome variable, if one does not explicitly impute missing values (whether you leave records with NA in or delete them, as long as you leave the non-missing records for ...
• 24.1k
Accepted

### Should I do pairwise NA deletion for the predictors in regression and delete NAs from outcome?

This is a follow-up question to your first question about this data and I have a follow-up answer. I take advantage of your comments to the previous question to rename ...
• 5,662
Accepted

### Lmer violating residuals' normality assumption: What should I do? When "enough data" is enough?

First let's look at the data to gain a bit of understanding about the problem. ...
• 5,662
1 vote
Accepted

### Error lme: covariate must have unique values within groups

I guess that in the correlation structure of the error you have to provide the ID like this ...
• 1,323

### Lmer violating residuals' normality assumption: What should I do? When "enough data" is enough?

You could consider log-transforming your outcome variable. This would imply a multiplicative relationship between your predictors and $score$. I.e., changing your predictor variables changes score by ...
• 531

### Specify an lmer model for fully crossed data with replications

This can be done by using lmerTest, which is an extension for lmer. The correct formula is ...
• 103
1 vote
Accepted

### How to transform variance-covariance matrix into theta parameters in lme4

This is due to the formulation of the likelihood function that is optimized. Lme4 uses REML by default, which profiles out the fixed effect and the residual term. This reformulation reduces the number ...
• 103
1 vote

### How to transform variance-covariance matrix into theta parameters in lme4

Looking at the code of the function mkVarCorr it seems that I was missing scaling by residual variance ...
• 2,873