tests-as-linear icon indicating copy to clipboard operation
tests-as-linear copied to clipboard

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

Open FVFaleiro opened this issue 5 years ago • 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!

FVFaleiro avatar Dec 06 '19 18:12 FVFaleiro

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

sriki18 avatar Apr 08 '20 20:04 sriki18

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)

conjugateprior avatar Apr 13 '20 10:04 conjugateprior

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.

tankia avatar Oct 13 '23 16:10 tankia