用 median。
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.
median varname [if] [in] [weight], by(groupvar) [median_options]
median_options
* by(groupvar) grouping variable
exact performs Fisher's exact test
medianties(below) assign values equal to the median to below group
medianties(above) assign values equal to the median to above group
medianties(drop) drop values equal to the median from the analysis
medianties(split) split values equal to the median equally between the two groups