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(1.3917,1.2727,1.2757,1.4303,1.4735,1.5611,1.5764,1.5508,1.554,1.5812,1.5167,1.487,1.4721,1.4761,1.4447,1.4179,1.3705,1.3707,1.3505,1.3453,1.3605,1.3318,1.3211,1.2954,1.317,1.32,1.2696,1.266,1.2851,1.2767,1.2713,1.2868,1.2537,1.2104,1.1875,1.2118,1.1797,1.1769,1.2023,1.2042,1.2198,1.2093,1.2092,1.2331,1.2957,1.2964,1.3257,1.3035,1.3621,1.3295,1.2737,1.2409,1.2111,1.2039,1.2155,1.2198,1.1947,1.2224,1.2418,1.2384,1.263,1.1994,1.1622,1.1652,1.0927,1.1318,1.1427,1.1822,1.1131,1.0895,1.0782,1.0816,1.0487) > 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/1lxej1235045532.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 (73 obs.); Bandwidth 'bw' = 0.04166 x y Min. :0.9237 Min. :0.001808 1st Qu.:1.1193 1st Qu.:0.337344 Median :1.3150 Median :0.935755 Mean :1.3150 Mean :1.276702 3rd Qu.:1.5106 3rd Qu.:2.038129 Max. :1.7062 Max. :3.568291 > postscript(file="/var/www/html/rcomp/tmp/2fsdo1235045532.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/3vwfj1235045532.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/4qcvf1235045532.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/5srt81235045532.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/6v7hk1235045532.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/7uzkx1235045532.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/8wpoh1235045532.tab") > > system("convert tmp/1lxej1235045532.ps tmp/1lxej1235045532.png") > system("convert tmp/2fsdo1235045532.ps tmp/2fsdo1235045532.png") > system("convert tmp/3vwfj1235045532.ps tmp/3vwfj1235045532.png") > system("convert tmp/4qcvf1235045532.ps tmp/4qcvf1235045532.png") > system("convert tmp/5srt81235045532.ps tmp/5srt81235045532.png") > system("convert tmp/6v7hk1235045532.ps tmp/6v7hk1235045532.png") > system("convert tmp/7uzkx1235045532.ps tmp/7uzkx1235045532.png") > > > proc.time() user system elapsed 1.319 1.081 1.858