Q: Mood median test for equality of distribution in R? I do have
a<-rnorm(10,0,1)
b<-rnorm(10,3,1)

i want to test the follwing hypothesis " they are equals there is no shift " against " the second a shifted from the first" I searchd for median test wwhich used the numbers of values graters than pooled median but i could not find one and somtine the median test  i find , i can not extract the p value from it

A: Mood test for the scale of 2 samples in R:
With mood.medtest() can you compare the medians of independent samples.
If you want to compare the differnce in scale parameters you can use the function mood.test().  You can also use ansari.test() for ansari bradley test. For those tests you must test the location of the 2 Samples. You can only test on the scale with those tests, if the 2 samples have the same location.
In your example, to test on location first with the wilcoxon-Rang-Test:
    a = rnorm(10,0,1)
    b = rnorm(10,3,1)

   wilcox.test(a,b)

#       Wilcoxon rank sum exact test

#  data:  a and b
#  W = 3, p-value = 7.578e-05
#  alternative hypothesis: true location shift is not equal to 0

With this small p-value we reject the null hypothesis and we can not test on the scale, because the location is not equal.
In this case we can repare our data samples and use this alternative to test on the scale:
mood.test(a-median(a),b-median(b))

   Mood two-sample test of scale

# data:  a - median(a) and b - median(b)
# Z = 0.26482, p-value = 0.7911
# alternative hypothesis: two.sided 

If the null hypothesis to the equality of locations can't be rejected, you can use directly the mood.test() without reparation with the median:
a = rnorm(10,0,1)
b = rnorm(10,0,2)
wilcox.test(a,b)

#Wilcoxon rank sum exact test

#data:  a and b
#W = 55, p-value = 0.7394
#alternative hypothesis: true location shift is not equal to 0

In this case we can't reject the Hypothesis H1, that the locations are equal and we use directly the Mood-Test to compare the scale:
 mood.test(a,b)

#Mood two-sample test of scale

# data:  a and b
#Z = -0.82389, p-value = 0.41
#alternative hypothesis: two.sided


A: Mood's median test is built into base R with mood.test():
set.seed(123)

n <- 10000
a <- rnorm(n, 0, 1)
b <- rnorm(n, 3, 1)

mood_fit <- mood.test(a, b)

mood_fit
#   Mood two-sample test of scale
# 
# data:  a and b
# Z = -0.026159, p-value = 0.9791
# alternative hypothesis: two.sided

To extract the p-value, use the $p.value attribute:
mood_fit$p.value
[1] 0.9791303

