我正在处理一组数据,并且获得了一定的相关性(使用皮尔逊相关系数)。是否有一个 R 函数或包可以通过置换测试确定相关性的好坏?或者有没有其他方法可以做到这一点?
示例数据:
数据A
structure(list(A = c(4.7671948292, 5.057230067, 5.3789958351,
6.1564088085, 4.8594252454, 5.8761895664, 4.4854758124, 4.7528916483,
4.4210848845, 3.9850111524), B = c(4.5852526479, 4.9673151031,
5.1601803995, 6.3082498288, 4.5796519129, 5.665788171, 4.2886052774,
4.4678455852, 4.4444468354, 3.8911975809)), .Names = c("A",
"B"), row.names = c("901_at", "902_at", "903_at",
"904_at", "905_at", "906_at", "907_at", "908_at",
"909_at", "910_s_at"), class = "data.frame")
数据B
structure(list(A = c(5.5552465406, 5.8527484565, 8.3272537274,
6.4436035152, 5.597121724, 7.7741738479, 4.9931115346, 5.3852788212,
6.0292060458, 4.8351702985),B = c(5.6748698406, 6.8504588796,
9.4375062219, 7.6984745916, 5.7246927142, 9.0156741296, 4.8601744963,
5.4403609238, 6.842929093, 5.474543968)), .Names = c("A", "B"
), row.names = c("901_at", "902_at", "903_at", "904_at",
"905_at", "906_at", "907_at", "908_at", "909_at",
"910_s_at"), class = "data.frame")
相关性计算如下:
cor1<-cor(data A, data B)
如何进行置换测试以验证相同的结果?