R version 2.8.1 (2008-12-22) 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. > x <- c(5.29,5.29,5.29,5.31,5.33,5.34,5.34,5.37,5.41,5.41,5.38,5.44,5.44,5.46,5.46,5.45,5.46,5.46,5.48,5.47,5.48,5.51,5.55,5.58,5.59,5.6,5.6,5.67,5.71,5.7,5.73,5.72,5.75,5.75,5.77,5.83,5.85,5.87,5.86,5.87,5.93,5.97,5.98,5.99,5.99,6.03,6.06,6.07,6.08,6.08,6.1,6.13,6.14,6.14,6.16,6.2,6.19,6.32,6.32,6.33,6.32,6.33,6.38,6.42,6.46,6.47,6.42,6.48,6.47,6.49,6.48,6.51,6.51,6.52,6.57,6.59,6.62,6.63,6.61,6.64) > 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/html/rcomp/tmp/130zz1236238075.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 (80 obs.); Bandwidth 'bw' = 0.1615 x y Min. :4.806 Min. :0.001425 1st Qu.:5.385 1st Qu.:0.118626 Median :5.965 Median :0.609936 Mean :5.965 Mean :0.430749 3rd Qu.:6.545 3rd Qu.:0.631359 Max. :7.124 Max. :0.786227 > postscript(file="/var/www/html/rcomp/tmp/2ckfb1236238075.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/html/rcomp/tmp/33i651236238075.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/html/rcomp/tmp/44efd1236238075.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/html/rcomp/tmp/57jff1236238075.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/html/rcomp/tmp/63ya71236238075.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/html/rcomp/tmp/7yedn1236238075.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/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,'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/html/rcomp/tmp/87x041236238075.tab") > > system("convert tmp/130zz1236238075.ps tmp/130zz1236238075.png") > system("convert tmp/2ckfb1236238075.ps tmp/2ckfb1236238075.png") > system("convert tmp/33i651236238075.ps tmp/33i651236238075.png") > system("convert tmp/44efd1236238075.ps tmp/44efd1236238075.png") > system("convert tmp/57jff1236238075.ps tmp/57jff1236238075.png") > system("convert tmp/63ya71236238075.ps tmp/63ya71236238075.png") > system("convert tmp/7yedn1236238075.ps tmp/7yedn1236238075.png") > > > proc.time() user system elapsed 1.307 1.067 1.758