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(5.2100,5.2300,5.2300,5.2300,5.2200,5.2100,5.2300,5.2500,5.2300,5.2300,5.2500,5.2400,5.2600,5.2700,5.2600,5.2900,5.2900,5.2900,5.2900,5.3100,5.3300,5.3400,5.3400,5.3700,5.4100,5.4100,5.3800,5.4400,5.4400,5.4600,5.4600,5.4500,5.4600,5.4600,5.4800,5.4700,5.4800,5.5100,5.5500,5.5800,5.5900,5.6000,5.6000,5.6700,5.7100,5.7000,5.7300,5.7200,5.7500,5.7500,5.7700,5.8300,5.8500,5.8700,5.8600,5.8700,5.9300,5.9700,5.9800,5.9900,5.9900,6.0300,6.0600,6.0700,6.0800,6.0800,6.1000,6.1300,6.1400,6.1400,6.1600,6.2000,6.1900,6.3200,6.3200,6.3300,6.3200,6.3300,6.3800,6.4200,6.4600,6.4700,6.4200,6.4800,6.4700,6.4900,6.4800,6.5100,6.5100,6.5200,6.5700,6.5900,6.6200,6.6300,6.6100,6.6400,6.6900,6.6900,6.7500,6.7700,6.8100,6.8100,6.8100,6.8700,6.8600,6.8800,6.8800,6.9200,6.9200,6.9900,7.0200,7.0500,7.0600,7.0600,7.0900,7.1200,7.2300,7.3100,7.4500,7.4900,7.5400,7.5500,7.5800,7.6000,7.6300,7.6400,7.6300,7.6600,7.6400,7.6900,7.7000,7.6800) > #'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: Write here your technical program description (don't use hard returns!) > library(Hmisc) Loading required package: survival Loading required package: splines Attaching package: 'Hmisc' The following object(s) are masked from package:survival : untangle.specials The following object(s) are masked from package:base : format.pval, round.POSIXt, trunc.POSIXt, units > m <- mean(x) > e <- median(x) > postscript(file="/var/www/html/rcomp/tmp/1b5y61256500317.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > op <- par(mfrow=c(2,1)) > mydensity1 <- density(x,kernel='gaussian',na.rm=TRUE) > plot(mydensity1,main='Density Plot - Gaussian Kernel',xlab='Median (0 -> full line) | Mean (0 -> dashed line)',ylab='density') > abline(v=e,lty=1) > abline(v=m,lty=5) > grid() > myseq <- seq(0.01, 0.99, 0.01) > hd <- hdquantile(x, probs = myseq, se = TRUE, na.rm = FALSE, names = TRUE, weights=FALSE) > plot(myseq,hd,col=2,main='Harrell-Davis Quantiles',xlab='quantiles',ylab='Median (0 -> full) | Mean (0 -> dashed)') > abline(h=m,lty=5) > abline(h=e,lty=1) > grid() > par(op) > 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,'Median versus Mean',2,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'mean',header=TRUE) > a<-table.element(a,mean(x)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'median',header=TRUE) > a<-table.element(a,median(x)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/2xv1z1256500317.tab") > > system("convert tmp/1b5y61256500317.ps tmp/1b5y61256500317.png") > > > proc.time() user system elapsed 0.721 0.230 1.177