Hi,
I am unable to find a way to export output of ManWitney U (ranksum) Test for independent samples.
Here is how data looks (sample for few observations):
cat tot_dis
Batch 18
Batch 1
Stream 12.5
Stream 5.5
Stream 15
Batch 19
Batch 6.5
Batch 10
Stream 0
Stream 3.5
Batch 3
I am running this code:
ranksum tot_dis, by(cat)
scalar define U1=r(sum_obs)-r(N_1)*(r(N_1)+1)/2
scalar define U2=r(N_1)*r(N_2)-U1
display in smcl as text "Mann-WhitneyU="as result min(U1,U2)
This is the output:
Two-sample Wilcoxon rank-sum (Mann-Whitney) test
cat | obs rank sum expected
-------------+---------------------------------
Batch | 172 23438 22704
Stream | 91 11278 12012
-------------+---------------------------------
combined | 263 34716 34716
unadjusted variance 344344.00
adjustment for ties -588.32
----------
adjusted variance 343755.68
Ho: tot_dis(cat==Batch) = tot_dis(cat==Stream)
z = 1.252
Prob > |z| = 0.2106
. scalar define U1=r(sum_obs)-r(N_1)*(r(N_1)+1)/2
. scalar define U2=r(N_1)*r(N_2)-U1
. display in smcl as text "Mann-WhitneyU="as result min(U1,U2)
Mann-WhitneyU=7092
.
end of do-file
This is what I need help on:
How can I export value of U and p value? I have to do this for many variables and copy pasting is time consuming.
Thanks in anticipation.
Puran
Related Posts with Exporting output of ManWitney U Test
Pre-announcement driftDear Statalist, I would really apreciate any help/tips members have to offer on this topic. I am w…
Compare multiple regression coefficients across regression modelsHi guys, I want to compare coefficients across two different regression models. I found a useful in…
Dynamically rename variable (using "word()")I have a dataset that looks as follows: Code: clear input str7 index int data "EOSQ041" 42…
Measuring change in logistic random effects modelHi! I am doing a longitudinal analysis on the effects of firm contexts/practices on employees' rela…
How can I export both variable label and variable name to excel from stataHi everyone, I would like to export both variable label and variable name with data to excel from st…
Subscribe to:
Post Comments (Atom)
0 Response to Exporting output of ManWitney U Test
Post a Comment