Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
lme4 and nlme are R packages used for fitting linear, generalized linear and nonlinear mixed effects models. For general questions about mixed models use [mixed-model] tag.
7
votes
If the categorical variable is retained in my final model in R, then why does the post hoc a...
See:
Can ANOVA be significant when none of the pairwise t-tests is?
Discrepancy between the results of the ANOVA and the post-hoc test: How should be such results interpreted and presented? … d,d,
-d,d,
-d,d)
x = as.factor(c(0,0,1,1,2,2))
mm = lm(y~x)
### LR test 0.01058
lmtest::lrtest(mm)
### ANOVA test 0.103
mod = aov(mm)
summary(mod)
### Tukey test 0.128822
TukeyHSD(mod) …
7
votes
3
answers
463
views
If the categorical variable is retained in my final model in R, then why does the post hoc a...
lmm.1 5 -219.80 -204.71 114.90 -229.80 9.3806 2 0.009184 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1`
`
I had forgotten to include my model's summary … in my my question, so here it is:
> summary(lmm.1)
Linear mixed model fit by REML ['lmerMod']
Formula: condition ~ category.of.urbanization + (1 | river)
Data: fish
REML criterion at convergence: -214.3 …
2
votes
1
answer
81
views
R lmer help understanding my mixed model output
tbl", "data.frame"))
EDIT2: Updated model and output
mixed.lmer.all <- lmer(Intertegular.Width ~
Urban.Intensity*Sociality*Nesting + Urban.Intensity*Diet +
Genus + Sex + (1|SiteID), data=df)
summary … (mixed.lmer.all); Anova(mixed.lmer.all)
Output:
REML criterion at convergence: 2893.8
Scaled residuals:
Min 1Q Median 3Q Max
-8.8063 -0.5070 0.0109 0.5188 7.0897
Random effects …
2
votes
2
answers
250
views
Mixed Effects models approach?
mod <- glmer(value~xval+(0+xval|zone),family=gaussian(link="log"),data = dat)
#Null model
mod0 <- glmer(value~(0+xval|zone),family=gaussian(link="log"),data = dat);
anova(mod,mod0)
summary(mod)
# dispersion … and interrogation
summary(mod)
anova(mod)
lme4::VarCorr(mod)
car::Anova(mod)
Based on the diagnostics the models look good right? …
0
votes
1
answer
60
views
lmer - how to report results and group differences? [closed]
0.0996 2 0.951421
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
I settle on m7, and proceed to fit the model:
model <- lmer(Score ~ 1 + Groups*Time + (1 | ID), data = df)
summary … I also pull the ANOVA table for this model:
anova(model)
Type III Analysis of Variance Table with Satterthwaite's method
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
Groups 122.848 …
3
votes
1
answer
222
views
lme4 Inconsistency
(Model1,type=3)
summary(Model1)
Results:
Factor Pr(>F)
Group 7.643e-05
Diff 1.274e-09
Group:Diff 3.346e-16
Model2 <- lmer(RT~Group*Diff + (1|Item) + (1|Subject),data=data, lmerControl(optimizer = "bobyqa … "), REML=F, na.action=na.omit)
anova(Model2,type=3)
summary(Model2)
Results:
Factor Pr(>F)
Group 8.300e-05
Diff 1.350e-09
Group:Diff 5.308e-06
As you can see, the two models produce different results …
1
vote
Accepted
Model comparison or beta coefficient of full model?
library(lmerTest)
fm1 <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy)
fm0 <- update(fm1, . ~ . - Days)
coef(summary(fm1))["Days", "Pr(>|t|)"] ## 3.623824e-06
coef(summary(fm1, ddf = "Kenward-Roger … "))["Days", "Pr(>|t|)"] ## 3.263808e-06
anova(fm1, fm0) ## p-value: 1.226e-06
pbkrtest::KRmodcomp(fm1, fm0) ## 3.263808e-06
The odd one out here is anova(), which does a likelihood ratio test (i.e. …
3
votes
Accepted
Why estimated population variance differs from estimated $\sigma^2 + \tau^2$ in this random ...
(and shown under Random Effects by your summary(empty_model)). … This entails that the "common" variance estimate is downwardly biased, in case the true data are generated by a random-effects Anova model $Y_{ij}=\gamma_{00}+u_{0j}+e_{ij}$. …
1
vote
1
answer
77
views
Describing data structure and specifying a linear mixed model in nlme with nested and crosse...
This is the thought process I have been working through so far:
My first attempt to model the data was:
library(nlme)
m1 <- lme(MR ~ Condition * Run, random = ~1|ID, data = df)
summary(m1)
anova(m1) … (m2)
anova(m2)
Is this a correct model specification and does it capture the effect of Group? …
3
votes
AIC model selection is keeping a variable with p = 0.47
(mod1)
anova(mod1)
### log likelihood ratio 0.09421622
- (AIC(mod1)-(AIC(mod0)+2))/2
### log likelihood computed from t-statistic and degrees of freedom
### the value is 0.09422343
t = summary(mod1 … )$coefficients[6,4]
f = t^2
df = summary(mod1)$coefficients[6,3]
df/2*log(1+f*(1)/(df))
### with your values
f = 0.708^2
df = 552.4835
df/2*log(1+f*(1)/(df))
### the result is 0.2505184
The example …
0
votes
0
answers
38
views
Beta coefficients vs. Model Comparisons in LME models
I have run three non-hierarchical LME models testing how certain variables predict ratings.
self <- lmer(rating ~ own_pref + (1|subject) + (1|image),
REML = FALSE, data=td_pref1)
summary … 0.00000000077 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
mean_p1 -0.983
That said when I compare these three models with the ANOVA …
1
vote
1
answer
49
views
How to set contrasts for contrast in post-hoc comparison of linear mixed effect model in R?
regression model on RT (reaction time) with Group and Condition as fixed effects, Subject and Item as random effect:
mdl_RT <- lmer(Target_RT ~ Group * Condition + (1|Subject) + (1|ItemID_1), data = SP_RT)
summary … (mdl_RT)
Anova(mdl_RT, type = "III")
It shows that there is a significant interaction between Group and Condition, so I did a post-hoc comparison:
posthoc_rt <- emmeans(mdl_RT, pairwise ~ Group:Condition …
2
votes
0
answers
69
views
How well does my model fit? Specifying a null-model in non-linear mixed models
the model:
model.1 <- nlme(y ~ f(x, a, b),
data = d_pub,
fixed = a + b ~ 1,
random = b ~ 1 | re,
start = c(b = -0.15, a = -0.7))
# model:
summary … diff ~ f2(x, a),
data = d_pub,
fixed = a ~ 1,
random = a ~ 1|re,
start = c(a = mean(d_pub$diff)))
anova …
0
votes
0
answers
27
views
Significant effects but very small differences between contrasts
the model structure maximal, as theoretically justified (in my case including random intercepts), in accordance with Barr et al., 2013 and I have been decreasing the model structure using VarCorr() and summary … (rePCA()) and of course likelihood-ratio tests anova() to arrive at the optimal model structure. …
4
votes
Modeling repeated measures data in R - Interpretation and Validation
with all the interactions to a model with no interactions, just the main effects of GroupPatient and Timepoint.
lmm_model_1 <- lmer(Response ~ Group + Timepoint + (1|SubjectID), data = simulated_data)
summary … (lmm_model_1)
anova(lmm_model_1, lmm_model)
The lrtest is significant, suggesting that there is evidence for an interaction between GroupPatient and Timepoint:
refitting model(s) with ML (instead of REML …