Dear all, I am struggling to estimate the effect size for the Kruskal-Wallis test in Stata. I will be grateful if anyone guides me through the procedures. Thank you very much.
-
Login or Register
- Log in with
. use https://www.stata-press.com/data/r16/census (1980 Census data by state) . qreg medage i.region Iteration 1: WLS sum of weighted deviations = 24.856174 Iteration 1: sum of abs. weighted deviations = 24.899998 Iteration 2: sum of abs. weighted deviations = 24.599998 Iteration 3: sum of abs. weighted deviations = 24.499998 . qreg medage i.region Iteration 1: WLS sum of weighted deviations = 24.856174 Iteration 1: sum of abs. weighted deviations = 24.899998 Iteration 2: sum of abs. weighted deviations = 24.599998 Iteration 3: sum of abs. weighted deviations = 24.499998 Median regression Number of obs = 50 Raw sum of deviations 29.9 (about 29.700001) Min sum of deviations 24.5 Pseudo R2 = 0.1806 ------------------------------------------------------------------------------ medage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- region | N Cntrl | -2.4 .7724916 -3.11 0.003 -3.954945 -.8450546 South | -2.199999 .729936 -3.01 0.004 -3.669284 -.7307139 West | -3.199999 .7596516 -4.21 0.000 -4.729098 -1.6709 | _cons | 31.8 .5839488 54.46 0.000 30.62457 32.97543 ------------------------------------------------------------------------------ .
. use https://www.stata-press.com/data/r16/census (1980 Census data by state) . qreg medage i.region Iteration 1: WLS sum of weighted deviations = 24.856174 Iteration 1: sum of abs. weighted deviations = 24.899998 Iteration 2: sum of abs. weighted deviations = 24.599998 Iteration 3: sum of abs. weighted deviations = 24.499998 Median regression Number of obs = 50 Raw sum of deviations 29.9 (about 29.700001) Min sum of deviations 24.5 Pseudo R2 = 0.1806 ------------------------------------------------------------------------------ medage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- region | N Cntrl | -2.4 .7724916 -3.11 0.003 -3.954945 -.8450546 South | -2.199999 .729936 -3.01 0.004 -3.669284 -.7307139 West | -3.199999 .7596516 -4.21 0.000 -4.729098 -1.6709 | _cons | 31.8 .5839488 54.46 0.000 30.62457 32.97543 ------------------------------------------------------------------------------ . predict fitted, xb . list state region medage fitted in 1 +------------------------------------+ | state region medage fitted | |------------------------------------| 1. | Alabama South 29.30 29.6 | +------------------------------------+ . di 31.8 -2.199999 29.600001 *the median age (medage) is lower (and statistically significantly so) in South vs. NE (the reference category) -region-* . list state region medage fitted in 2 +-----------------------------------+ | state region medage fitted | |-----------------------------------| 2. | Alaska West 26.10 28.6 | +-----------------------------------+ . di 31.8 -3.199999 28.600001 *the median age (medage) is lower (and statistically significantly so) in West vs. NE -region-* . list state region medage fitted in 13 +--------------------------------------+ | state region medage fitted | |--------------------------------------| 13. | Illinois N Cntrl 29.90 29.4 | +--------------------------------------+ . di 31.8 -2.4 29.4 *the median age (medage) is lower (and statistically significantly so) in N Cntrl vs. NE -region-* .
Comment