R version 2.8.0 (2008-10-20) 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(78.40,114.60,113.30,117.00,99.60,99.40,101.90,115.20,108.50,113.80,121.00,92.20,90.20,101.50,126.60,93.90,89.80,93.40,101.50,110.40,105.90,108.40,113.90,86.10,69.40,101.20,100.50,98.00,106.60,90.10,96.90,125.90,112.00,100.00,123.90,79.80,83.40,113.60,112.90,104.00,109.90,99.00,106.30,128.90,111.10,102.90,130.00,87.00,87.50,117.60,103.40,110.80,112.60,102.50,112.40,135.60,105.10,127.70,137.00,91.00,90.50,122.40,123.30,124.30,120.00,118.10,119.00,142.70,123.60,129.60,151.60,110.40,99.20,130.50,136.20,129.70,128.00,121.60,135.80,143.80,147.50,136.20,156.60,123.30,100.40) > x <- c(90.70,94.30,104.60,111.10,110.80,107.20,99.00,99.00,91.00,96.20,96.90,96.20,100.10,99.00,115.40,106.90,107.10,99.30,99.20,108.30,105.60,99.50,107.40,93.10,88.10,110.70,113.10,99.60,93.60,98.60,99.60,114.30,107.80,101.20,112.50,100.50,93.90,116.20,112.00,106.40,95.70,96.00,95.80,103.00,102.20,98.40,111.40,86.60,91.30,107.90,101.80,104.40,93.40,100.10,98.50,112.90,101.40,107.10,110.80,90.30,95.50,111.40,113.00,107.50,95.90,106.30,105.20,117.20,106.90,108.20,113.00,97.20,99.90,108.10,118.10,109.10,93.30,112.10,111.80,112.50,116.30,110.30,117.10,103.40,96.20) > par7 = 'Y' > par6 = 'Y' > par5 = '0' > par4 = '0' > par3 = '0' > par2 = '50' > par1 = '50' > ylab = 'Investeringsgoederen' > xlab = 'Intermediairegoederen' > 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.22 installed Copyright M. P. Wand 1997 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/1y9821229620090.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 -47.618 1.539 > 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/242661229620090.tab") > > system("convert tmp/1y9821229620090.ps tmp/1y9821229620090.png") > > > proc.time() user system elapsed 0.618 0.257 1.390