Which loan purpose mean is different?
Before we examine other factors besides purpose_recode
that might influence the amount of loan funded, let's examine which means of purpose_recode
are different. This is the post-hoc test referred to in the last exercise.
The result of that ANOVA test was statistically significant with a very low p-value. This means we can reject the null hypothesis and accept the alternative hypothesis that at least one mean was different. But which one?
We should use Tukey's HSD test, which stands for Honest Significant Difference. To conduct Tukey's HSD test in R, you can use TukeyHSD()
:
TukeyHSD(aov_model, "independent_variable_name", conf.level = 0.9)
This would conduct Tukey's HSD test on some aov_model
, looking at a specific "independent_variable_name"
, with a conf.level
of 90%.
Diese Übung ist Teil des Kurses
Experimental Design in R
Anleitung zur Übung
- Build a model using
aov()
that examinesfunded_amnt
bypurpose_recode
. Save it aspurpose_aov
. - Use
TukeyHSD()
to conduct the Tukey's HSD test onpurpose_aov
with a confidence level of 0.95. Save as an object calledtukey_output
. - Tidy
tukey_output
withtidy()
from thebroom
package (which has been loaded for you.)
Interaktive Übung
Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.
# Use aov() to build purpose_aov
___ <- aov(___ ~ ___, data = ___)
# Conduct Tukey's HSD test to create tukey_output
___ <- TukeyHSD(___, "___", conf.level = ___)
# Tidy tukey_output to make sense of the results
tidy(___)