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(14.620,16.005,16.683,15.487,15.684,15.962,12.000,13.769,14.031,16.078,15.827,13.149,15.969,16.628,16.670,16.487,16.883,16.201,12.168,14.010,16.556,17.404,16.435,13.123,16.744,17.410,16.484,17.103,17.301,17.301,12.843,13.748,16.904,17.342,15.476,15.424,15.988,19.244,18.715,17.780,17.160,17.349,11.171,13.438,16.713,18.369,17.067,14.055,15.500,18.475,19.423,18.686,19.646,19.733,12.605,16.616,19.156,21.348,20.049,18.020,20.262,21.789,20.603,21.928,21.025,19.346,11.786,19.082,20.127,20.217,20.385,16.653,13.065,20.275,21.776,20.260,22.523,23.033,14.133,20.110,19.682,22.197,17.212,11.784,15.467,17.002,15.952,18.767,20.605,19.809,14.233,19.311,20.827,23.388,20.181,14.344) > 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/16o7b1234700751.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 (96 obs.); Bandwidth 'bw' = 1.03 x y Min. : 8.08 Min. :6.305e-05 1st Qu.:12.68 1st Qu.:8.538e-03 Median :17.28 Median :4.966e-02 Mean :17.28 Mean :5.429e-02 3rd Qu.:21.88 3rd Qu.:9.684e-02 Max. :26.48 Max. :1.395e-01 > postscript(file="/var/www/html/rcomp/tmp/2nhzp1234700751.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/3i8kv1234700751.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/4zuej1234700751.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/5u56s1234700751.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/6pc9p1234700751.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/74gkq1234700751.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/8mfmy1234700751.tab") > > system("convert tmp/16o7b1234700751.ps tmp/16o7b1234700751.png") > system("convert tmp/2nhzp1234700751.ps tmp/2nhzp1234700751.png") > system("convert tmp/3i8kv1234700751.ps tmp/3i8kv1234700751.png") > system("convert tmp/4zuej1234700751.ps tmp/4zuej1234700751.png") > system("convert tmp/5u56s1234700751.ps tmp/5u56s1234700751.png") > system("convert tmp/6pc9p1234700751.ps tmp/6pc9p1234700751.png") > system("convert tmp/74gkq1234700751.ps tmp/74gkq1234700751.png") > > > proc.time() user system elapsed 1.311 1.091 1.760