R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(8.9722,8.8284,8.7446,8.7519,8.6337,8.7272,8.6330,8.5865,8.5968,8.5114,8.3884,8.2671,8.2410,8.3177,8.4070,8.3917,8.4145,8.5245,8.6289,8.6622,8.9055,8.9770,9.1264,9.1120,9.0576,9.2106,9.2637,9.3107,9.6744,9.5780,9.4166,9.4359,9.2275,9.1828,9.0594,9.1358,9.2208,9.1137,9.2689,9.2489,9.1679,9.1051,9.0818,9.0961,9.1733,9.1455,9.2265,9.1541,9.1559,9.1182,9.1856,9.2378,9.0682,9.0105,8.9939,9.0228,9.1368,9.1763,9.2346,9.1653,9.1277,9.1430,9.1962,9.1861,9.0920,9.0620,8.9981,8.9819,9.0476,9.0852,9.0884,9.1670,9.1931,9.2628,9.4276,9.3398,9.3342,9.4223,9.5614,9.4316,9.3111,9.3414,9.4017,9.3346,9.3310,9.2349,9.2170,9.2098,9.2665,9.2533,9.1008,9.0377,9.0795,9.1896,9.2992,9.2372,9.2061,9.3290,9.1842,9.3231,9.2835,9.1735,9.2889,9.4319,9.4314,9.3642,9.4020,9.3699,9.3106,9.3739,9.4566,9.3984,9.5637,9.8506) > 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/13b3j1243857794.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 (114 obs.); Bandwidth 'bw' = 0.06711 x y Min. : 8.040 Min. :0.0005881 1st Qu.: 8.543 1st Qu.:0.0753237 Median : 9.046 Median :0.2462078 Mean : 9.046 Mean :0.4964561 3rd Qu.: 9.549 3rd Qu.:0.6057109 Max. :10.052 Max. :2.0662058 > postscript(file="/var/www/html/rcomp/tmp/2og871243857794.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/3y7w81243857794.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/4foqd1243857794.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/5lmdd1243857794.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/6ye4l1243857794.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/7rgmw1243857794.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/8imc11243857794.tab") > > system("convert tmp/13b3j1243857794.ps tmp/13b3j1243857794.png") > system("convert tmp/2og871243857794.ps tmp/2og871243857794.png") > system("convert tmp/3y7w81243857794.ps tmp/3y7w81243857794.png") > system("convert tmp/4foqd1243857794.ps tmp/4foqd1243857794.png") > system("convert tmp/5lmdd1243857794.ps tmp/5lmdd1243857794.png") > system("convert tmp/6ye4l1243857794.ps tmp/6ye4l1243857794.png") > system("convert tmp/7rgmw1243857794.ps tmp/7rgmw1243857794.png") > > > proc.time() user system elapsed 1.307 1.078 1.962