Questions tagged [lmertest]

An R package providing different kinds of tests for linear mixed effects models as implemented in 'lme4' package.

62 questions
7
votes
1 answer

How to do stepwise model with random effect (lme4 + lmerTest?)

I am trying to perform a stepwise model with a random effect, of which I can get a BIC value. The lmerTest package said it works with lme4, but I can only get it to work if I remove one of my independent variables from the model (which is a factor…
7
votes
2 answers

R 3.3.2: lme4 + lmerTest problems under Mac OS Sierra

I've stumbled upon a problem affecting the Mac OS version of R 3.3.2 (and .3 too!) when using lme4 and lmerTest. lmerTest produces an error: Error in calculation of the Satterthwaite's approximation. The output of lme4 package is returned …
RobW
  • 125
  • 7
4
votes
1 answer

How to extract the goodness-of-fit statistics from lmer() model for msummary from modelsummary package

I am using lmerTest::lmer() to perform linear regression with repeated measures data. My model contains a fixed effect (factor with 5 levels) and a random effect (subject): library(lmerTest) model_lm <- lmer(likertscore ~ task.f + (1 | subject),…
mavericks
  • 1,005
  • 17
  • 42
4
votes
2 answers

Regression equation produces model outside of all data

I'm fairly confused to why I produce a regression equation that is so outside of the range of all data in dataset. I have a feeling the equation is very sensitive to data with a big spread but Im still confused. Any assistance would be greatly…
Hamish Robertson
  • 523
  • 4
  • 11
4
votes
0 answers

Different Sum Sq and MSS using lme4::lmer and lmerTest::lmer

I get sums of squares and mean sums of squares 10x higher when I use anova on lmerTest:: lmer compared to lme4:: lmer objects. See the R log file below. Note the warning that when I attach the lmerTest package, the stats::sigma function overrides…
Larry Hunsicker
  • 406
  • 5
  • 12
3
votes
1 answer

How to extract information criterions from `lme4::lmer`-model fitted by ML and combine with model summary from REML-fitted model

I am trying to access AIC, BIC , logLik and deviance data from a model summary of an HLM fitted using maximum likelihood (ML) in lme4::lmer, and combine with essentially the same model fitted with restricted maximum likelihood (REML). The structure…
Pål Bjartan
  • 793
  • 1
  • 6
  • 18
3
votes
1 answer

why is lmer splitting up my factor into all its levels in the results?

I am running a linear mixed model for a single response variable on a predictor root.type that has 4 levels; when I run the model, I just want the information on the entire factor, but it keeps splitting it up into the levels. Any ideas? Ca.auto <-…
Skotani1
  • 149
  • 6
3
votes
0 answers

Why such large degrees of freedom on some levels in a linear mixed effects model?

I have activity budget data from wild orangutans for which I am investigating if there is a difference in the time they spend feeding, resting and travelling before a forest fire event and after the fire event. I am running a linear mixed effects…
Abi Gwynn
  • 31
  • 1
3
votes
2 answers

entering column arguments from list dataframes in a custom function using purrr::map

I am writing a custom function that does linear mixed-effects model for each element of a list with the help of purrr::map. The code block works perfectly fine, but when I turn it into a custom function, it's not clear how I should enter the…
Indrajeet Patil
  • 4,673
  • 2
  • 20
  • 51
3
votes
2 answers

Computing p-values for a null random effect model in lm4/lmerTest

Edit1: as reported by @RolandASc below there appears to be a bug in lmerTest. I already wrote an e-mail to the maintainer of the package reporting the issue. Edit2: Maintainer response: "we are working on an update, where such issues hopefully will…
blazej
  • 1,678
  • 3
  • 19
  • 41
2
votes
1 answer

why lmerTest gives different p value when data is too small?

I'm new in statistics and this package. I expected that the p value should be the same if my data multiply or divide by the same number, for example, all *10 or all *100. But since my data is too small(~10^-9), the p value is almost 1 at the…
Filiy
  • 21
  • 1
2
votes
1 answer

How can I use anova() for significance testing of lm and lmer objects while respecting variable contrast codings?

I am confused about the relationship between the significance test result shown in the output of summary() called on a lm or lmer object, and the result shown in the output of anova() called on that same object. Specifically, I don't understand (a)…
Dan K.
  • 19
  • 3
2
votes
1 answer

How to loop through a list of lmerTest outputs to extract deviance component

I am estimating multilevel models using 80 multiply imputed data sets with the package mitml. I can use the testModels() command to compare nested models, but I want to view model fit components (specifically, deviance) for each of the 80 individual…
2
votes
1 answer

Tidying objects with broom created with lmerTest does not work

I recently updated to R version 3.5.0 and R Studio version 1.1.447 (Mac El Capitan 10.11.6). When I try to tidy (with the package broom) an object created with the package 'lmerTest' I get an error message: Error in vector(type, length) : …
Benjamin Telkamp
  • 1,451
  • 2
  • 17
  • 31
2
votes
1 answer

Simulating a mixed linear model and evaluating it with lmerTest in R

I am trying to understand how to use mixed linear models to analyse my data by simulating a model, but I can't reproduce the input parameters. What am I missing? I want to start simulating a model with a random intercept for each subject. Here is…
JAQuent
  • 1,137
  • 11
  • 25
1
2 3 4 5