R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(0.0266,0.0324,0.0305,0.0298,0.0201,0.0174,0.0118,0.0140,0.0128,0.0134,0.0111,0.0094,0.0121,0.0092,0.0134,0.0135,0.0147,0.0111,0.0160,0.0147,0.0164,0.0167,0.0156,0.0172,0.0160,0.0156,0.0131,0.0110,0.0158,0.0188,0.0161,0.0173,0.0163,0.0143,0.0209,0.0189,0.0172,0.0178,0.0200,0.0252,0.0209,0.0213,0.0232,0.0242,0.0241,0.0225,0.0172,0.0204,0.0233,0.0201,0.0196,0.0133,0.0173,0.0187,0.0168,0.0158,0.0169,0.0178,0.0191,0.0185,0.0186,0.0204,0.0208,0.0194,0.0191,0.0134,0.0130,0.0138,0.0124,0.0130,0.0179,0.0224,0.0264,0.0279,0.0308,0.0388,0.0370,0.0461,0.0507,0.0522,0.0493,0.0515,0.0480,0.0390,0.0354,0.0334,0.0280,0.0160,0.0153,0.0069,-0.0010,-0.0066,-0.0020,-0.0062,-0.0058,-0.0031,-0.0025,-0.0009,0.0013,0.0094,0.0105,0.0158,0.0202,0.0216,0.0206,0.0256,0.0254,0.0253,0.0260,0.0272,0.0281,0.0292,0.0287,0.0289,0.0327,0.0333,0.0314,0.0303,0.0309,0.0339) > 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/wessaorg/rcomp/tmp/17vyh1323885886.ps",horizontal=F,onefile=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 (120 obs.); Bandwidth 'bw' = 0.003132 x y Min. :-0.015997 Min. : 0.0211 1st Qu.: 0.003401 1st Qu.: 3.0058 Median : 0.022800 Median : 5.5864 Mean : 0.022800 Mean :12.8744 3rd Qu.: 0.042199 3rd Qu.:20.7722 Max. : 0.061597 Max. :50.0371 > postscript(file="/var/wessaorg/rcomp/tmp/2c4191323885886.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/3iiw81323885886.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/48s281323885886.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/5spp21323885886.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/6pz9w1323885886.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/7sf1s1323885886.ps",horizontal=F,onefile=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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/8wf231323885886.tab") > > try(system("convert tmp/17vyh1323885886.ps tmp/17vyh1323885886.png",intern=TRUE)) character(0) > try(system("convert tmp/2c4191323885886.ps tmp/2c4191323885886.png",intern=TRUE)) character(0) > try(system("convert tmp/3iiw81323885886.ps tmp/3iiw81323885886.png",intern=TRUE)) character(0) > try(system("convert tmp/48s281323885886.ps tmp/48s281323885886.png",intern=TRUE)) character(0) > try(system("convert tmp/5spp21323885886.ps tmp/5spp21323885886.png",intern=TRUE)) character(0) > try(system("convert tmp/6pz9w1323885886.ps tmp/6pz9w1323885886.png",intern=TRUE)) character(0) > try(system("convert tmp/7sf1s1323885886.ps tmp/7sf1s1323885886.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.710 0.443 2.157