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(100,100,93.5483871,88.17204301,89.24731183,91.39784946,92.47311828,91.39784946,88.17204301,87.09677419,84.94623656,92.47311828,93.5483871,93.5483871,91.39784946,90.32258065,91.39784946,93.5483871,93.5483871,92.47311828,91.39784946,89.24731183,86.02150538,88.17204301,87.09677419,87.09677419,86.02150538,84.94623656,84.94623656,86.02150538,86.02150538,84.94623656,86.02150538,82.79569892,77.41935484,80.64516129,78.49462366,75.2688172,75.2688172,75.2688172,77.41935484,78.49462366,76.34408602,73.11827957,68.8172043,65.59139785,69.89247312,82.79569892,84.94623656,80.64516129,74.19354839,70.96774194,74.19354839,82.79569892,86.02150538,86.02150538,82.79569892,78.49462366,79.56989247,87.09677419) > x <- c(100,114.242116,115.8697864,108.0366226,100.3051882,98.1688708,97.5584944,105.4933876,104.8830112,105.4933876,114.0386572,88.40284842,96.64292981,113.733469,110.681587,111.190234,103.1536114,102.2380468,102.4415056,115.4628688,107.9348932,113.5300102,116.8870804,90.13224822,101.2207528,117.0905392,120.0406918,113.3265514,109.155646,107.121058,107.121058,119.9389624,112.1057986,114.3438454,119.5320448,94.60834181,105.2899288,118.311292,122.0752798,116.276704,106.5106816,111.698881,114.5473042,116.3784334,117.7009156,116.6836216,120.4476094,96.54120041,105.595117,117.0905392,115.6663276,105.7985758,95.93082401,94.09969481,94.81180061,106.5106816,95.62563581,99.7965412,104.4760936,83.82502543) > 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/1vh7s1257538093.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 113.4508 -0.2688 > 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/25io71257538093.tab") > > system("convert tmp/1vh7s1257538093.ps tmp/1vh7s1257538093.png") > > > proc.time() user system elapsed 0.564 0.260 0.906