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(99.1,99.7,100.1,100.2,100.1,100.4,99.8,99.7,99.4,100.2,100.5,100.6,100.9,101.9,102.1,102.6,103.5,103.9,103.7,103,103.1,103.2,103.2,103.1,103.7,104.2,104.4,104.9,105.4,105.9,105.5,106.1,105.4,105.7,106.2,106.7,106.8,106.8,106.8,107.3,107.3,107.5,107.4,106.9,108.1,108.6,108.2,108.3,108.3,109.3,109.2,109.4,109.7,109.6,109.3,108.4,108.7,109.4,109,110.3,109.5,109.7,109.5,110.9,110.9,110.4,111.1,110.8,111.3,111.7,112.2,111.7,111.3,111.9,111.7,111.8,111.5,112.9,112,112.4,111.1,111.7,111.4,112.2,112.5,113.2,114.7,115.2,114.1,113.7,115.5,115,115.4,115,114.6,114.6,114.5,115.2,116.3,116.5,118.4,118.5,118.7,119.2,119.5,118.5,118.6,118.2,118.6,120.6,124.5,124.6,126.5,126,126.3,126.3,125.1,126.7,123.9,123.6,124.9,126.2,126.3,126.4,126.2,125.8,124.9,126.2,125.9,124.6,122.9,119.9) > par1 = '0' > ylab = 'dichtheid' > xlab = 'prijs' > #'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/1d0sa1318443973.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 (132 obs.); Bandwidth 'bw' = 2.605 x y Min. : 91.28 Min. :0.000064 1st Qu.:102.09 1st Qu.:0.008482 Median :112.90 Median :0.021406 Mean :112.90 Mean :0.023106 3rd Qu.:123.71 3rd Qu.:0.036084 Max. :134.52 Max. :0.052959 > postscript(file="/var/wessaorg/rcomp/tmp/2qpe11318443973.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/38p2c1318443973.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/4b2qn1318443973.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/5u5zn1318443973.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/6gixs1318443973.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/73o2w1318443973.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/89wcm1318443973.tab") > > try(system("convert tmp/1d0sa1318443973.ps tmp/1d0sa1318443973.png",intern=TRUE)) character(0) > try(system("convert tmp/2qpe11318443973.ps tmp/2qpe11318443973.png",intern=TRUE)) character(0) > try(system("convert tmp/38p2c1318443973.ps tmp/38p2c1318443973.png",intern=TRUE)) character(0) > try(system("convert tmp/4b2qn1318443973.ps tmp/4b2qn1318443973.png",intern=TRUE)) character(0) > try(system("convert tmp/5u5zn1318443973.ps tmp/5u5zn1318443973.png",intern=TRUE)) character(0) > try(system("convert tmp/6gixs1318443973.ps tmp/6gixs1318443973.png",intern=TRUE)) character(0) > try(system("convert tmp/73o2w1318443973.ps tmp/73o2w1318443973.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.688 0.316 2.012