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(-1700.130876,-1990.143684,-1951.137618,-2164.706355,-2003.007565,-2269.612017,-2166.984657,-1727.249475,-2124.114711,-1729.681416,-1404.283836,-1735.492063,-1850.995434,-1703.136941,-2213.23331,-2245.156491,-2024.800693,-2253.103257,-2172.073607,-1699.604597,-2164.26296,-1941.771043,-1575.609985,-2225.32226,-2290.8728,-2118.227245,-2850.922001,-2302.926035,-2283.760266,-3090.088446,-2015.055411,-2018.274414,-1990.108645,-2447.63089,-1899.688158,-2020.002177,-2142.937488,-2428.003531,-2667.306095,-2801.99882,-2982.833728,-2961.804078,-2181.919969,-2437.956362,-2474.636955,-2608.382914,-2364.914581,-2829.141004,-3544.374169,-2641.087092,-3011.461087,-2159.937488,-2855.51971,-2501.09248,-2347.0507,-2149.564848,-2255.47051,-2406.405821,-1926.498805,-2200.724551,-2281.168622,-2203.967138,-2544.471187,-2268.594497,-2152.765654,-2787.986689,-2354.96175,-2025.025761,-1761.391659,-2536.388302,-1995.58169,-1985.634924) > x <- c(-1813.130876,-2101.143684,-2058.137618,-2267.706355,-2101.007565,-2368.612017,-2303.984657,-1874.249475,-2271.114711,-1868.681416,-1534.283836,-1863.492063,-1977.995434,-1826.136941,-2331.23331,-2358.156491,-2133.800693,-2364.103257,-2322.073607,-1858.604597,-2322.26296,-2088.771043,-1712.609985,-2362.32226,-2426.8728,-2251.227245,-2975.922001,-2422.926035,-2397.760266,-3206.088446,-2168.055411,-2180.274414,-2151.108645,-2596.63089,-2038.688158,-2154.002177,-2272.937488,-2554.003531,-2789.306095,-2918.99882,-3094.833728,-3074.804078,-2330.919969,-2594.956362,-2631.636955,-2755.382914,-2500.914581,-2961.141004,-3669.374169,-2764.087092,-3128.461087,-2273.937488,-2966.51971,-2613.09248,-2491.0507,-2299.564848,-2404.47051,-2541.405821,-2049.498805,-2315.724551,-2398.168622,-2314.967138,-2649.471187,-2370.594497,-2247.765654,-2880.986689,-2478.96175,-2156.025761,-1885.391659,-2651.388302,-2101.58169,-2090.634924) > 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.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/freestat/rcomp/tmp/14t8o1256913510.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 144.728 1.008 > abline(r) > box() > dev.off() null device 1 > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/2o9u61256913510.tab") > > system("convert tmp/14t8o1256913510.ps tmp/14t8o1256913510.png") > > > proc.time() user system elapsed 0.875 0.368 0.964