G. wrote:
> Hello to all of you, R-expeRts!
> I am trying to compute the cor.test for a matrix that i labelled mydata
> according to mydata=read.csv...
> then I converted my csv file into a matrix with the
> mydata=as.matrix(mydata)
> NOW, I need to get the p-values from the correlations...
> I can successfully get the spearman's correlation matrix with:
> cor(mydata, method="s", use="pairwise,complete,obs")
> but then if I try the
> cor.test(mydata, method="s", use="pairwise.complete.obs")
> i always get an error message as follows:
> the "y" argument is missing and does not have any default value assigned...
> (excuse my translation)
> WHAT SHOULD I DO???
> HOW CAN I DEFINE "Y" AS A NUMERIC VECTOR???????????
> thanx guys, i just can't express myself as a computer would...
> G :)
You have to specify two vectors for the test, e.g.:
cor.test(mydata[,1], mydata[,2], method = "s",
use = "pairwise.complete.obs")
See the help page ?cor.test
Best,
Uwe
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.