R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(13.23983525,13.2372159,13.22732141,13.20596712,13.19312375,13.2043525,13.29384304,13.32246427,13.32548869,13.32338238,13.2949157,13.29707942,13.28934284,13.28682472,13.27838887,13.2588155,13.24891849,13.25168492,13.33865954,13.3517021,13.3506648,13.32467872,13.29699545,13.29990855,13.29363747,13.28799984,13.27043677,13.26074175,13.25824825,13.25853977,13.33677613,13.34680049,13.33733926,13.28384427,13.24589342,13.23081232,13.23672011,13.21558775,13.18378392,13.17290249,13.14419923,13.11968379,13.22737543,13.24385685,13.20238824,13.17508865,13.141864,13.15048036,13.15564727,13.13737218,13.10749742,13.10265647,13.05911895,13.07648696,13.17756911,13.18738303,13.15762434,13.13463576,13.12608843,13.15413526,13.17727193,13.1855973,13.19249001,13.19288708,13.16847758,13.19228861,13.28204729,13.29899209,13.2716847) > x <- c(12.28411643,12.27179952,12.25231194,12.22609584,12.20725694,12.22423668,12.39452537,12.46961698,12.40214917,12.40680698,12.3612585,12.37673061,12.3683743,12.34737254,12.33351554,12.30898116,12.2883068,12.29888881,12.4546734,12.49066871,12.42369699,12.39302513,12.34254658,12.35365178,12.29809105,12.29825521,12.26721478,12.27732762,12.26028617,12.26177695,12.38859418,12.3910407,12.34835315,12.24910819,12.19562829,12.17868089,12.17860381,12.13181235,12.09013416,12.05877841,12.02755584,12.03203468,12.21750702,12.21794193,12.11459312,12.06379454,12.0224142,12.05115417,12.04179334,12.00873085,11.99482061,11.98050115,11.92504174,11.97107157,12.13634736,12.13923281,12.06870533,12.03979371,12.02471263,12.08974667,12.13571456,12.15069735,12.16297202,12.14900482,12.13352883,12.1823382,12.31730986,12.33226026,12.27431991) > par7 = 'Y' > par6 = 'Y' > par5 = '0' > par4 = '0' > par3 = '0' > par2 = '50' > par1 = '50' > ylab = 'y' > xlab = 'x' > main = 'Bivariate Kernel Density' > #'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!) > par1 <- as(par1,'numeric') > par2 <- as(par2,'numeric') > par3 <- as(par3,'numeric') > par4 <- as(par4,'numeric') > par5 <- as(par5,'numeric') > library('GenKern') Loading required package: KernSmooth KernSmooth 2.23 loaded Copyright M. P. Wand 1997-2009 Loading GenKern version 1.1 Copyright Lucy and Aykroyd 2000 last update October 2004 requires KernSmooth Package GenKern installed > if (par3==0) par3 <- dpik(x) > if (par4==0) par4 <- dpik(y) > if (par5==0) par5 <- cor(x,y) > if (par1 > 500) par1 <- 500 > if (par2 > 500) par2 <- 500 > postscript(file="/var/www/html/rcomp/tmp/16n7m1256911919.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > op <- KernSur(x,y, xgridsize=par1, ygridsize=par2, correlation=par5, xbandwidth=par3, ybandwidth=par4) > image(op$xords, op$yords, op$zden, col=terrain.colors(100), axes=TRUE,main=main,xlab=xlab,ylab=ylab) > if (par6=='Y') contour(op$xords, op$yords, op$zden, add=TRUE) > if (par7=='Y') points(x,y) > (r<-lm(y ~ x)) Call: lm(formula = y ~ x) Coefficients: (Intercept) x 7.1114 0.5008 > abline(r) > box() > dev.off() null device 1 > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Bandwidth',2,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'x axis',header=TRUE) > a<-table.element(a,par3) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'y axis',header=TRUE) > a<-table.element(a,par4) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Correlation',2,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'correlation used in KDE',header=TRUE) > a<-table.element(a,par5) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'correlation(x,y)',header=TRUE) > a<-table.element(a,cor(x,y)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/2tq7u1256911919.tab") > > system("convert tmp/16n7m1256911919.ps tmp/16n7m1256911919.png") > > > proc.time() user system elapsed 0.593 0.252 1.644