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,111.8629088,94.1225572,67.79436315,146.0424236,125.6555043,142.8655602,130.0304429,110.0117843,132.789944,88.23529412,91.96700383,96.65128155,97.14720613,90.7345576,52.52872434,156.9085731,144.8787194,169.4294412,133.3840715,131.2776196,116.32623,89.15349111,85.08298144,89.38917804,103.0884808,85.34812923,45.9933222,152.823333,130.3692429,150.5008347,126.971423,123.2446234,126.5737013,100.2553275,91.76077777,100.2847884,121.6537366,97.28960031,62.54541884,154.9936168,147.8493568,147.3976235,156.8005499,126.8093882,131.7637239,99.20946676,87.34655799,100.7561622,110.5666307,76.46076795,56.51085142,124.9484435,118.2853776,136.4332711,128.6212315,100.7365217,111.7499754,93.43022685,83.3300599) > x <- c(100,96.66958808,91.06047327,89.04469763,82.90972831,84.04907975,91.76161262,90.09640666,85.97721297,99.82471516,70.90271691,83.87379492,99.21121823,92.81332165,95.3549518,89.65819457,86.76599474,88.25591586,101.2269939,88.25591586,96.3190184,100.4382121,74.84662577,88.08063103,100.6134969,102.1034181,98.94829097,89.39526731,92.90096407,92.28746713,104.1191937,92.98860649,95.79316389,102.716915,81.06923751,91.32340053,98.5977213,107.2743208,99.29886065,87.64241893,97.02015776,98.86064855,96.23137599,102.8045574,95.61787905,101.5775635,84.13672217,87.46713409,102.3663453,101.4022787,87.11656442,82.64680105,79.75460123,81.68273444,90.35933392,82.47151621,80.45574058,90.00876424,72.39263804,78.08939527) > par7 = 'Y' > par6 = 'Y' > par5 = '0' > par4 = '0' > par3 = '0' > par2 = '50' > par1 = '50' > ylab = 'NIW' > xlab = 'TIP' > 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/1s9nv1258121045.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 15.60 1.05 > 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/2ti101258121045.tab") > > system("convert tmp/1s9nv1258121045.ps tmp/1s9nv1258121045.png") > > > proc.time() user system elapsed 0.632 0.265 0.708