Skip to content
Snippets Groups Projects
Unverified Commit eac74879 authored by Joost van Heerwaarden's avatar Joost van Heerwaarden Committed by GitHub
Browse files

Update 2_analysis.R

parent 19857daf
No related branches found
No related tags found
No related merge requests found
......@@ -36,13 +36,23 @@ ggsave(filename = "./results/figures/summary_plot.png",
fit <- lm(yield_tha ~ farm + fertilizer, data = d)
## Get an ANOVA table
anova(fit)
av=anova(fit)
## Calculate Estimated Marginal Means, aka adjusted means:
## These are the mean yield for each combination of farm and fertilizer
## as the model predicts them.
emms <- emmeans(fit, ~ farm + fertilizer)
##open text file to write results to
sink(file="results/raw/various_stats.txt")
print("anova table:")
print(av)
print("em means table:")
print(emms)
sink()
## Fancy graph: combining raw data and adjusted means and their corresponding
## confidence interval
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment