Stata commands to test equality of mean and median

DataCommand to Test Equality of MeanCommand to Test Equality of Median
Paired or matchedPaired t test:
ttest var1 = var2
Wilcoxon matched-pairs signed-rank test:
signrank var1 = var2

Sign test of matched pairs:
signtest var1 = var2
Unpaired or unmatchedTwo-sample t test:
ttest var, by(groupvar)
Wilcoxon rank-sum test or Mann_Whitney test:
ranksum var, by(groupvar)

K-sample equality-of-medians test:
median var, by(groupvar)

UCLA IDRE has posted an article (link) that may provide a bit more explanation. UCLA IDRE is a great resource for learning statistical analysis. A big thank you to them.

This entry was posted in Stata. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *