0

I'm working with a set of data and I've obtained a certain correlations (using pearson's correlation coefficient). Is there a R function or package that would determine how good a correlation is by permutation tests? Or is there any other way to do this?

The example data:

data 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")

data 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")

The correlation was calculated as :

   cor1<-cor(data A, data B)

How to do the permutation tests to validate the same?

user2258452
  • 263
  • 2
  • 4
  • 9
  • What do you mean by "good"? What do you mean by "validate"? The correlation is calculated, that's the correlation in your sample. You could mean...Is the correlation is different from 0 or some other number? What is the range of correlations that are plausibly the true correlation of the population? Is this correlation is close enough to some other known value to believe they are from the same population? Is a pearson correlation an appropriate way to assess these data?...I could go on. Please clarify what "good" is and what specifically you are trying to test / validate. – John Sep 05 '13 at 06:49
  • @ John: To test the Pearson correlation coefficient by permutation. – user2258452 Sep 05 '13 at 07:20
  • But to test against what? What's the test of? – John Sep 05 '13 at 16:37
  • Check out the 'coin' package. http://cran.r-project.org/web/packages/coin/index.html – Barry Devereux Sep 04 '13 at 13:15

2 Answers2

1

Here are some of the packages that i know ,are powerfull:-

EDIT:- explaning a bit better

CART(Classification and regression tree)-rpart package(you can construct decision tree on binary as well as non binary data set depend on the result you require,in your case it is non binary.)

BNeT(bayesian network):-deal package(It is based on bayes theorem which defined a causal relationship.)

Naive Bayes classifier:-e1071 package,for some basic understanding about Navie Bayes Classifier!

There are still many for correlation in R.

Community
  • 1
  • 1
Aashu
  • 1,247
  • 1
  • 26
  • 41
0

I found this function which worked perfectly and thought I should share it here.

corPerm.R contains three functions to test the Pearson Correlation Coefficient By Permutation.

and the link for the same is

http://adn.biol.umontreal.ca/~numericalecology/Rcode/

user2258452
  • 263
  • 2
  • 4
  • 9