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(1.086873163,0.918367347,0.905546834,0.882839397,0.988825045,1.108747531,1.012523191,0.927841294,0.988926353,1.023809524,0.983446712,0.958638648,0.855721844,0.839932158,0.925036882,0.887076885,0.866378197,0.807465091,0.834866341,0.84416485,0.862305879,1.25170068,0.897295918,0.896462585,0.745609872,0.779679187,0.772067863,0.755821559,0.884005272,0.921075539,0.854550017,0.736900165,0.738350832,0.760546907,0.730656133,0.802425318,0.97675244,1.112677274,1.203421784,1.185972981,1.167635769,1.537528615,1.403892835,1.384984922,1.546262221,2.291625187,1.544590439,1.364795918,1.226145372,0.978131844,0.802147462,0.771691423,1.098628726,0.717737095,0.689795918,0.383167676,0.206290764,0,0.297677692) > 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/1p36m1255863840.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 (59 obs.); Bandwidth 'bw' = 0.08969 x y Min. :-0.2691 Min. :4.445e-05 1st Qu.: 0.4384 1st Qu.:2.616e-02 Median : 1.1458 Median :9.495e-02 Mean : 1.1458 Mean :3.530e-01 3rd Qu.: 1.8533 3rd Qu.:3.666e-01 Max. : 2.5607 Max. :1.971e+00 > postscript(file="/var/www/html/rcomp/tmp/2s3oy1255863840.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/38t7l1255863840.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/4374o1255863840.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/5r1qc1255863840.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/61ava1255863840.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/7mg731255863840.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/8v3ef1255863840.tab") > > system("convert tmp/1p36m1255863840.ps tmp/1p36m1255863840.png") > system("convert tmp/2s3oy1255863840.ps tmp/2s3oy1255863840.png") > system("convert tmp/38t7l1255863840.ps tmp/38t7l1255863840.png") > system("convert tmp/4374o1255863840.ps tmp/4374o1255863840.png") > system("convert tmp/5r1qc1255863840.ps tmp/5r1qc1255863840.png") > system("convert tmp/61ava1255863840.ps tmp/61ava1255863840.png") > system("convert tmp/7mg731255863840.ps tmp/7mg731255863840.png") > > > proc.time() user system elapsed 1.312 1.088 1.816