R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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. > x <- c(34671,34355,34035,33373,39924,39577,34671,31409,31724,31724,32075,32706,34671,34035,35017,36631,45813,45813,43853,41888,43502,45466,45813,46795,49742,47777,47777,50724,58893,59555,57911,53982,56928,56928,57244,58893,60191,60853,60853,62817,70355,72315,72630,67724,70355,69373,67408,71653,72630,70986,71333,73613,82133,86372,86372,84412,87355,84412,82764,89004,89981,87670,93559,95870,102741,107301,106670,106319,108950,108630,104706,110594,112559,110594,118763,122692,131839,135448,134470,132505,134150,136114,129559,134785,138079,136750,145265,148207,160652,162932,159990,161634,162616,163598,157358,163247,166509,163247,172749,175692,188451,190416,191047,194340,194340,195638,189749,192696,194656,191047,201527,203491,216567,218878,222140,225087,225402,225749,219860,225749) > par1 = '0' > ylab = 'Density' > xlab = 'Omzet product X' > #'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: > if (par1 == '0') bw <- 'nrd0' > if (par1 != '0') bw <- as.numeric(par1) > postscript(file="/var/wessaorg/rcomp/tmp/1r79o1312898328.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > mydensity1<-density(x,bw=bw,kernel='gaussian',na.rm=TRUE) > plot(mydensity1,main='Gaussian Kernel',xlab=xlab,ylab=ylab) > grid() > dev.off() null device 1 > mydensity1 Call: density.default(x = x, bw = bw, kernel = "gaussian", na.rm = TRUE) Data: x (120 obs.); Bandwidth 'bw' = 2.066e+04 x y Min. :-30565 Min. :9.957e-09 1st Qu.: 49007 1st Qu.:1.016e-06 Median :128579 Median :3.350e-06 Mean :128579 Mean :3.138e-06 3rd Qu.:208151 3rd Qu.:4.450e-06 Max. :287723 Max. :7.300e-06 > postscript(file="/var/wessaorg/rcomp/tmp/2lcrl1312898328.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > mydensity2<-density(x,bw=bw,kernel='epanechnikov',na.rm=TRUE) > plot(mydensity2,main='Epanechnikov Kernel',xlab=xlab,ylab=ylab) > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/3onp91312898328.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > mydensity3<-density(x,bw=bw,kernel='rectangular',na.rm=TRUE) > plot(mydensity3,main='Rectangular Kernel',xlab=xlab,ylab=ylab) > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/4gdso1312898328.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > mydensity4<-density(x,bw=bw,kernel='triangular',na.rm=TRUE) > plot(mydensity4,main='Triangular Kernel',xlab=xlab,ylab=ylab) > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/57fw41312898328.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > mydensity5<-density(x,bw=bw,kernel='biweight',na.rm=TRUE) > plot(mydensity5,main='Biweight Kernel',xlab=xlab,ylab=ylab) > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6gs5g1312898328.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > mydensity6<-density(x,bw=bw,kernel='cosine',na.rm=TRUE) > plot(mydensity6,main='Cosine Kernel',xlab=xlab,ylab=ylab) > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7tbvs1312898328.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > mydensity7<-density(x,bw=bw,kernel='optcosine',na.rm=TRUE) > plot(mydensity7,main='Optcosine Kernel',xlab=xlab,ylab=ylab) > grid() > dev.off() null device 1 > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Properties of Density Trace',2,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Bandwidth',header=TRUE) > a<-table.element(a,mydensity1$bw) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'#Observations',header=TRUE) > a<-table.element(a,mydensity1$n) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/8oklg1312898328.tab") > > try(system("convert tmp/1r79o1312898328.ps tmp/1r79o1312898328.png",intern=TRUE)) character(0) > try(system("convert tmp/2lcrl1312898328.ps tmp/2lcrl1312898328.png",intern=TRUE)) character(0) > try(system("convert tmp/3onp91312898328.ps tmp/3onp91312898328.png",intern=TRUE)) character(0) > try(system("convert tmp/4gdso1312898328.ps tmp/4gdso1312898328.png",intern=TRUE)) character(0) > try(system("convert tmp/57fw41312898328.ps tmp/57fw41312898328.png",intern=TRUE)) character(0) > try(system("convert tmp/6gs5g1312898328.ps tmp/6gs5g1312898328.png",intern=TRUE)) character(0) > try(system("convert tmp/7tbvs1312898328.ps tmp/7tbvs1312898328.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.797 0.400 2.219