Re: [R] Obtaining correlation parameters for multiple rows

2008-04-25 Thread jpnitya
Hi Jorge, That was great! Thank you very much for the suggestion. I just had to make a couple of minor changes (e.g., pearson vs. spearman) and it worked perfectly. Thanks, Joao Pedro Hi, I'm sure it could be better but try this: # F statistics based on lm FSTAT=function(y,x) summary(lm(y~

Re: [R] Obtaining correlation parameters for multiple rows

2008-04-24 Thread Jorge Ivan Velez
Hi, I'm sure it could be better but try this: # F statistics based on lm FSTAT=function(y,x) summary(lm(y~x))$f[1] # Correlation and p-value CORR=function(y,x){ tc=cor.test(x,y,method="spearman",alternative="two.sided") temp=matrix(c(tc$estimate,tc$p.value),ncol=2) colnames(temp)=c('rho','pvalue

[R] Obtaining correlation parameters for multiple rows

2008-04-24 Thread jpnitya
Hi, I would like to obtain correlation parameters (e.g., coefficients, p-value) for multiple samples in regard to a reference. I have my data in a table with the reference as the second row (first row are headers) and then each sample in a row. What I do so far is load up the data, get the refere