R version 2.8.1 (2008-12-22) Copyright (C) 2008 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(9.103534368,9.086136769,9.082734247,9.056722883,9.047586121,9.093918909,9.086476385,9.065892468,9.067047202,9.037889935,9.038721338,9.018574356,9.095939112,9.108418382,9.075322160,9.077266018,9.064157862,9.079776002,9.093357016,9.054504940,9.079889943,9.040026434,9.062536177,9.043222649,9.081824950,9.055556158,9.009936308,9.002824077,8.995412975,9.004176841,8.998631198,8.975124239,8.974364842,8.977146485,8.997518370,8.992059976,8.993924141,8.999001866,8.985320061,8.984693690,8.976388622,8.949365142,8.952346543,8.934191535,8.904765847,8.908288886,8.909640602,8.915163618,8.924257021,8.948845729,8.939449862,8.946895524,8.967376693,8.982058643,9.010791270,9.032050676,8.994296558,9.010302809,9.026297334,9.040144995) > x <- c(8.672486076,8.669570872,8.675051276,8.675051276,8.683893367,8.708804795,8.706159291,8.693831965,8.704668113,8.704170560,8.692657961,8.615589513,8.718500048,8.726156679,8.722091302,8.734077193,8.742414583,8.765458532,8.770439087,8.764834214,8.781708986,8.757154528,8.761236807,8.751632702,8.753371421,8.734077193,8.716371865,8.723068501,8.729073550,8.722905701,8.726156679,8.717682052,8.718336502,8.727292029,8.731174901,8.725669706,8.716535733,8.718009331,8.706986763,8.718500048,8.719480761,8.705993714,8.701512751,8.690474004,8.687779492,8.696844520,8.707813551,8.704999678,8.685584843,8.704336438,8.712430973,8.725669706,8.736971085,8.753845093,8.775085935,8.790421307,8.774467601,8.792853289,8.799812470,8.809862805) > ylab = 'y' > xlab = 'x' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > postscript(file="/var/www/rcomp/tmp/1g4wv1257124223.ps",horizontal=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/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/www/rcomp/tmp/2n6h21257124223.tab") > > system("convert tmp/1g4wv1257124223.ps tmp/1g4wv1257124223.png") > > > proc.time() user system elapsed 0.330 0.260 0.626