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(255,280.2,299.9,339.2,374.2,393.5,389.2,381.7,375.2,369,357.4,352.1,346.5,342.9,340.3,328.3,322.9,314.3,308.9,294,285.6,281.2,280.3,278.8,274.5,270.4,263.4,259.9,258,262.7,284.7,311.3,322.1,327,331.3,333.3,321.4,327,320,314.7,316.7,314.4,321.3,318.2,307.2,301.3,287.5,277.7,274.4,258.8,253.3,251,248.4,249.5,246.1,244.5,243.6,244,240.8,249.8,248,259.4,260.5,260.8,261.3,259.5,256.6,257.9,256.5,254.2,253.3,253.8,255.5,257.1,257.3,253.2,252.8,252,250.7,252.2,250,251,253.4,251.2,255.6,261.1,258.9,259.9,261.2,264.7,267.1,266.4,267.7,268.6,267.5,268.5,268.5,270.5,270.9,270.1,269.3,269.8,270.1,264.9,263.7,264.8,263.7,255.9,276.2,360.1,380.5,373.7,369.8,366.6,359.3,345.8,326.2,324.5,328.1,327.5,324.4,316.5,310.9,301.5,291.7,290.4,287.4,277.7,281.6,288,276,272.9,283,283.3,276.8,284.5,282.7,281.2,287.4,283.1,284,285.5,289.2,292.5,296.4,305.2,303.9,311.5,316.3) > #'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/16sx01321541631.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/2jwzp1321541631.tab") > > try(system("convert tmp/16sx01321541631.ps tmp/16sx01321541631.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.240 0.110 1.324