Home » date » 2010 » Dec » 12 »

Ws 10 - Pearson Correlation Matrix

*The author of this computation has been verified*
R Software Module: Patrick.Wessa/rwasp_pairs.wasp (opens new window with default values)
Title produced by software: Kendall tau Correlation Matrix
Date of computation: Sun, 12 Dec 2010 13:27:16 +0000
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2010/Dec/12/t1292160523lcy94u4sabpynwt.htm/, Retrieved Sun, 12 Dec 2010 14:28:44 +0100
 
BibTeX entries for LaTeX users:
@Manual{KEY,
    author = {{YOUR NAME}},
    publisher = {Office for Research Development and Education},
    title = {Statistical Computations at FreeStatistics.org, URL http://www.freestatistics.org/blog/date/2010/Dec/12/t1292160523lcy94u4sabpynwt.htm/},
    year = {2010},
}
@Manual{R,
    title = {R: A Language and Environment for Statistical Computing},
    author = {{R Development Core Team}},
    organization = {R Foundation for Statistical Computing},
    address = {Vienna, Austria},
    year = {2010},
    note = {{ISBN} 3-900051-07-0},
    url = {http://www.R-project.org},
}
 
Original text written by user:
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
104,37 1 167.16 101,56 100,93 104,89 2 179.84 102,13 101,18 105,15 3 174.44 102,39 101,11 105,72 4 180.35 102,42 102,42 106,38 5 193.17 103,87 102,37 106,40 6 195.16 104,44 101,95 106,47 7 202.43 104,97 102,20 106,59 8 189.91 105,17 103,35 106,76 9 195.98 105,35 103,65 107,35 10 212.09 104,65 102,06 107,81 11 205.81 106,62 102,66 108,03 12 204.31 107,05 102,32 109,08 1 196.07 112,30 102,21 109,86 2 199.98 114,70 102,33 110,29 3 199.1 115,40 104,41 110,34 4 198.31 115,64 104,33 110,59 5 195.72 115,66 105,27 110,64 6 223.04 114,50 105,34 110,83 7 238.41 115,14 104,88 111,51 8 259.73 115,41 105,49 113,32 9 326.54 119,32 105,90 115,89 10 335.15 124,77 105,39 116,51 11 321.81 130,96 104,40 117,44 12 368.62 141,02 106,19 118,25 1 369.59 150,60 106,54 118,65 2 425 151,10 108,26 118,52 3 439.72 157,19 106,95 119,07 4 362.23 157,28 108,32 119,12 5 328.76 156,54 108,35 119,28 6 348.55 159,62 109,29 119,30 7 328.18 163,77 109,46 119,44 8 329.34 165,08 109,50 119,57 9 295.55 164,75 109,84 etc...
 
Output produced by software:

Enter (or paste) a matrix (table) containing all data (time) series. Every column represents a different variable and must be delimited by a space or Tab. Every row represents a period in time (or category) and must be delimited by hard returns. The easiest way to enter data is to copy and paste a block of spreadsheet cells. Please, do not use commas or spaces to seperate groups of digits!


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'George Udny Yule' @ 72.249.76.132


Correlations for all pairs of data series (method=pearson)
BroodMaandTarweMeelWater
Brood10.1040.3830.9740.937
Maand0.10410.0530.050.039
Tarwe0.3830.05310.4030.162
Meel0.9740.050.40310.917
Water0.9370.0390.1620.9171


Correlations for all pairs of data series with p-values
pairPearson rSpearman rhoKendall tau
Brood;Maand0.10390.17660.1617
p-value(0.4418)(0.1889)(0.0852)
Brood;Tarwe0.38310.19710.1286
p-value(0.0033)(0.1417)(0.1582)
Brood;Meel0.97360.77390.614
p-value(0)(0)(0)
Brood;Water0.93690.91890.7796
p-value(0)(0)(0)
Maand;Tarwe0.05260.20480.1402
p-value(0.6976)(0.1264)(0.1354)
Maand;Meel0.04950.09680.0831
p-value(0.7144)(0.4737)(0.3762)
Maand;Water0.03910.02750.0286
p-value(0.7728)(0.8392)(0.761)
Tarwe;Meel0.40340.55450.4048
p-value(0.0019)(0)(0)
Tarwe;Water0.16170.16460.1115
p-value(0.2295)(0.2203)(0.2205)
Meel;Water0.91740.76960.589
p-value(0)(0)(0)
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/12/t1292160523lcy94u4sabpynwt/1po3h1292160434.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/12/t1292160523lcy94u4sabpynwt/1po3h1292160434.ps (open in new window)


 
Parameters (Session):
par1 = pearson ;
 
Parameters (R input):
par1 = pearson ;
 
R code (references can be found in the software module):
panel.tau <- function(x, y, digits=2, prefix='', cex.cor)
{
usr <- par('usr'); on.exit(par(usr))
par(usr = c(0, 1, 0, 1))
rr <- cor.test(x, y, method=par1)
r <- round(rr$p.value,2)
txt <- format(c(r, 0.123456789), digits=digits)[1]
txt <- paste(prefix, txt, sep='')
if(missing(cex.cor)) cex <- 0.5/strwidth(txt)
text(0.5, 0.5, txt, cex = cex)
}
panel.hist <- function(x, ...)
{
usr <- par('usr'); on.exit(par(usr))
par(usr = c(usr[1:2], 0, 1.5) )
h <- hist(x, plot = FALSE)
breaks <- h$breaks; nB <- length(breaks)
y <- h$counts; y <- y/max(y)
rect(breaks[-nB], 0, breaks[-1], y, col='grey', ...)
}
bitmap(file='test1.png')
pairs(t(y),diag.panel=panel.hist, upper.panel=panel.smooth, lower.panel=panel.tau, main=main)
dev.off()
load(file='createtable')
n <- length(y[,1])
n
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,paste('Correlations for all pairs of data series (method=',par1,')',sep=''),n+1,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,' ',header=TRUE)
for (i in 1:n) {
a<-table.element(a,dimnames(t(x))[[2]][i],header=TRUE)
}
a<-table.row.end(a)
for (i in 1:n) {
a<-table.row.start(a)
a<-table.element(a,dimnames(t(x))[[2]][i],header=TRUE)
for (j in 1:n) {
r <- cor.test(y[i,],y[j,],method=par1)
a<-table.element(a,round(r$estimate,3))
}
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Correlations for all pairs of data series with p-values',4,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'pair',1,TRUE)
a<-table.element(a,'Pearson r',1,TRUE)
a<-table.element(a,'Spearman rho',1,TRUE)
a<-table.element(a,'Kendall tau',1,TRUE)
a<-table.row.end(a)
cor.test(y[1,],y[2,],method=par1)
for (i in 1:(n-1))
{
for (j in (i+1):n)
{
a<-table.row.start(a)
dum <- paste(dimnames(t(x))[[2]][i],';',dimnames(t(x))[[2]][j],sep='')
a<-table.element(a,dum,header=TRUE)
rp <- cor.test(y[i,],y[j,],method='pearson')
a<-table.element(a,round(rp$estimate,4))
rs <- cor.test(y[i,],y[j,],method='spearman')
a<-table.element(a,round(rs$estimate,4))
rk <- cor.test(y[i,],y[j,],method='kendall')
a<-table.element(a,round(rk$estimate,4))
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'p-value',header=T)
a<-table.element(a,paste('(',round(rp$p.value,4),')',sep=''))
a<-table.element(a,paste('(',round(rs$p.value,4),')',sep=''))
a<-table.element(a,paste('(',round(rk$p.value,4),')',sep=''))
a<-table.row.end(a)
}
}
a<-table.end(a)
table.save(a,file='mytable1.tab')
 





Copyright

Creative Commons License

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.

Software written by Ed van Stee & Patrick Wessa


Disclaimer

Information provided on this web site is provided "AS IS" without warranty of any kind, either express or implied, including, without limitation, warranties of merchantability, fitness for a particular purpose, and noninfringement. We use reasonable efforts to include accurate and timely information and periodically update the information, and software without notice. However, we make no warranties or representations as to the accuracy or completeness of such information (or software), and we assume no liability or responsibility for errors or omissions in the content of this web site, or any software bugs in online applications. Your use of this web site is AT YOUR OWN RISK. Under no circumstances and under no legal theory shall we be liable to you or any other person for any direct, indirect, special, incidental, exemplary, or consequential damages arising from your access to, or use of, this web site.


Privacy Policy

We may request personal information to be submitted to our servers in order to be able to:

  • personalize online software applications according to your needs
  • enforce strict security rules with respect to the data that you upload (e.g. statistical data)
  • manage user sessions of online applications
  • alert you about important changes or upgrades in resources or applications

We NEVER allow other companies to directly offer registered users information about their products and services. Banner references and hyperlinks of third parties NEVER contain any personal data of the visitor.

We do NOT sell, nor transmit by any means, personal information, nor statistical data series uploaded by you to third parties.

We carefully protect your data from loss, misuse, alteration, and destruction. However, at any time, and under any circumstance you are solely responsible for managing your passwords, and keeping them secret.

We store a unique ANONYMOUS USER ID in the form of a small 'Cookie' on your computer. This allows us to track your progress when using this website which is necessary to create state-dependent features. The cookie is used for NO OTHER PURPOSE. At any time you may opt to disallow cookies from this website - this will not affect other features of this website.

We examine cookies that are used by third-parties (banner and online ads) very closely: abuse from third-parties automatically results in termination of the advertising contract without refund. We have very good reason to believe that the cookies that are produced by third parties (banner ads) do NOT cause any privacy or security risk.

FreeStatistics.org is safe. There is no need to download any software to use the applications and services contained in this website. Hence, your system's security is not compromised by their use, and your personal data - other than data you submit in the account application form, and the user-agent information that is transmitted by your browser - is never transmitted to our servers.

As a general rule, we do not log on-line behavior of individuals (other than normal logging of webserver 'hits'). However, in cases of abuse, hacking, unauthorized access, Denial of Service attacks, illegal copying, hotlinking, non-compliance with international webstandards (such as robots.txt), or any other harmful behavior, our system engineers are empowered to log, track, identify, publish, and ban misbehaving individuals - even if this leads to ban entire blocks of IP addresses, or disclosing user's identity.


FreeStatistics.org is powered by