R version 2.8.1 (2008-12-22) 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(1635.25,1765.9,1833.42,1862.83,1905.41,1910.43,1940.49,1946.81,1959.67,1969.6,1995.37,2014.45,2042,2061.41,2065.81,2091.48,2120.88,2174.56,2196.72,2197.82,2214.95,2304.98,2350.44,2407.6,2408.64,2440.25,2448.05,2452.62,2472.81,2497.84,2555.28,2604.42,2638.53,2641.65,2645.64,2659.81,2720.25,2735.7,2745.88,2756.76,2767.63,2794.83,2799.43,2803.47,2811.7,2833.18,2845.26,2848.96,2849.27,2863.36,2882.6,2892.63,2897.06,2915.02,2921.44,2962.34,2981.85,2987.1,2995.55,3012.61,3013.24,3030.29,3032.6,3032.93,3045.78,3047.03,3061.26,3080.58,3097.31,3106.22,3110.52,3119.31,3142.95,3161.69,3257.16,3277.01,3295.32,3363.99,3494.17,3504.37,3570.12,3667.03,3674.4,3701.61,3720.98,3801.06,3801.06,3813.06,3844.49,3857.62,3862.27,3895.51,3917.96,3970.1,4105.18,4116.68,4138.52,4199.75,4202.52,4290.89,4296.49,4356.98,4435.23,4443.91,4502.64,4562.84,4591.27,4621.4,4696.96) > #'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/1bsse1240483580.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/27ihj1240483580.tab") > > system("convert tmp/1bsse1240483580.ps tmp/1bsse1240483580.png") > > > proc.time() user system elapsed 0.633 0.233 0.730