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(99.026,101.851,99.958,97.875,97.927,95.149,94.551,93.999,93.297,89.901,89.742,87.096,86.863,86.718,80.020,63.483,51.289,44.071,43.654,66.115,84.518,83.395,78.307,80.049,78.346,78.317,75.918,73.739,74.530,74.179,76.974,75.408,73.336,69.210,67.286,64.606,64.159,64.423,66.411,64.270,56.521,50.599,54.751,62.227,63.932,65.391,75.744,74.590,76.035,74.427,73.354,73.081,75.309,75.463,75.910,76.151,76.882,78.632,80.137,82.490,79.896,81.303,79.344,81.355,82.328,79.669,77.249,75.101,72.520,72.438,72.653,71.429,69.189,66.451,63.354,61.379,61.880,62.274,62.429,63.905,63.917,64.295,61.930,60.440,59.353,58.695,60.569,60.386,60.938,61.795,63.304,64.270,63.492,61.333,59.341,58.412,58.725,59.277,58.562,57.858,58.790,58.243,57.044,57.339,59.429,60.575,61.950,61.712) > x <- c(94.204,97.217,95.118,93.688,93.140,91.516,90.957,90.372,89.749,85.813,86.026,83.933,83.602,83.384,76.369,60.808,48.071,42.604,41.402,62.121,79.739,79.006,74.472,75.956,75.041,74.873,72.922,70.472,71.423,71.363,73.297,72.081,70.488,65.544,64.450,61.698,61.352,61.072,63.722,61.987,53.802,47.818,50.998,58.438,60.143,61.854,70.987,70.389,72.175,70.243,69.616,69.443,70.833,71.059,72.218,72.647,73.299,73.756,75.557,78.172,75.624,76.959,74.994,76.841,78.043,75.187,73.387,70.798,68.722,68.396,68.466,67.675,65.248,62.974,59.801,57.894,58.592,59.249,59.554,59.753,60.877,60.532,58.452,56.955,56.437,55.588,56.702,57.062,57.826,58.755,60.250,61.142,60.690,58.495,56.020,55.814,56.489,56.587,55.714,55.611,56.093,55.929,54.181,54.810,56.189,57.427,59.432,58.951) > par7 = 'Y' > par6 = 'Y' > par5 = '0' > par4 = '0' > par3 = '0' > par2 = '50' > par1 = '50' > ylab = 'Geboortes jongens (1900-2007)' > xlab = 'Geboortes meisjes (1900-2007)' > 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/1h55l1260466317.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 0.9349 1.0379 > 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/2qka81260466317.tab") > > system("convert tmp/1h55l1260466317.ps tmp/1h55l1260466317.png") > > > proc.time() user system elapsed 0.595 0.244 0.697