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. Natural language support but running in an English locale 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(1280,1024,1120,1024,1280,1280,1280,1024,1280,1280,1280,1280,1280,1688,1440,1600,1280,1280,1280,1176,1280,1503,1440,1366,1280,1024,1280,2560,1280,1024,1280,1280,1440,1280,1440,1024,1440,1143,1280,1440,1280,1366,1024,1408,1366,1176,1920,1257,1280,1280,1440,1680,1440,1024,1140,1280,1280,1280,1280,1280,1440,1280,1152,1280,1280,1440,1280,1280,1440,1280,1280,1440,1280,1280,1600,1024,1366,1280,1280,1440,1366,1280,1024,1280,1440,1280,1280,1408,1280,1600,1600,1680,1440,1440,917,1280,1760,1280,1280,1280,1024,1366,1440,1280,1280,1920,1024,1024,1600,1117,1440,983,1024,1024,1280,1440,1280,1280,1280,1440,1280,1024,1024,1152,1280,1024,1366,1680,1680,1280,1366,1024,1440,1024,1280,1280,1280,1024,1280) > 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/1q3651286287003.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/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/24v3e1286287003.tab") > > try(system("convert tmp/1q3651286287003.ps tmp/1q3651286287003.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.427 0.339 1.491