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(3.861884491,3.86432807,3.864492015,3.863257308,3.860453306,3.849318732,3.844063366,3.844181192,3.845531265,3.835138386,3.840896665,3.843161358,3.848062114,3.850490024,3.851442229,3.853087325,3.851779838,3.840943954,3.834650174,3.835185604,3.840041333,3.85185285,3.855980758,3.85724753,3.854755941,3.861171308,3.865913967,3.869739954,3.86908917,3.85765146,3.84534727,3.838506216,3.853366873,3.8585208,3.864809349,3.865086762,3.871043125,3.873953266,3.871181262,3.874806751,3.874289451,3.854408916,3.840662338,3.833562198,3.850478329,3.861866435,3.865858029,3.872258448,3.872886015,3.876970667,3.873825677,3.878687726,3.872366111,3.860679016,3.848518938,3.84031302,3.86456395,3.879947833,3.893237105,3.903049256,3.912810243,3.919609086,3.930075738,3.933031449,3.933305731,3.926413182,3.910060531,3.903890717,3.922433331) > x <- c(3.109060959,3.310543013,3.310543013,3.414442608,3.56671182,3.234749174,3.310543013,3.27336401,3.478158423,3.346389145,3.346389145,3.414442608,3.5085559,3.310543013,3.152736022,3.015534901,3.109060959,3.194583132,3.194583132,3.27336401,3.380994674,3.346389145,3.109060959,2.912350665,3.234749174,3.310543013,3.152736022,2.734367509,2.965273066,3.27336401,3.414442608,3.310543013,3.310543013,3.063390922,3.310543013,3.414442608,3.538056564,3.5085559,3.594568775,3.56671182,3.621670704,3.5085559,3.56671182,3.478158423,3.346389145,3.346389145,3.446807893,3.5085559,3.5085559,3.346389145,3.478158423,3.414442608,3.346389145,3.27336401,3.310543013,3.194583132,2.965273066,3.152736022,2.912350665,2.912350665,2.517696473,2.341805806,2.00148,1,2.174751721,2.186051277,2.564949357,2.884800713,2.587764035) > par7 = 'Y' > par6 = 'Y' > par5 = '0' > par4 = '0' > par3 = '0' > par2 = '50' > par1 = '50' > ylab = 'Werkloosheid mannen (%)' > xlab = 'Vooruitzichten werkgelegenheid (%)' > 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/12xx41256767978.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 4.00426 -0.04354 > 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/2o0ub1256767978.tab") > > system("convert tmp/12xx41256767978.ps tmp/12xx41256767978.png") > > > proc.time() user system elapsed 0.570 0.257 0.729