ANOVA, ANOVA Multiple Comparisons & Kruskal Wallis in R | R Tutorial 4.9 | MarinStatsLectures| - YouTube

Channel: MarinStatsLectures-R Programming & Statistics

[0]
hi I'm Mike Marin and in this video
[3]
we'll talk about conducting one-way
[5]
analysis of variance and kruskal-wallis
[7]
one-way analysis of variance using our
[11]
one-way analysis of variance is a
[14]
parametric method appropriate for
[16]
comparing the means of two or more
[18]
independent populations we will work
[21]
with a set of data that compares weight
[24]
loss for four different diets I've
[26]
already gone ahead and imported the data
[29]
into R and attached it we will explore
[33]
the relationship between weight loss and
[35]
diet type we can conduct an analysis of
[39]
variance using the AOV command in R to
[43]
access the help menu type help and in
[45]
brackets the name of the command you
[47]
would like help for or simply throw a
[49]
question mark in front of the command
[51]
name before conducting the test it can
[54]
be useful to examine a box plot of the
[56]
data here we would like to compare
[58]
weight loss separated by diet type in
[64]
one-way analysis of variance we are
[66]
testing the null hypothesis that the
[69]
mean weight loss is the same for all
[73]
diets we can conduct the analysis of
[78]
variance using the AOV command here we
[81]
would like to compare weight losses
[82]
separated by diet type as noted in
[87]
earlier videos in this series we may
[90]
like to save the output of this test in
[92]
an object here I'll save it in an object
[95]
called ANOVA one we can have our return
[103]
to us a bit more informative summary
[105]
using the summary command here we would
[109]
like a summary of the analysis of
[111]
variance we fit we can see that we are
[114]
returned the sum of squares the mean
[117]
squares the F statistic of 6.11
[121]
8 and the p-value of 0.001 1:3 recall in
[128]
earlier videos in this series we learned
[131]
the attributes command
[135]
we can use this command to ask our to
[138]
let us know all that is stored in this
[141]
object ANOVA 1 we've also seen that we
[145]
can extract certain attributes from this
[148]
object using the dollar sign here we can
[150]
pull up the coefficients now back to our
[157]
analysis of variance here we can see
[160]
that we will reject the null hypothesis
[162]
and conclude that we have evidence to
[165]
believe not all means are equal we can
[168]
use multiple comparisons to help us
[170]
decide which means or diets may differ
[173]
from the others one option is to use the
[176]
Tukey HSD command here we would like to
[179]
conduct all possible pairwise
[181]
comparisons for this analysis of
[183]
variance fit we are returned overall 95%
[188]
confidence intervals for the difference
[190]
in means of all possible pairs we are
[193]
also returned and adjusted p-value if we
[197]
would like a visual display of this
[198]
table we can add a plot command around
[202]
this Tukey HSD command here we can now
[207]
see a visual display which helps us
[209]
identify which means or diets differ
[212]
from each other and which do not we can
[215]
edit this plot in the same way that we
[217]
saw in earlier videos in this series
[219]
when discussing plotting for example we
[223]
can set the lis argument equal to 1 to
[226]
rotate the labels on the y axis let's
[230]
now talk about producing the
[232]
kruskal-wallis one-way analysis of
[235]
variance using ranks kruskal-wallis
[238]
one-way analysis of variance is a
[240]
nonparametric equivalent to the one-way
[243]
analysis of variance we can conduct this
[246]
test in our using the Kruskal test
[249]
command just make sure to not let
[251]
Wallace know they left his name out of
[253]
this command here again we would like to
[256]
compare the weight loss for different
[259]
diet types once again we will reject the
[262]
null in the next video in this series we
[266]
will
[266]
Gus pearson's chi-squared test of
[268]
Independence thanks for watching this
[271]
video and make sure to check out my
[272]
other instructional videos