hawkmu
初学R,首先想用来解决一点spss可以解决的问题,如T检验:
数据保存为两个x y 两个txt file。 每行是某个个体,每列是一个变量。如下x包括28个个体,300个变量。y包括26个个体,300个变量。
请问如何比较3个变量在x y两组中是否存在差异。
我用了 t.test(a,b)结果是 :
> t.test(x,y)
Welch Two Sample t-test
data: x and y
t = 0, df = 16798, p-value = 1
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-0.00937824 0.00937824
sample estimates:
mean of x mean of y
0.09113004 0.09113004
这个结果是把x 和y当作1个变量来处理了。
请问正确的方式是如何做?
谢谢