馃攳
Mann Whitney U / Wilcoxon Rank-Sum Test in R | R Tutorial 4.3 | MarinStatsLectures - YouTube
Channel: MarinStatsLectures-R Programming & Statistics
[0]
hi I'm Mike Marin and in this video
[3]
we'll talk about how to conduct the
[5]
mann-whitney u test also known as the
[8]
wilcoxon rank-sum test using are the
[12]
mann-whitney u also known as wilcoxon
[15]
rank-sum test is a nonparametric method
[18]
appropriate for examining the difference
[20]
in medians for two independent
[22]
populations this can also be thought of
[26]
as a way of examining the relationship
[28]
between a numeric outcome or Y variable
[31]
and a categorical explanatory or X
[34]
variable when the groups formed by the
[37]
explanatory variable are independent we
[40]
will be working with the lung capacity
[42]
data that was introduced earlier in this
[45]
series of videos I've already gone ahead
[48]
and imported the data into R and
[50]
attached it we will explore the
[53]
relationship between smoking and lung
[55]
capacity we can use the Wilcock test
[59]
command to conduct this nonparametric
[61]
test to access the help menu in our type
[64]
help and in brackets the name of the
[67]
command you would like help for or
[68]
simply throw a question mark in front of
[72]
the name of the command before
[76]
conducting the test it can be useful to
[78]
examine a box plot of the data here we
[81]
can examine the relationship between
[83]
lung capacity and smoking now let's go
[88]
ahead and test the null hypothesis that
[91]
the median lung capacity of smokers is
[98]
equal to that of non-smokers let's also
[103]
go ahead and conduct a two-sided test we
[108]
can do this test in r using the Wilcock
[111]
dot test command here we would like to
[113]
compare lung capacities for smokers and
[118]
non-smokers we can set the mu argument
[122]
equal to zero to test that the
[124]
difference in medians is zero we can use
[127]
the alt argument to specify that we
[130]
would like a two-sided alternative
[133]
we can use the comp dot int argument and
[136]
set this equal to true to have a
[138]
nonparametric confidence interval
[140]
returns to s we can use the comfort
[143]
level argument to set the level of
[145]
confidence we would like for our
[147]
confidence interval we can set the
[150]
Parrot argument equal to false or simply
[153]
capital F to let R know that these
[156]
groups are not paired that they are
[158]
independent finally we can set the exact
[162]
argument equal to true if we would like
[164]
to have an exact p-value computed not an
[167]
approximate one and we can set the
[170]
correct argument equal to true if we
[173]
would like our to use a continuity
[175]
correction we can see the test statistic
[179]
of two zero one two eight
[181]
the p-value of 0.005 five the 95%
[187]
confidence interval of negative one
[189]
point three nine nine up to negative
[192]
zero point two four nine nine as well as
[196]
the difference in medians of negative
[198]
zero point eight we can also see a
[201]
warning from our letting us know that
[203]
the exact p-value an exact confidence
[206]
interval cannot be calculated when there
[208]
are ties in the ranks of observations as
[211]
noted earlier we can set the exact
[215]
argument equal to false if we would not
[217]
like to have exact p-values and
[219]
confidence intervals calculated you can
[222]
also note the change in p-value and
[225]
confidence interval are fairly minimal
[227]
it's worth noting that all of the
[230]
arguments set in the initial command we
[232]
provided to our are the default values
[235]
except for the conf int argument equal
[239]
to true R will not return a confidence
[241]
interval unless we specifically asked
[243]
for this in the next video in this
[247]
series we will discuss the paired t-test
[249]
and how to conduct this test using our
[252]
thanks for watching this video and make
[254]
sure to check out my other instructional
[256]
videos
Most Recent Videos:
You can go back to the homepage right here: Homepage





