Data | Command to Test Equality of Mean | Command to Test Equality of Median |
---|---|---|
Paired or matched | Paired t test:ttest var1 = var2 | Wilcoxon matched-pairs signed-rank test:signrank var1 = var2 Sign test of matched pairs: signtest var1 = var2 |
Unpaired or unmatched | Two-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.