📄 ranksum.hlp
字号:
{smcl}
{* 18mar2005}{...}
{cmd:help ranksum}, {cmd:help median}{...}
{right:dialogs: {bf:{dialog ranksum}} {bf:{dialog median}}}
{hline}
{title:Title}
{p2colset 5 20 22 2}{...}
{p2col :{hi:[R] ranksum} {hline 2}}Equality tests on unmatched data{p_end}
{p2colreset}{...}
{title:Syntax}
{phang}
Wilcoxon rank-sum test
{p 8 19 2}
{cmd:ranksum} {varname} {ifin}{cmd:,} {cmd:by(}{it:groupvar}{cmd:)} [{cmd:porder}]
{phang}
Nonparametric equality-of-medians test
{p 8 18 2}
{cmd:median} {varname} {ifin} {weight}{cmd:,} {cmd:by(}{it:groupvar}{cmd:)}
[{it:{help ranksum##median_options:median_options}}]
{synoptset 21 tabbed}{...}
{synopthdr:ranksum options}
{synoptline}
{syntab:Main}
{p2coldent:* {opt by(groupvar)}}grouping variable{p_end}
{synopt :{opt porder}}probability that variable for first group is larger than
variable for second group{p_end}
{synoptline}
{marker median_options}{...}
{synopthdr:median_options}
{synoptline}
{syntab:Main}
{p2coldent:* {opt by(groupvar)}}grouping variable{p_end}
{synopt :{opt e:xact}}performs Fisher's exact test{p_end}
{synopt :{cmdab:med:ianties(below)}}assign values equal to the median to below
group{p_end}
{synopt :{cmdab:med:ianties(above)}}assign values equal to the median to above
group{p_end}
{synopt :{cmdab:med:ianties(drop)}}drop values equal to the median from the
analysis{p_end}
{synopt :{cmdab:med:ianties(split)}}split values equal to the median equally
between the two groups{p_end}
{synoptline}
{p2colreset}{...}
{p 4 6 2}* {opt by(groupvar)} is required.{p_end}
{p 4 6 2}{opt by} may be used with the above commands;
see {helpb by}.{p_end}
{p 4 6 2}{opt fweight}s are allowed with {cmd:median}; see
{help weight}.{p_end}
{title:Description}
{pstd}
{cmd:ranksum} tests the hypothesis that two independent samples (i.e.,
unmatched data) are from populations with the same distribution using the
Wilcoxon rank-sum test, which is also known as the Mann-Whitney two-sample
statistic.
{pstd}
{cmd:median} performs a nonparametric K-sample test on the equality of
medians. It tests the null hypothesis that the K samples were drawn from
populations with the same median. In the case of two samples, the test
chi-squared statistic is calculated both with and without a continuity
correction.
{pstd}
{cmd:ranksum} and {cmd:median} are for use with unmatched data. For
equality tests on matched data, see {helpb signrank}.
{title:Options for ranksum}
{dlgtab:Main}
{phang}
{cmd:by(}{it:groupvar}{cmd:)} is required. It specifies the name of the
grouping variable.
{phang}
{opt porder} displays an estimate of the probability that the variable for the
first group is larger than the variable for the second group.
{title:Options for median}
{dlgtab:Main}
{phang}
{cmd:by(}{it:groupvar}{cmd:)} is required. It specifies the name of the
grouping variable.
{phang}
{opt exact} displays the significance calculated by Fisher's exact test. In
the case of two samples, both one- and two-sided probabilities are displayed.
{phang}
{cmd:medianties(below}|{opt above}|{opt drop}|{opt split)} specifies how
values equal to the overall median are to be handled. The {cmd:median} test
computes the median for {varname} using all observations and then divides
the observations into those falling above the median and those falling below
the median. When the value for an observation is equal to the sample median,
they can be dropped from the analysis by specifying {cmd:medianties(drop)};
added to the group above or below the median by specifying
{cmd:medianties(above)} or {cmd:medianties(below)}, respectively; or if there
is more than one observation with values equal to the median, they can be
equally divided into the two groups by specifying {cmd:medianties(split)}. If
this option is not specified, {cmd:medianties(below)} is assumed.
{title:Examples}
{psee}{cmd:. ranksum mpg, by(treatment)}{p_end}
{psee}{cmd:. by foreign: ranksum mpg, by(treatment)}{p_end}
{psee}{cmd:. ranksum mpg, by(treatment) porder}{p_end}
{psee}{cmd:. by foreign: ranksum mpg, by(treatment) porder}
{psee}{cmd:. median score, by(drug)}{p_end}
{psee}{cmd:. median score, by(drug) exact}{p_end}
{psee}{cmd:. median score, by(drug) medianties(above)}{p_end}
{psee}{cmd:. median score, by(drug) medianties(below)}{p_end}
{psee}{cmd:. median score, by(drug) medianties(drop)}{p_end}
{psee}{cmd:. median score, by(drug) medianties(below) exact}
{title:Also see}
{psee}
Manual: {hi:[R] ranksum}
{psee}
Online: {helpb kwallis}, {helpb nptrend}, {helpb runtest},
{helpb signrank}, {helpb ttest}
{p_end}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -