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(219.20,232.50,235.60,171.00,165.90,187.60,218.20,249.80,256.50,224.90,200.00,182.50,230.30,252.80,270.60,196.90,184.70,202.50,258.20,283.10,268.50,283.80,231.10,212.10,238.50,262.80,245.50,198.20,167.20,184.20,254.90,246.40,264.50,242.40,186.70,254.70,230.10,253.60,228.00,183.80,150.00,178.50,228.40,228.70,236.70,218.20,173.50,189.10,194.60,213.70,216.30,173.90,156.90,182.90,216.40,234.00,257.30,225.70,201.70,189.20) > par1 = '0' > ylab = 'Density' > xlab = 'Miljoenen/EUR' > #'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/1zj5i1329243649.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 (60 obs.); Bandwidth 'bw' = 13.33 x y Min. :110.0 Min. :6.797e-06 1st Qu.:163.5 1st Qu.:6.811e-04 Median :216.9 Median :4.618e-03 Mean :216.9 Mean :4.673e-03 3rd Qu.:270.3 3rd Qu.:8.226e-03 Max. :323.8 Max. :1.012e-02 > postscript(file="/var/wessaorg/rcomp/tmp/2t3ue1329243649.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/3ou401329243649.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/4nzb41329243649.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/54meb1329243649.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/6q2ow1329243649.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/770di1329243649.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/8gwkf1329243649.tab") > > try(system("convert tmp/1zj5i1329243649.ps tmp/1zj5i1329243649.png",intern=TRUE)) character(0) > try(system("convert tmp/2t3ue1329243649.ps tmp/2t3ue1329243649.png",intern=TRUE)) character(0) > try(system("convert tmp/3ou401329243649.ps tmp/3ou401329243649.png",intern=TRUE)) character(0) > try(system("convert tmp/4nzb41329243649.ps tmp/4nzb41329243649.png",intern=TRUE)) character(0) > try(system("convert tmp/54meb1329243649.ps tmp/54meb1329243649.png",intern=TRUE)) character(0) > try(system("convert tmp/6q2ow1329243649.ps tmp/6q2ow1329243649.png",intern=TRUE)) character(0) > try(system("convert tmp/770di1329243649.ps tmp/770di1329243649.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.657 0.496 2.159