R version 2.6.2 (2008-02-08) 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(118.4,118.3,118.4,118.6,118.6,116.5,117.7,117.3,117.1,116.9,116.2,113.7,115.2,115.6,115.8,115.2,115.3,113.4,114.6,114.7,114.3,113.7,113.6,111.5,113,113,112.8,113.2,113,111.1,112.4,112,112.4,112.6,112.3,110,111.1,111,111.2,111.3,111.2,109.6,110.7,111,110.8,110.7,110.5,108.7,109.7,109.8,109.8,110,109.8,108.4,109.8,109.5,109,108,107.8,105.9,107.6,107.9,107.7,107.9,107.1,105.5,106.6,106.2,105.9,105.7,105.2,103.1,104.5,104.1,103.9,103.8,103.5,103.7,103.5,103.7,103.5,103.1,103,102.8,102.4,102.5,102.5,102.5,102.6,103,102.8,102.9,102.4,101.8,102,101.8,101.7,101.9,101.8,101.7,101.6,101.8,101.6,101.6,101.1,100.8,101.2,101.3,100.8,100.6,100.6,100.1,99.9,99.9,100,100.2,100,99.5,99.3,99.2,98.7,98.5,98.4,98.6,98.7,98.4,98.1,98.1,98,97.9,97.9,97.8) > #'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/1uvkl1208722291.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/2fzxr1208722291.tab") > > system("convert tmp/1uvkl1208722291.ps tmp/1uvkl1208722291.png") > > > proc.time() user system elapsed 1.062 0.233 1.156