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(792108,472123,272128,992139,642162,352145,492169,92174,462193,92207,792222,72225,782230,52241,332266,902266,402287,812304,532313,802330,342322,222320,42314,252298,892323,392342,772330,982344,592342,662360,882362,942373,222371,632404,782475,372472,822461,142441,142435,742425,672393,302390,862379,772372,302370,452359,112353,442320,512322,192322,292303,962280,322321,362301,62288,812271,32259,72407,332399,712416,162432,652423,272420,642433,512435,722436,292453,812469,102444,122438,42476,702562) > 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/1rtph1267029497.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 (72 obs.); Bandwidth 'bw' = 1.12e+05 x y Min. :-303771 Min. :1.458e-09 1st Qu.: 104214 1st Qu.:1.448e-07 Median : 512199 Median :8.176e-07 Mean : 512199 Mean :6.121e-07 3rd Qu.: 920184 3rd Qu.:9.894e-07 Max. :1328169 Max. :1.092e-06 > postscript(file="/var/www/html/rcomp/tmp/23vge1267029497.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/3u0uk1267029497.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/4jiof1267029497.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/5i9x81267029497.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/6vpot1267029497.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/7r6jt1267029497.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/8cnst1267029497.tab") > > try(system("convert tmp/1rtph1267029497.ps tmp/1rtph1267029497.png",intern=TRUE)) character(0) > try(system("convert tmp/23vge1267029497.ps tmp/23vge1267029497.png",intern=TRUE)) character(0) > try(system("convert tmp/3u0uk1267029497.ps tmp/3u0uk1267029497.png",intern=TRUE)) character(0) > try(system("convert tmp/4jiof1267029497.ps tmp/4jiof1267029497.png",intern=TRUE)) character(0) > try(system("convert tmp/5i9x81267029497.ps tmp/5i9x81267029497.png",intern=TRUE)) character(0) > try(system("convert tmp/6vpot1267029497.ps tmp/6vpot1267029497.png",intern=TRUE)) character(0) > try(system("convert tmp/7r6jt1267029497.ps tmp/7r6jt1267029497.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.388 1.172 1.826