Akihiro Koyama

2017-Nov-27 18:12 UTC

### [R] How to extract coefficients from sequential (type 1) ANOVAs using lmer and lme

I wantto run sequential ANOVAs (i.e. type I sums of squares), and trying to getresults including ANOVA tables and associated coefficients for predictive variables(I am using the R 3.4.2 version). I think ANOVA tables look right, but believecoefficients are wrong. Specifically, it looks like that the coefficients arefrom ANOVA with ?marginal? (type III sums of squares). I have tried both lme (nlmepackage) and lmer (lme4 + lmerTEST packages). Examples of the results arebelow: ? ?> #mixed-effect modelusing lme>model.short.psme.bulk.d13c.3 <- lme(isotopebulk_add_log ~narea+sampleheight, random= ~1|tree,+??????????????????????????? data =ht_data_short_psme, na.action = na.exclude)>?>anova(model.short.psme.bulk.d13c.3, type ="sequential")???????????? numDF denDF?? F-value p-value (Intercept)????? 1????3 1840.5678? <.0001 narea??????????? 1???? 2??18.4876? 0.0501 sampleheight???? 1????2?? 11.6159? 0.0764 ?>anova(model.short.psme.bulk.d13c.3, type ="marginal")???????????? numDF denDF? F-value p-value (Intercept)????? 1????3 629.4711? 0.0001 narea???? ???????1????2?? 2.7831? 0.2372 sampleheight???? 1????2? 11.6159? 0.0764>>summary(model.short.psme.bulk.d13c.3, type ="sequential")$tTable?????????????????? Value? Std.Error DF??t-value????? p-value (Intercept)?? 1.76871397 0.07049685? 3 25.089262 0.0001388446 narea??????? -0.09295561 0.05571991? 2 -1.668266 0.2372012082 sampleheight? 0.13232709 0.03882599? 2?3.408209 0.0763589527 ?(Intercept)??1.76871397 0.07049685? 3 25.0892620.0001388446 ?>summary(model.short.psme.bulk.d13c.3, type ="marginal")$tTable?????????????????? Value? Std.Error DF??t-value????? p-value (Intercept)?? 1.76871397 0.07049685? 3 25.089262 0.0001388446 narea??????? -0.09295561 0.05571991? 2 -1.668266 0.2372012082 sampleheight? 0.13232709 0.03882599? 2?3.408209 0.0763589527 ? ? Ibelieve the results from summary() are for ?marginal? instead of ?sequential?ANOVA because the p-value (i.e., 0.237 for narea) in summary are identical tothose in tables from ?marginal?. I also used lmer in the lme4 pacakge to findthe same results (summary() results look like from ?marginal?). ? Cananybody tell me how to get coefficients for ?sequential? ANOVAs? Thank you. [[alternative HTML version deleted]]

### Seemingly Similar Threads

- parallel computing with foreach()
- SIAR problem with model running
- parallel computing with foreach()
- Error in Summary.factor(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 4L, : max not meaningful for factors
- How to extract coefficients from sequential (type 1), ANOVAs using lmer and lme