Python 不等样本量Mann-Whitney U检验的效应大小计算

Python 不等样本量Mann-Whitney U检验的效应大小计算,python,statistics,Python,Statistics,我想计算样本大小不等的Mann-Whitney U检验的效应大小 import numpy as np from scipy import stats np.random.seed(12345678) #fix random seed to get the same result n1 = 200 # size of first sample n2 = 300 # size of second sample rvs1 = stats.norm.rvs(size=n1, loc=0.,

我想计算样本大小不等的Mann-Whitney U检验的效应大小

import numpy as np
from scipy import stats

np.random.seed(12345678)  #fix random seed to get the same result
n1 = 200  # size of first sample
n2 = 300  # size of second sample

rvs1 = stats.norm.rvs(size=n1, loc=0., scale=1)
rvs2 = stats.norm.rvs(size=n2, loc=0.5, scale=1.5)

print(stats.mannwhitneyu(rvs1, rvs2))
我该怎么办? 我知道效应大小=统计/sqrt(样本大小),但我想知道这个等式是否不能应用于不相等的样本大小。

import numpy as np
from scipy import stats

np.random.seed(12345678)  #fix random seed to get the same result
n1 = 200  # size of first sample
n2 = 300  # size of second sample

rvs1 = stats.norm.rvs(size=n1, loc=0., scale=1)
rvs2 = stats.norm.rvs(size=n2, loc=0.5, scale=1.5)

print(stats.mannwhitneyu(rvs1, rvs2))
r=1–(2U)/(n1 n2)是答案