Issue with recalculating p-values in a mixed model using lme4 package in R
I'm trying to figure out I'm currently working on a mixed-effects model using the `lme4` package in R (version 1.1-27.1) and am facing a challenge with recalculating p-values for my fixed effects after modifying the model structure. Initially, I ran the model with the following code: ```R library(lme4) model <- lmer(response ~ predictor1 + (1|random_effect), data = my_data) summary(model) ``` This provided me with a p-value for `predictor1`, but I wanted to add another fixed effect, `predictor2`, to see how it influences the response: ```R model_updated <- update(model, . ~ . + predictor2) ``` After updating the model, I noticed that the p-values were not being recalculated when I called `summary(model_updated)`. They still seemed to reflect the original model's output. I tried using the `anova()` function to compare the two models: ```R anova(model, model_updated) ``` However, the p-values for `predictor1` remained the same and didn't provide validation for the change in model structure. Additionally, I explored the `lmertest` package to obtain p-values using the `anova()` method, but still ran into the same issue: ```R library(lmerTest) model_test <- lmerTest::lmer(response ~ predictor1 + predictor2 + (1|random_effect), data = my_data) summary(model_test) ``` The output still shows these p-values as NA for the new fixed effect. I suspect it might be related to the structure of my data or perhaps the way I'm interpreting the output of the `lmer` function. Has anyone encountered this issue or knows how to correctly obtain updated p-values in mixed models? Any advice or best practices would be greatly appreciated! I'm coming from a different tech stack and learning R. Thanks in advance! Thanks in advance! I'm on CentOS using the latest version of R.