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
Creating a variable containing number of decimal points of another variable's valuesHi, I have a variable measuring speed. The values are double and vary in the number of decimal point…
New version of somersd on SSCThanks as always to Kit Baum, a new version of the somersd package is now available for download fro…
Dropping individuals when missing observations and change in variableHi, I am running panel data analysis in Stata and work with Survey data from Germany. The period co…
regression on filtered dataIs there any disadavntage associated with the filtered regression wherein you you have filtered the …
Converting CSV file to Excel and then uploading it into Stata formathttps://www.eia.gov/beta/internation...=2014&end=2016 Hi, I would like to convert the above fi…
Subscribe to:
Post Comments (Atom)
0 Response to Exporting output of ManWitney U Test
Post a Comment