R version 2.8.0 (2008-10-20) 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.094122842,1.137863515,1.187052127,1.154532788,1.086582638,1.160188095,1.125503018,1.12894466,1.156808051,1.121538712,1.13945463,1.193865568,1.103015148,1.114135812,1.160879048,1.082529707,1.012243888,1.096943013,1.087440068,1.080106082,1.111041009,1.129789982,1.180299033,1.127142801,1.076629451,1.122411245,1.142868527,1.096208612,1.099874575,1.158456249,1.128752818,1.118300303,1.144510743,1.149781596,1.167048105,1.145707758,1.120078224,1.141189871,1.117903382,1.099124532,1.016641417,1.127835646,1.11617671,1.10197648,1.106507575,1.133575559,1.103270758,1.133139011,1.095129476,1.134003988,1.123941246,1.072396531,1.07720065,1.152257786,1.13952907,1.109737036,1.125933986,1.139366384,1.114458511,1.144199774) > 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/freestat/rcomp/tmp/19li11255693535.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 (60 obs.); Bandwidth 'bw' = 0.01189 x y Min. :0.9766 Min. : 0.007361 1st Qu.:1.0398 1st Qu.: 0.404031 Median :1.1031 Median : 1.643925 Mean :1.1031 Mean : 3.948838 3rd Qu.:1.1663 3rd Qu.: 7.565634 Max. :1.2295 Max. :12.771960 > postscript(file="/var/www/html/freestat/rcomp/tmp/2wnq71255693535.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/freestat/rcomp/tmp/38zab1255693535.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/freestat/rcomp/tmp/4d6s61255693535.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/freestat/rcomp/tmp/55yy81255693535.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/freestat/rcomp/tmp/60y181255693535.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/freestat/rcomp/tmp/7m2141255693535.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/850341255693535.tab") > > system("convert tmp/19li11255693535.ps tmp/19li11255693535.png") > system("convert tmp/2wnq71255693535.ps tmp/2wnq71255693535.png") > system("convert tmp/38zab1255693535.ps tmp/38zab1255693535.png") > system("convert tmp/4d6s61255693535.ps tmp/4d6s61255693535.png") > system("convert tmp/55yy81255693535.ps tmp/55yy81255693535.png") > system("convert tmp/60y181255693535.ps tmp/60y181255693535.png") > system("convert tmp/7m2141255693535.ps tmp/7m2141255693535.png") > > > proc.time() user system elapsed 2.254 1.909 2.841