R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(0 + ,-1.94834264125015 + ,-1.35938514876797 + ,1.35795496412481 + ,-1.70069468175497 + ,1.44996900849938 + ,1.31903815630069 + ,2.05149160604926 + ,-0.133535063101566 + ,1.03724496156112 + ,0.63142261575917 + ,-1.63792541267238 + ,-0.867991128955308 + ,-1.07958030968515 + ,-0.672654981836742 + ,-1.05064354962543 + ,0.333390996185739 + ,0.487322267446532 + ,-0.570817054401088 + ,-0.499534007121835 + ,0.115264994351102 + ,1.74691902012461 + ,0.739021637104409 + ,0.738226066304609 + ,-0.41299927393743 + ,-1.58336341056381 + ,-0.181363817381967 + ,0.105418963881337 + ,-0.463545967786301 + ,-1.21612196637376 + ,1.64060386180114 + ,-0.0528713661577582 + ,1.52368500476979 + ,1.08334468835021 + ,-0.469412703827005 + ,0.721118803353077 + ,-0.943920679048537 + ,-0.522581909811403 + ,0.359348877235232 + ,-0.247868668824745 + ,0.562507597657474 + ,0.64814873561941 + ,-1.27010850628161 + ,-0.447026313045732 + ,1.78025952002197 + ,0.731000413630024 + ,1.58105415816898 + ,-0.0984553656677268 + ,-0.585819712707743 + ,0.397301065018393 + ,0.0963073674180238 + ,-1.03366376752918 + ,-0.793451126625965 + ,0.871673983985699 + ,0.80325982935323 + ,1.24994658683419 + ,-0.295993912664426 + ,-1.45005328321816 + ,0.767875715674426 + ,0.609240092225543 + ,0.933296632597031 + ,-0.679282808379915 + ,-1.19659266892572 + ,0.418815651594879 + ,-0.181297827175938 + ,0.432789884150497 + ,-0.065942989884464 + ,1.73980299717976 + ,0.328406731705262 + ,0.120753615482844 + ,-0.369205392526939 + ,0.791445739642711 + ,0.866899132578154 + ,0.0740812251511718 + ,-2.26488583771179) > #'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/rcomp/tmp/1wu7e1324469709.ps",horizontal=F,onefile=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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/2vlm71324469709.tab") > > try(system("convert tmp/1wu7e1324469709.ps tmp/1wu7e1324469709.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.940 0.040 0.964