R version 2.6.1 (2007-11-26) Copyright (C) 2007 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(30,30,34,28,29,30,32,32,33,34,33,33,33,33,34,34,34,34,33,33,34,32,32,33,36,38,33,35,36,33,33,34,33,23,25,27,28,39,36,35,34,33,40,33,34,35,32,31,34,34,35,33,36,36,35,35,35,35,35,34,27,28,29,30,31,32,30,30,31,31,31,31,31,32,32,32,32,32,33,33,34,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,44,44,44,44,44,43,43,43,43,43,42,42,41,40,46,46,46,46,46,46,46,46,46,47,47,47,55,54,53,53,52,52,52,52,51,51,50,50,49,49,49,49,49,49,48,43,43,44,46,47,47,47,47,47,47,47,48,48,48,48,48,48,50,50,50,51) > ylab = 'Density' > xlab = 'Value (lengte van marsbewoners)' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: Wessa, P. (2007), Kernel Density Estimation (v1.0.4) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_density.wasp/ > #Source of accompanying publication: http://www.xycoon.com/density_trace.htm > #Technical description: -- > postscript(file="/var/www/html/rcomp/tmp/1q2311200758724.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > > mydensity1<-density(x,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, kernel = "gaussian", na.rm = TRUE) Data: x (162 obs.); Bandwidth 'bw' = 2.506 x y Min. :15.48 Min. :1.187e-05 1st Qu.:27.24 1st Qu.:2.002e-03 Median :39.00 Median :1.787e-02 Mean :39.00 Mean :2.124e-02 3rd Qu.:50.76 3rd Qu.:3.836e-02 Max. :62.52 Max. :5.741e-02 > postscript(file="/var/www/html/rcomp/tmp/24xgv1200758724.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > > mydensity2<-density(x,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/3l0ci1200758724.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > > mydensity3<-density(x,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/4ihuh1200758724.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > > mydensity4<-density(x,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/5nv981200758724.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > > mydensity5<-density(x,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/661it1200758724.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > > mydensity6<-density(x,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/7btvk1200758724.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > > mydensity7<-density(x,kernel='optcosine',na.rm=TRUE) > plot(mydensity7,main='Optcosine Kernel',xlab=xlab,ylab=ylab) > grid() > dev.off() null device 1 > 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/8c4xn1200758724.tab") > > system("convert tmp/1q2311200758724.ps tmp/1q2311200758724.png") > system("convert tmp/24xgv1200758724.ps tmp/24xgv1200758724.png") > system("convert tmp/3l0ci1200758724.ps tmp/3l0ci1200758724.png") > system("convert tmp/4ihuh1200758724.ps tmp/4ihuh1200758724.png") > system("convert tmp/5nv981200758724.ps tmp/5nv981200758724.png") > system("convert tmp/661it1200758724.ps tmp/661it1200758724.png") > system("convert tmp/7btvk1200758724.ps tmp/7btvk1200758724.png") > > > proc.time() user system elapsed 1.593 1.163 1.954