R version 2.12.0 (2010-10-15) Copyright (C) 2010 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(104.78,104.87,105.06,105.14,105.32,105.54,105.68,105.77,106.07,106.03,106.13,106.28,106.61,106.74,107.01,107.1,107.28,107.4,107.59,107.69,107.78,108.02,108,108.07,108.36,108.74,108.99,109.21,109.31,109.41,109.54,109.81,109.85,110.01,110.23,110.28,110.79,110.91,111.21,111.44,111.52,111.85,112.03,111.9,112.11,112.15,112.09,112.13,112.45,112.5,112.72,112.72,112.83,112.95,112.98,113.07,113.1,113.16,113.2,113.3,113.48,113.67,113.81,113.94,114.13,114.19,114.21,114.21,114.35,114.54,114.51,114.53) > par1 = '0' > ylab = 'dichtheid' > xlab = 'indexcijfer' > #'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/rcomp/tmp/1vix01329218094.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 (72 obs.); Bandwidth 'bw' = 1.176 x y Min. :101.3 Min. :0.0001698 1st Qu.:105.5 1st Qu.:0.0153014 Median :109.7 Median :0.0784324 Mean :109.7 Mean :0.0593965 3rd Qu.:113.9 3rd Qu.:0.0852009 Max. :118.1 Max. :0.1228901 > postscript(file="/var/www/rcomp/tmp/2hpqt1329218094.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/www/rcomp/tmp/3fbnq1329218094.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/www/rcomp/tmp/4masp1329218094.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/www/rcomp/tmp/5g7sr1329218094.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/www/rcomp/tmp/6vezr1329218094.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/www/rcomp/tmp/7efnt1329218094.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/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/87p321329218094.tab") > > try(system("convert tmp/1vix01329218094.ps tmp/1vix01329218094.png",intern=TRUE)) character(0) > try(system("convert tmp/2hpqt1329218094.ps tmp/2hpqt1329218094.png",intern=TRUE)) character(0) > try(system("convert tmp/3fbnq1329218094.ps tmp/3fbnq1329218094.png",intern=TRUE)) character(0) > try(system("convert tmp/4masp1329218094.ps tmp/4masp1329218094.png",intern=TRUE)) character(0) > try(system("convert tmp/5g7sr1329218094.ps tmp/5g7sr1329218094.png",intern=TRUE)) character(0) > try(system("convert tmp/6vezr1329218094.ps tmp/6vezr1329218094.png",intern=TRUE)) character(0) > try(system("convert tmp/7efnt1329218094.ps tmp/7efnt1329218094.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.670 0.200 2.857