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(104.65,109.2,103.93,101.93,101.58,102.63,106.83,105.57,105,104.16,106.93,106.5,106.47,112.33,106.81,103.49,104.13,103.2,105.55,102.8,106.68,105.43,109.01,112.24,112.87,110.98,112.85,112.08,110.72,109.69,112.53,112.99,111.74,111.15,114.82,117.38,117.81,122.85,116.96,119.16,117.74,118.84,123.81,120.33,119.2,117.32,128.58,129.2,126.19,132.1,128.12,122.28,122.36,123.13,125.97,126.14,122.7,122.67,129.19,133.01,123.96,128.96,127.32,131.38,125.25,127.91,130.42,128.44,125.86,125.71,130.63,131.78,125.61,131.84,122.14,127.13,124.49,125.48,129.86,126.32,125.56,125.64,128.26,125.47,134.4,134.5,131.22,121.62,124.16,127.5,132.86,127.87,124.07,124.25,131.16,129.24,129.24,135.51,128.97,126.89,127.52,130.31,132.39,132.69,128.73,129.66,127.72,132.63,129.74,138.46,134.31,128.8,129.95,134.15,136.01,135.1,132.27,132.49,130.06,136.11,131.47,140.61,141.65,126.75,133.9,138.75,141.86,141.13,138.76,138.65,138.59,147.09,140.17,152.38,144.02,139.55,141.1,145.85,147.88,145.17) > #'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/17f7w1256416473.ps",horizontal=F,pagecentre=F,paper="special",width=11.111111111111,height=8.3333333333333) > 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/2pdri1256416473.tab") > > system("convert tmp/17f7w1256416473.ps tmp/17f7w1256416473.png") > > > proc.time() user system elapsed 0.757 0.289 0.880