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(122.860,117.702,113.537,108.366,111.078,150.739,159.129,157.928,147.768,137.507,136.919,136.151,133.001,125.554,119.647,114.158,116.193,152.803,161.761,160.942,149.470,139.208,134.588,130.322,126.611,122.401,117.352,112.135,112.879,148.729,157.230,157.221,146.681,136.524,132.111,125.326,122.716,116.615,113.719,110.737,112.093,143.565,149.946,149.147,134.339,122.683,115.614,116.566,111.272,104.609,101.802,94.542,93.051,124.129,130.374,123.946,114.971,105.531,104.919,104.782,101.281,94.545,93.248,84.031,87.486,115.867,120.327,117.008,108.811,104.519,106.758,109.337) > par1 = '0' > ylab = 'aantal' > xlab = 'periode' > #'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/1c2ni1237577341.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' = 7.318 x y Min. : 62.08 Min. :1.062e-05 1st Qu.: 92.49 1st Qu.:1.465e-03 Median :122.90 Median :8.018e-03 Mean :122.90 Mean :8.212e-03 3rd Qu.:153.31 3rd Qu.:1.278e-02 Max. :183.72 Max. :2.152e-02 > postscript(file="/var/www/html/rcomp/tmp/2qb5s1237577341.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/3tr8o1237577341.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/4wd5t1237577341.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/5l6331237577341.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/6xwfm1237577341.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/7t2vc1237577341.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/8v1n11237577341.tab") > > system("convert tmp/1c2ni1237577341.ps tmp/1c2ni1237577341.png") > system("convert tmp/2qb5s1237577341.ps tmp/2qb5s1237577341.png") > system("convert tmp/3tr8o1237577341.ps tmp/3tr8o1237577341.png") > system("convert tmp/4wd5t1237577341.ps tmp/4wd5t1237577341.png") > system("convert tmp/5l6331237577341.ps tmp/5l6331237577341.png") > system("convert tmp/6xwfm1237577341.ps tmp/6xwfm1237577341.png") > system("convert tmp/7t2vc1237577341.ps tmp/7t2vc1237577341.png") > > > proc.time() user system elapsed 1.293 1.077 1.647