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(105.46,104.66,103.52,103.71,103.78,103.67,103.66,102.76,102,101.5,101.5,99.22,98.97,98.9,99.78,104.4,106.21,105.46,108.33,111.72,111.88,112.86,113.09,116.9,114.62,118.86,124.71,122.53,127.89,136.16,134.12,130.26,135.35,131.43,129.61,123.96,121.1,125.38,123.1,129.92,136.68,131.17,124.82,122.47,126.15,118.74,116.8,116.64,116.53,117.68,119.46,126.19,124.39,121.9,122.53,122.93,124.66,124.41,120.93,120.18,123.44,126.1,125.82,122.18,117.27,117.86,119.09,123.08,125.42,121.81,121.66,121.27,120.92,122.16,124.17,127.26,134.16,134.09,135.57,136.13,136.23,140.6,136.5,130.59,129.5,135.25,138.06,146.28,145.04,147.96,156.71,160.97,168.17,163.91,153.05,151.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) Attaching package: 'Hmisc' 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/11dhb1250431784.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/22lt21250431784.tab") > > system("convert tmp/11dhb1250431784.ps tmp/11dhb1250431784.png") > > > proc.time() user system elapsed 0.613 0.226 0.852