lindeloev/tests-as-linear

Wrong values in the table of the section "6.1.3 R code: one-way ANOVA"

Opened this issue · 3 comments

The second line of your table (i.e. lm) are with wrong values, but the results from R are right.
Congratulations for this great tutorial!

Yup, I noticed that and came here to create an issue as well!

The fix:

lmF <- as.list(summary(b)$fstatistic)
lmF$pval <- pf(lmF$value, lmF$numdf, lmF$dendf, lower.tail = FALSE)
df = data.frame(
  model = c('Anova', 'lm'),
  df = c(a$Df[1], lmF["numdf"]),
  df.residual = c(a$Df[2], lmF["dendf"]),
  F = c(a$`F value`[1], lmF["value"]),
  p.value = c(a$`Pr(>F)`[1], lmF$pval)
)
print_df(df, 5)
tankia commented

It appears the displayed values in the Results table of section 6.1.3 are the same as the values in the Results table of section 3.0.3 only rounded to a different digit.
Considering that both sections use the object b, maybe the wrong one was referenced.

Regardless, this document is great. Two thumbs up and thanks.