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(23.98,24.24,24.92,25.46,25.84,26.08,26.18,26.34,26.42,26.38,26.04,25.58,25.65,25.56,25.62,25.62,25.69,25.68,25.68,25.83,25.93,26.11,24.72,24.62,24.65,25.24,25.56,25.9,25.87,25.78,25.78,25.74,25.78,25.73,24.67,24.31,24.56,25,25.38,25.99,26.22,26.19,26.22,26.22,26.61,26.72,25.46,25.48,25.59,25.88,26,26.97,27.2,27.19,27.19,27.19,27.26,26.9,26.11,25.87,26.02,26.31,26.37,26.52,26.86,26.92,26.98,26.98,27.03,26.75,26.39,26.3,26.3,26.52,26.53,26.98,27.22,27.34,27.41,27.47,27.46,27.53,27.21,26.91,26.95,26.91,27.39,27.62,27.79,27.88,27.9,28.09,28.46,28.73,27.93,27.61,27.65,28.19,28.98,28.99,29.02,29,29.04,29.19,29.23,29.26,29.02,28.47,28.53,28.48,28.68,28.89,29.2,29.21,29.15,29.22,29.34,29.13,28.84,28.76) > #'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/rcomp/tmp/1fd7q1257075748.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/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,'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/rcomp/tmp/27erv1257075748.tab") > > system("convert tmp/1fd7q1257075748.ps tmp/1fd7q1257075748.png") > > > proc.time() user system elapsed 0.620 0.510 1.122