问题描述
我有两个变量,每个变量有 4 个级别(例如,A1、A2、A3、A4、B1、B2、B3、B4)。我想将所有 A 变量与所有 B 变量相关联,并获得 r 值和 p 值(即总共 16 个相关性)。我还想用错误发现率 (fdr) 调整我的 p 值。
通常,我会使用 c
(见下文),但这将也计算我的 A 和 B 变量之间的相关性(例如,B1 与B2、B1 和 B3...),这意味着我的 FDR 校正将比我想要的更保守(即,假设我已经计算了 16 个以上的相关性)。
基本上,我如何使用 import random
stats = []
## Generate the stats
for x in range(7):
stats.append(random.randint(1,10))
## If the sum total is 40,leave em.
if sum(stats) == 40:
pass
## If it is less than 40,add +1's randomly until you reach 40.
elif sum(stats) < 40:
while sum(stats) != 40:
stat = random.randint(0,6)
if stats[stat] != 10:
stats[stat] = stats[stat] + 1
## If it is more than 40,subtract randomly until you reach 40.
elif sum(stats) > 40:
while sum(stats) != 40:
stat = random.randint(0,6)
if stats[stat] != 1:
stats[stat] = stats[stat] - 1
strength = stats[0]
perception = stats[1]
endurance = stats[2]
charisma = stats[3]
intelligence = stats[4]
agility = stats[5]
luck = stats[6]
(或类似函数)来获得,1)仅我的一些变量(不是我的所有变量)和 2 之间的 Pearson 相关性) 计算对这些相关性的修正 p 值检验。谢谢。
corr.test
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)