R version 2.8.0 (2008-10-20) 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(100.7,100.9,101.8,102.9,103.2,104,105.3,105.9,105.9,106.3,106.4,106.5,106.9,107.7,109.4,109.6,110.7,110.9,110.9,111.9,112.2,112.8,113.2,113.4,113.5,113.5,113.9,114,114.1,114.8,114.9,115.1,115.2,115.3,115.3,115.4,115.4,115.5,115.8,115.8,116.2,116.3,116.8,116.9,117.3,118.2,118.7,118.9,119,119.4,119.5,119.6,119.7,119.8,120.1,120.2,120.2,120.5,120.6,120.9,121.3,121.3,121.5,121.6,121.7,121.8,121.9,122,122.5,122.6,123.1,124.2,124.3,124.3,124.3,124.4,124.8,124.8,125.1,125.2,125.6,125.8,126,126,126.5,126.5,127,128,129.1,129.7,130.7,131.3,131.5,131.9,135.2,137,137,137.1,138.8,141.1,143,143.3,143.3,144.2,146.5,148.6,151.7,157.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/freestat/rcomp/tmp/1s29z1257181285.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=11.111111111111) > 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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/2pgwg1257181285.tab") > > system("convert tmp/1s29z1257181285.ps tmp/1s29z1257181285.png") > > > proc.time() user system elapsed 1.263 0.441 1.828