R version 2.7.2 (2008-08-25) 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(460966,449577,431285,426208,411974,409252,456623,488681,470662,454671,434440,430236,436438,429692,418063,413396,406520,401909,453219,478198,481219,470914,440113,439555,443687,442677,438740,430888,424338,425262,484041,491769,489904,484697,474434,476749,481905,479287,471169,469533,460853,466256,525295,534150,533715,520488,501938,507409,513125,510633,503759,490508,483325,487744,535645,543664,545444,541528,523567,523472,516908,514106,508106,496022,489502,489790,538556,545050,544488,527256,508926,508851,503121,498842,487419,481699,478603,478214,522986,528465,521570,489411,467376,458506,460744,448878,431712,425755,411074,399358,451354,459947,437707,422807,405605,409117,410904,401695,386678,383864,364275,372665,421353,426284) > x <- c(31899,31384,30650,30400,30003,29896,31557,31883,30830,30354,29756,29934,30599,30378,29925,29471,29567,29419,30796,31475,31708,31917,30871,31512,32362,31928,31699,30363,30386,30364,32806,33423,33071,33888,34805,35489,37259,37722,38764,39594,40004,40715,44028,45564,44277,44976,45406,47379,49200,50221,51573,53091,53337,54978,57885,67099,67169,69796,70600,71982,73957,75273,76322,77078,77954,79238,82179,83834,83744,84861,86478,88290,90287,91230,92380,92506,94172,94728,96581,97344,98346,98214,98366,98768,99832,99976,99961,100164,99964,99304,104008,104644,103950,104263,104241,105141,106018,105866,105944,106379,105082,104915,107026,107306) > par7 = 'Y' > par6 = 'Y' > par5 = '0' > par4 = '0' > par3 = '0' > par2 = '50' > par1 = '50' > ylab = 'werklozen ouder dan 50' > xlab = 'werklozen jonger dan 50' > 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/1u5911226512795.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.709e+05 -4.284e-02 > 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/22dfu1226512795.tab") > > system("convert tmp/1u5911226512795.ps tmp/1u5911226512795.png") > > > proc.time() user system elapsed 0.827 0.288 0.904