R version 2.6.0 (2007-10-03) Copyright (C) 2007 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(1.57374261731945e-11 + ,-7.78930535948257e-10 + ,-9.9175708985985e-11 + ,-6.17827740269557e-10 + ,2.80917788736100e-10 + ,-1.99763641625773e-10 + ,-5.62280802209156e-10 + ,-3.834963850376e-10 + ,-4.17216827233602e-10 + ,-5.67882584539982e-10 + ,2.58637700997753e-10 + ,-1.90527862999576e-10 + ,-1.71577262349281e-09 + ,-3.35381605481246e-10 + ,-8.96626940018993e-10 + ,-4.10744385478952e-10 + ,-1.49797381174457e-10 + ,-1.15741365009681e-09 + ,4.97758749117844e-10 + ,5.61962186332171e-10 + ,-8.28837144782243e-11 + ,3.00919401758308e-10 + ,-3.56842310474036e-10 + ,-2.65445564649461e-10 + ,1.41088100275876e-09 + ,-1.03460467298531e-10 + ,7.3845130614864e-11 + ,-9.69944238759222e-11 + ,5.131852651389e-10 + ,-7.01634738041197e-10 + ,-1.38560835918767e-10 + ,-7.71959620063928e-10 + ,-7.0799159060927e-10 + ,9.21374878678968e-10 + ,-2.34800895738451e-10 + ,-1.51898308298110e-10 + ,4.14446046879670e-10 + ,1.60789644435293e-10 + ,-5.59704597759589e-10 + ,-1.62599611179260e-10 + ,-2.51259688470892e-10 + ,6.02392608325336e-10 + ,1.40768937817837e-09 + ,8.67663665864935e-10 + ,2.48443566634038e-09 + ,-1.58728692714916e-10 + ,-2.38522160490848e-10 + ,1.69115939544137e-09 + ,4.90955643343371e-09 + ,-4.72645086787659e-11 + ,-8.42090559114202e-10 + ,-9.78841734822696e-10 + ,5.33492432359219e-10 + ,9.43414526915943e-10 + ,3.41369607077995e-10 + ,1.95723637461107e-10 + ,3.00517747585271e-10 + ,-9.1302653563983e-10 + ,-8.67566852412382e-10 + ,5.08551441993418e-10 + ,-4.81913846464095e-09 + ,8.72479910544946e-10 + ,4.49296782533904e-10 + ,5.3731256719039e-10 + ,-7.49441166608007e-10 + ,7.73568132392035e-10 + ,1.67536877808481e-10 + ,2.03569599537960e-09 + ,5.86636632995461e-11 + ,-6.17168126334066e-10 + ,-3.4433140227747e-10 + ,-8.6322485209947e-10 + ,-3.25333745267874e-09 + ,3.08292515576174e-10 + ,1.19026377148694e-09 + ,9.77788786184594e-10 + ,-4.57474202748115e-11 + ,-1.02595722322947e-10 + ,-9.7138521570781e-10 + ,1.17167162511307e-09 + ,-1.15353929661592e-09 + ,-8.03674125843833e-10 + ,6.27537221374364e-10 + ,-8.74606140260688e-10 + ,1.5572731935976e-09) > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: Wessa P., (2007), Percentiles (v1.0.4) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_percentiles.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > x <-sort(x[!is.na(x)]) > q1 <- function(data,n,p,i,f) { + np <- n*p; + i <<- floor(np) + f <<- np - i + qvalue <- (1-f)*data[i] + f*data[i+1] + } > q2 <- function(data,n,p,i,f) { + np <- (n+1)*p + i <<- floor(np) + f <<- np - i + qvalue <- (1-f)*data[i] + f*data[i+1] + } > q3 <- function(data,n,p,i,f) { + np <- n*p + i <<- floor(np) + f <<- np - i + if (f==0) { + qvalue <- data[i] + } else { + qvalue <- data[i+1] + } + } > q4 <- function(data,n,p,i,f) { + np <- n*p + i <<- floor(np) + f <<- np - i + if (f==0) { + qvalue <- (data[i]+data[i+1])/2 + } else { + qvalue <- data[i+1] + } + } > q5 <- function(data,n,p,i,f) { + np <- (n-1)*p + i <<- floor(np) + f <<- np - i + if (f==0) { + qvalue <- data[i+1] + } else { + qvalue <- data[i+1] + f*(data[i+2]-data[i+1]) + } + } > q6 <- function(data,n,p,i,f) { + np <- n*p+0.5 + i <<- floor(np) + f <<- np - i + qvalue <- data[i] + } > q7 <- function(data,n,p,i,f) { + np <- (n+1)*p + i <<- floor(np) + f <<- np - i + if (f==0) { + qvalue <- data[i] + } else { + qvalue <- f*data[i] + (1-f)*data[i+1] + } + } > q8 <- function(data,n,p,i,f) { + np <- (n+1)*p + i <<- floor(np) + f <<- np - i + if (f==0) { + qvalue <- data[i] + } else { + if (f == 0.5) { + qvalue <- (data[i]+data[i+1])/2 + } else { + if (f < 0.5) { + qvalue <- data[i] + } else { + qvalue <- data[i+1] + } + } + } + } > lx <- length(x) > qval <- array(NA,dim=c(99,8)) > mystep <- 25 > mystart <- 25 > if (lx>10){ + mystep=10 + mystart=10 + } > if (lx>20){ + mystep=5 + mystart=5 + } > if (lx>50){ + mystep=2 + mystart=2 + } > if (lx>=100){ + mystep=1 + mystart=1 + } > for (perc in seq(mystart,99,mystep)) { + qval[perc,1] <- q1(x,lx,perc/100,i,f) + qval[perc,2] <- q2(x,lx,perc/100,i,f) + qval[perc,3] <- q3(x,lx,perc/100,i,f) + qval[perc,4] <- q4(x,lx,perc/100,i,f) + qval[perc,5] <- q5(x,lx,perc/100,i,f) + qval[perc,6] <- q6(x,lx,perc/100,i,f) + qval[perc,7] <- q7(x,lx,perc/100,i,f) + qval[perc,8] <- q8(x,lx,perc/100,i,f) + } > postscript(file="/var/www/html/rcomp/tmp/1xw9n1196682602.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > myqqnorm <- qqnorm(x,col=2) > dev.off() null device 1 > load(file='/var/www/html/rcomp/createtable') > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Percentiles - Ungrouped Data',9,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'p',1,TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/method_1.htm', 'Weighted Average at Xnp',''),1,TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/method_2.htm','Weighted Average at X(n+1)p',''),1,TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/method_3.htm','Empirical Distribution Function',''),1,TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/method_4.htm','Empirical Distribution Function - Averaging',''),1,TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/method_5.htm','Empirical Distribution Function - Interpolation',''),1,TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/method_6.htm','Closest Observation',''),1,TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/method_7.htm','True Basic - Statistics Graphics Toolkit',''),1,TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/method_8.htm','MS Excel (old versions)',''),1,TRUE) > a<-table.row.end(a) > for (perc in seq(mystart,99,mystep)) { + a<-table.row.start(a) + a<-table.element(a,round(perc/100,2),1,TRUE) + for (j in 1:8) { + a<-table.element(a,round(qval[perc,j],6)) + } + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/2gh8p1196682602.tab") > > system("convert tmp/1xw9n1196682602.ps tmp/1xw9n1196682602.png") > > > proc.time() user system elapsed 0.831 0.200 1.053