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) |
Please read this post for how to display the results in a ready-for-use format.
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.
Hi Kai, I am currently using the following code to compare the statistical difference for the coefficient between two subsamples.
qui reg DepVar IndVar if LOSS==1
est store m1
qui reg DepVar IndVar if LOSS==0
est store m2
suest m1 m2, cluster(firm)
test [m1_mean]IndVar-[m2_mean]IndVar=0
Is there a way that I can include both fixed effects (year fixed and industry fixed effects) and firm cluster in this setting? Since in other full sample tests, I use reghdfe DepVar IndVar, absorb (industry year) cluster(firm).
Thank you in advance!
Helen, I don’t know the exact answer t your question. But it looks to me a Chow test. We seem to be able to do the Chow test in a single regression with post-regression statistical tests. You may want to try adding all robustness options in that regression. See the link: https://www.stata.com/support/faqs/statistics/chow-tests/.
Hi Helen,
I came up with the same problem. I use reghdfe with multiple fixed effect and clusters. I need to test the significance of the 2 coefficients in 2 groups. Did you find a way to do this test? Thanks in advance