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(89.3,88.1,93.6,79.7,83.8,62.3,62.3,77.6,80.3,97,94,75.1,74,77.6,75.1,85,75.4,63.2,64.7,77,82.6,97.6,99,75.3,71.6,76.8,83.9,79.7,77.5,73.1,65.6,85.2,98.3,98,100.6,84.1,76.7,82.4,95.5,79.9,82.4,83.6,73.1,91.1,118.6,102.9,111.8,93.9,91.6,92,91.1,97.5,94.7,96.7,78.7,103.5,113.8,106.1,120.3,114.2,106.3,98.8,113.1,97.7,116.3,107.2,94.5,123.5,126.6,126.5,141.4,124.3,124.9,108.9,126.7,107.7,121.8,118.3,122.8,149.5,147,139.3,162.1,142.2,141.4,124.7,114,126.6,121.9,125.1,122.1,135.9,148.4,137.5,145.3,139.9,128.2,115.4,124.7,111.5,121.1,122.5,127.4,143.7,157.8,148.8,162.9,153.9) > 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/1kd4f1286233333.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 (108 obs.); Bandwidth 'bw' = 9.006 x y Min. : 35.28 Min. :9.040e-06 1st Qu.: 73.94 1st Qu.:1.188e-03 Median :112.60 Median :6.236e-03 Mean :112.60 Mean :6.460e-03 3rd Qu.:151.26 3rd Qu.:1.134e-02 Max. :189.92 Max. :1.388e-02 > postscript(file="/var/www/html/rcomp/tmp/2kd4f1286233333.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/3cm4i1286233333.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/4cm4i1286233333.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/55ell1286233333.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/65ell1286233333.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/7g5k61286233333.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/8eh9x1286233333.tab") > > try(system("convert tmp/1kd4f1286233333.ps tmp/1kd4f1286233333.png",intern=TRUE)) character(0) > try(system("convert tmp/2kd4f1286233333.ps tmp/2kd4f1286233333.png",intern=TRUE)) character(0) > try(system("convert tmp/3cm4i1286233333.ps tmp/3cm4i1286233333.png",intern=TRUE)) character(0) > try(system("convert tmp/4cm4i1286233333.ps tmp/4cm4i1286233333.png",intern=TRUE)) character(0) > try(system("convert tmp/55ell1286233333.ps tmp/55ell1286233333.png",intern=TRUE)) character(0) > try(system("convert tmp/65ell1286233333.ps tmp/65ell1286233333.png",intern=TRUE)) character(0) > try(system("convert tmp/7g5k61286233333.ps tmp/7g5k61286233333.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.313 1.095 2.318