计算R中的运行窗口Spearman相关和p值

时间:2015-06-22 10:15:43

标签: r correlation pearson

我希望计算R中的运行窗口Spearman相关性。 到目前为止,我一直在使用来自running包的gtools,但我只能从中获得Pearson相关性。 我试图修改fun参数,但无法让它产生任何错误。

我的输入是data.frame:

row.names   Small   Large
1   1   97.80341    88.71192
2   2   97.46807    87.96206
3   3   97.18862    88.13904
4   4   97.76615    87.67329
5   5   97.09081    87.52425
6   6   97.16067    87.85493
7   7   97.73820    88.43712

等。 这是我试图操纵的基本运行命令:

corr_table <- running (mytable$Large, mytable$Small,fun=cor, width=20, by=10, allow.fewer=FALSE, pad=FALSE, align="left")

我的第二个问题是如何添加每个“窗口”的p值?

谢谢!

1 个答案:

答案 0 :(得分:0)

确定找到了两个问题的解决方案:

<div class="item">
            <?php endif; ?>
        <?php $spCounter++; endforeach; ?>
    </div>
相关问题