4
$\begingroup$

I am fitting the following model (random intercepts and slopes) on my data:

lmer(MuscleActivity ~ Period+ (1 + Period|ppnr), data = df) 

My goal is to test whether the muscle activity during stimuli presentation is larger than during muscle activity during random time points.

The data frame looks something like this:

Participant MuscleActivity Period
1 0.3 Stimuli
1 0.1 Stimuli
1 0.7 Stimuli
1 0.2 Random
1 0.3 Random
1 0.1 Random
... ... ...

Running summary(model) results in no errors except this warning:

boundary (singular) fit: see help('isSingular')

...which I think is due to some participant only having one observation. Now when I call confint(model), I get a wall of warnings and the following output:

2.5% 97.5%
.sig01 NA NA
.sig02 NA NA
.sig03 NA NA
.sigma NA NA
(Intercept) -0.000423 0.00031
PeriodStimuli -0.00022 0.000284

The warnings contain this message repeated many times:

Warning: NAs detected in profilingWarning: Last two rows have identical or NA .zeta values: using minstepWarning: NAs detected in profilingWarning: Last two rows have identical or NA. 

And this warning:

profilingWarning: non-monotonic profile for .sig02Warning: NAs detected in profilingWarning:

As well as this warning:

.sig01Warning: no non-missing arguments to min; returning InfWarning: non-monotonic profile for 

Could someone help me understand these errors?

$\endgroup$
3
  • 2
    $\begingroup$ I disagree with the vote to close as a programming question. These warning messages all seem to have a basis in the underlying statistics. $\endgroup$
    – Dave
    Mar 14, 2023 at 11:49
  • 2
    $\begingroup$ I agree. This isn't a programming issue and clearly a by-product of the data structure that needs to be explained. $\endgroup$ Mar 14, 2023 at 11:56
  • 1
    $\begingroup$ I also agree that this should stay open. See stats.meta.stackexchange.com/q/5985/1352 $\endgroup$ Mar 14, 2023 at 15:20

1 Answer 1

1
$\begingroup$

Your problem is already here, which is a well-documented problem in mixed modeling with lme4:

boundary (singular) fit: see help('isSingular')

When you have a singular model fit, this is a massive problem and renders pretty much all of your regression output useless. Since you also have extremely close-to-zero confidence intervals, you probably have a random variance structure that doesn't match your data. I think this makes sense if you have some participants with one point of estimation, as they wouldn't anyways have a slope that can be estimated, but regardless you probably have other issues going on that you should check with exploratory data analysis (checking grouped scatter plots, making sure you have enough clusters / observations per cluster, etc.).

You should in any case consider trying to fit a less complex model and see what the output looks like. I provide some citations below regarding model complexity issues and how cluster effects can influence this.

Citations

  • Austin, P. C., & Leckie, G. (2018). The effect of number of clusters and cluster size on statistical power and Type I error rates when testing random effects variance components in multilevel linear and logistic regression models. Journal of Statistical Computation and Simulation, 88(16), 3151–3163. https://doi.org/10.1080/00949655.2018.1504945
  • Bates, D., Mächler, M., Bolker, B., & Walker, S. (2015). Fitting linear mixed-effects models using lme4. Journal of Statistical Software, 67(1). https://doi.org/10.18637/jss.v067.i01
  • Matuschek, H., Kliegl, R., Vasishth, S., Baayen, H., & Bates, D. (2017). Balancing Type I error and power in linear mixed models. Journal of Memory and Language, 94, 305–315. https://doi.org/10.1016/j.jml.2017.01.001
  • Meteyard, L., & Davies, R. A. I. (2020). Best practice guidance for linear mixed-effects models in psychological science. Journal of Memory and Language, 112, 104092. https://doi.org/10.1016/j.jml.2020.104092
$\endgroup$
2
  • 1
    $\begingroup$ Thanks for the quick response! Well, good that I came here then. I will read into how to choose a less complex model. $\endgroup$
    – Leon164
    Mar 14, 2023 at 12:30
  • $\begingroup$ I've added a couple other useful articles for that. The Bates article explains the syntax necessary for writing up simpler models (its written by the package creator) and the other is a best practice guide by Meteyard & Davies for fitting models. $\endgroup$ Mar 14, 2023 at 12:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.