R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > y <- c(24300 + ,24375 + ,24375 + ,24550 + ,24725 + ,24825 + ,25100 + ,24950 + ,25325 + ,25325 + ,24800 + ,24975 + ,25125 + ,25125 + ,25125 + ,25400 + ,25175 + ,24650 + ,24775 + ,24675 + ,24825 + ,24775 + ,24675 + ,24750 + ,24875 + ,25400 + ,25400 + ,24750 + ,24900 + ,24825 + ,24875 + ,24975 + ,25375 + ,25600 + ,26000 + ,25900 + ,25850 + ,26075 + ,26275 + ,26050 + ,26000 + ,25825 + ,26075 + ,26150 + ,26275 + ,26475 + ,26500 + ,26575 + ,26425 + ,26275 + ,26375 + ,25900 + ,25850 + ,25625 + ,25900 + ,26050 + ,26150 + ,26275 + ,26100 + ,25975 + ,25975 + ,26125 + ,26175 + ,26225 + ,26225 + ,26200 + ,26275 + ,26275 + ,26275 + ,26750 + ,27075 + ,27475 + ,27525 + ,27125 + ,27000 + ,26950 + ,27075 + ,27150 + ,26875 + ,26925 + ,27150 + ,27150 + ,27425 + ,27625 + ,27475 + ,28075 + ,28075 + ,28175 + ,28350 + ,28350 + ,28500 + ,29350 + ,30225 + ,29575 + ,30125 + ,30125 + ,31150 + ,31350 + ,32175 + ,31725 + ,31600 + ,30800 + ,30800 + ,29700 + ,30875 + ,31275 + ,31500 + ,31375 + ,31400 + ,31650 + ,31975 + ,31650 + ,31975 + ,32575 + ,32025 + ,33050 + ,32300 + ,32100 + ,32250 + ,32050 + ,31975 + ,32100 + ,32025 + ,32275 + ,32100 + ,32275 + ,31975 + ,32175 + ,32375 + ,32300 + ,32450 + ,32425 + ,30800 + ,30850 + ,30750 + ,30175 + ,30350 + ,30125 + ,30625 + ,30375 + ,30425 + ,30325 + ,29825 + ,29450 + ,29100 + ,29450 + ,29550 + ,29575 + ,29425 + ,29050 + ,28525 + ,28575 + ,28500 + ,28875 + ,28625 + ,28625 + ,28925 + ,28925 + ,28950 + ,28950 + ,29100 + ,29700 + ,30000 + ,30400 + ,30375 + ,30425 + ,30625 + ,30700 + ,30825 + ,30800 + ,31100 + ,31175 + ,31025 + ,30975 + ,31025 + ,31350 + ,31075 + ,31125 + ,30900 + ,31150 + ,31575 + ,31575 + ,31375 + ,31100 + ,30975 + ,31200 + ,31125 + ,31075 + ,31275 + ,31175 + ,30950 + ,30725 + ,30900 + ,30700 + ,30625 + ,30700 + ,30650 + ,30525 + ,30850 + ,30725 + ,31025 + ,30975 + ,30550 + ,30900 + ,31000 + ,31000 + ,31000 + ,31000 + ,31325 + ,31000 + ,31000 + ,30300 + ,30575 + ,30575 + ,30775 + ,30550 + ,30750 + ,31025 + ,31000 + ,30850 + ,30600 + ,31150 + ,31800 + ,32500 + ,32325 + ,31800 + ,31850 + ,31625 + ,31750 + ,31650 + ,31525 + ,32075 + ,32725 + ,32900 + ,32775 + ,32825 + ,33200 + ,34100 + ,33800 + ,33525 + ,33775 + ,34000 + ,33425 + ,33550 + ,33400 + ,33300 + ,33400 + ,33000 + ,33500 + ,33550 + ,33725 + ,33700 + ,33600 + ,33550 + ,33500 + ,34200 + ,34000 + ,33600) > x <- c(24.90 + ,25.06 + ,25.10 + ,24.92 + ,25.46 + ,25.89 + ,25.39 + ,25.38 + ,25.25 + ,24.88 + ,25.00 + ,25.00 + ,24.07 + ,23.60 + ,23.18 + ,23.25 + ,23.04 + ,22.77 + ,22.25 + ,22.41 + ,22.50 + ,22.91 + ,22.88 + ,21.69 + ,21.19 + ,21.56 + ,22.00 + ,22.13 + ,22.27 + ,22.30 + ,21.94 + ,22.40 + ,22.77 + ,22.90 + ,23.03 + ,23.05 + ,22.41 + ,22.26 + ,21.90 + ,22.01 + ,22.62 + ,22.76 + ,23.40 + ,23.63 + ,24.05 + ,23.82 + ,23.71 + ,23.95 + ,23.61 + ,23.98 + ,23.56 + ,23.99 + ,24.33 + ,24.48 + ,24.31 + ,24.38 + ,24.63 + ,25.54 + ,25.75 + ,25.73 + ,25.85 + ,25.78 + ,25.86 + ,26.86 + ,27.36 + ,27.38 + ,26.58 + ,27.65 + ,27.73 + ,27.18 + ,27.32 + ,27.30 + ,26.90 + ,26.70 + ,26.75 + ,26.41 + ,26.29 + ,27.51 + ,27.91 + ,27.70 + ,27.28 + ,28.25 + ,27.62 + ,27.30 + ,25.94 + ,24.99 + ,25.50 + ,24.42 + ,26.58 + ,25.84 + ,26.76 + ,26.74 + ,26.68 + ,25.55 + ,26.40 + ,25.19 + ,23.94 + ,24.20 + ,24.20 + ,23.07 + ,24.07 + ,25.02 + ,24.65 + ,24.68 + ,24.63 + ,24.49 + ,25.05 + ,24.31 + ,23.90 + ,23.68 + ,24.50 + ,25.22 + ,25.48 + ,26.00 + ,26.07 + ,26.06 + ,26.22 + ,26.70 + ,27.20 + ,26.77 + ,26.11 + ,25.43 + ,24.99 + ,25.51 + ,24.00 + ,23.86 + ,22.96 + ,23.41 + ,23.17 + ,24.12 + ,23.87 + ,24.27 + ,24.40 + ,24.16 + ,25.15 + ,25.09 + ,24.60 + ,24.33 + ,24.14 + ,24.36 + ,25.40 + ,26.15 + ,26.77 + ,26.94 + ,26.33 + ,26.24 + ,26.23 + ,25.88 + ,27.00 + ,26.91 + ,27.15 + ,27.78 + ,28.73 + ,28.83 + ,28.68 + ,27.56 + ,27.15 + ,27.41 + ,27.47 + ,28.76 + ,28.47 + ,27.94 + ,27.23 + ,27.01 + ,26.15 + ,26.11 + ,27.20 + ,27.36 + ,27.33 + ,27.43 + ,28.92 + ,29.45 + ,29.01 + ,29.25 + ,29.14 + ,29.64 + ,30.40 + ,30.62 + ,31.25 + ,31.75 + ,31.30 + ,30.70 + ,31.03 + ,31.46 + ,31.28 + ,31.03 + ,30.95 + ,31.17 + ,31.29 + ,31.91 + ,32.10 + ,31.71 + ,31.90 + ,32.02 + ,32.65 + ,33.77 + ,33.51 + ,34.26 + ,34.21 + ,34.13 + ,34.73 + ,34.73 + ,34.57 + ,34.80 + ,33.98 + ,34.40 + ,34.21 + ,34.61 + ,35.25 + ,35.23 + ,35.00 + ,34.52 + ,33.82 + ,34.35 + ,34.81 + ,34.96 + ,36.69 + ,36.42 + ,36.44 + ,37.41 + ,36.40 + ,36.15 + ,35.78 + ,36.95 + ,36.14 + ,36.36 + ,37.31 + ,37.58 + ,38.00 + ,37.23 + ,37.00 + ,37.87 + ,37.70 + ,36.17 + ,36.56 + ,37.70 + ,38.77 + ,39.02 + ,39.88 + ,39.56 + ,38.52 + ,37.20 + ,38.58 + ,39.41 + ,39.08 + ,38.81 + ,38.73 + ,38.70 + ,39.23 + ,39.82 + ,39.97 + ,40.37 + ,39.54 + ,39.21 + ,39.07 + ,39.78 + ,39.40 + ,38.92) > ylab = 'Goudkoers' > xlab = 'Aandeel Umicore' > postscript(file="/var/wessaorg/rcomp/tmp/1y11e1324629370.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > histx <- hist(x, plot=FALSE) > histy <- hist(y, plot=FALSE) > maxcounts <- max(c(histx$counts, histx$counts)) > xrange <- c(min(x),max(x)) > yrange <- c(min(y),max(y)) > nf <- layout(matrix(c(2,0,1,3),2,2,byrow=TRUE), c(3,1), c(1,3), TRUE) > par(mar=c(4,4,1,1)) > plot(x, y, xlim=xrange, ylim=yrange, xlab=xlab, ylab=ylab) > par(mar=c(0,4,1,1)) > barplot(histx$counts, axes=FALSE, ylim=c(0, maxcounts), space=0) > par(mar=c(4,0,1,1)) > barplot(histy$counts, axes=FALSE, xlim=c(0, maxcounts), space=0, horiz=TRUE) > dev.off() null device 1 > lx = length(x) > makebiased = (lx-1)/lx > varx = var(x)*makebiased > vary = var(y)*makebiased > corxy <- cor.test(x,y,method='pearson') > cxy <- as.matrix(corxy$estimate)[1,1] > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Pearson Product Moment Correlation - Ungrouped Data',3,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Statistic',1,TRUE) > a<-table.element(a,'Variable X',1,TRUE) > a<-table.element(a,'Variable Y',1,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/arithmetic_mean.htm','Mean',''),header=TRUE) > a<-table.element(a,mean(x)) > a<-table.element(a,mean(y)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/biased.htm','Biased Variance',''),header=TRUE) > a<-table.element(a,varx) > a<-table.element(a,vary) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/biased1.htm','Biased Standard Deviation',''),header=TRUE) > a<-table.element(a,sqrt(varx)) > a<-table.element(a,sqrt(vary)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/covariance.htm','Covariance',''),header=TRUE) > a<-table.element(a,cov(x,y),2) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/pearson_correlation.htm','Correlation',''),header=TRUE) > a<-table.element(a,cxy,2) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/coeff_of_determination.htm','Determination',''),header=TRUE) > a<-table.element(a,cxy*cxy,2) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/ttest_statistic.htm','T-Test',''),header=TRUE) > a<-table.element(a,as.matrix(corxy$statistic)[1,1],2) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'p-value (2 sided)',header=TRUE) > a<-table.element(a,(p2 <- as.matrix(corxy$p.value)[1,1]),2) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'p-value (1 sided)',header=TRUE) > a<-table.element(a,p2/2,2) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Degrees of Freedom',header=TRUE) > a<-table.element(a,lx-2,2) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Number of Observations',header=TRUE) > a<-table.element(a,lx,2) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/2ofzi1324629370.tab") > > try(system("convert tmp/1y11e1324629370.ps tmp/1y11e1324629370.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.523 0.109 0.660