R version 2.12.1 (2010-12-16) 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(1686,1591,2304,1712,1471,1377,1966,2453,1984,2596,4087,5179,1530,1523,1633,1976,1170,1480,1781,2472,1981,2273,3857,4551,1510,1329,1518,1790,1537,1449,1954,1897,1706,2514,3593,4524,1609,1638,2030,1375,1320,1245,1600,2298,2191,2511,3440,4923,1609,1435,2061,1789,1567,1404,1597,3159,1759,2504,4273,5274,1771,1682,1846,1589,1896,1379,1645,2512,1771,3727,4388,5434,1606,1523,1577,1605,1765,1403,2584,3318,1562,2349,3987,5891,1389,1442,1548,1935,1518,1250,1847,1930,2638,3114,4405,7242,1853,1779,2108,2336,1728,1661,2230,1645,2421,3740,4988,6757,1757,1394,1982,1650,1654,1406,1971,1968,2608,3845,4514,6694,1720,1321,1859,1628,1615,1457,1899,1605,2424,3116,4286,6047,1902,2049,1874,1279,1432,1540,2214,1857,2408,3252,3627,6153,1577,1667,1993,1997,1783,1625,2076,1773,2377,3088,4096,6119,1494,1564,1898,2121,1831,1515,2048,2795,1749,3339,4227,6410,1197,1968,1720,1725,1674,1693,2031,1495,2968,3385,3729,5999,1070,1402,1897,1862,1670,1688,2031) > #'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/14vbv1301910881.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=11.111111111111) > 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/202rm1301910881.tab") > > try(system("convert tmp/14vbv1301910881.ps tmp/14vbv1301910881.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.264 0.124 1.368