R version 2.11.1 (2010-05-31) Copyright (C) 2010 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. > x <- c(61.712,62.084,61.406,60.724,58.904,58.722,59.704,60.674,59.813,60.568,61.401,61.427,61.080,61.999,63.888,66.284,67.309,66.685,65.404,65.045,63.867,64.156,62.224,63.193,64.256,66.153,68.072,68.245,68.741,67.795,67.315,67.245,66.448,69.112,71.787,74.366,76.337,77.618,77.090,76.925,78.384,80.462,82.765,85.033,83.608,81.813,81.467,80.708,80.631,79.133,77.396,75.491,74.267,72.882,71.286,70.737,67.425,67.530,67.157,67.215,66.268,66.053,54.905,54.459,51.159,44.725,40.184,44.094,46.904,47.141,45.052,42.758,41.388,41.154,40.019,39.928,38.598,36.584,32.566,30.140,27.713,25.380,23.823,21.376,18.696,16.304,14.203,11.807,7.551,4.215,3.346,3.010,2.849,2.485,1.744,1.221,803,553,314,204,125,55,53,27,10,6) > par1 = '0' > ylab = 'Density' > xlab = 'Value' > #'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/www/rcomp/tmp/1v5cm1290703264.ps",horizontal=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 (106 obs.); Bandwidth 'bw' = 7.696 x y Min. :-21.87 Min. :0.000e+00 1st Qu.:190.12 1st Qu.:1.608e-19 Median :402.11 Median :1.178e-07 Mean :402.11 Mean :1.178e-03 3rd Qu.:614.10 3rd Qu.:2.375e-04 Max. :826.09 Max. :2.232e-02 > postscript(file="/var/www/rcomp/tmp/2v5cm1290703264.ps",horizontal=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/www/rcomp/tmp/36ebp1290703264.ps",horizontal=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/www/rcomp/tmp/46ebp1290703264.ps",horizontal=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/www/rcomp/tmp/5y6ss1290703264.ps",horizontal=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/www/rcomp/tmp/6y6ss1290703264.ps",horizontal=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/www/rcomp/tmp/7y6ss1290703264.ps",horizontal=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/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/www/rcomp/tmp/8korg1290703264.tab") > > try(system("convert tmp/1v5cm1290703264.ps tmp/1v5cm1290703264.png",intern=TRUE)) character(0) > try(system("convert tmp/2v5cm1290703264.ps tmp/2v5cm1290703264.png",intern=TRUE)) character(0) > try(system("convert tmp/36ebp1290703264.ps tmp/36ebp1290703264.png",intern=TRUE)) character(0) > try(system("convert tmp/46ebp1290703264.ps tmp/46ebp1290703264.png",intern=TRUE)) character(0) > try(system("convert tmp/5y6ss1290703264.ps tmp/5y6ss1290703264.png",intern=TRUE)) character(0) > try(system("convert tmp/6y6ss1290703264.ps tmp/6y6ss1290703264.png",intern=TRUE)) character(0) > try(system("convert tmp/7y6ss1290703264.ps tmp/7y6ss1290703264.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.12 1.31 3.42