R version 2.9.0 (2009-04-17)
Copyright (C) 2009 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(125.9,133.1,147,145.8,164.4,149.8,137.7,151.7,156.8,180,180.4,170.4,191.6,199.5,218.2,217.5,205,194,199.3,219.3,211.1,215.2,240.2,242.2,240.7,255.4,253,218.2,203.7,205.6,215.6,188.5,202.9,214,230.3,230,241,259.6,247.8,270.3,289.7,322.7,315,320.2,329.5,360.6,382.2,435.4,464,468.8,403,351.6,252,188,146.5,152.9,148.1,165.1,177,206.1)
> ylimmax = ''
> ylimmin = ''
> #'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!)
>
> #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/rcomp/createtable")
>
> x <-sort(x[!is.na(x)])
> num <- 50
> res <- array(NA,dim=c(num,3))
> geomean <- function(x) {
+ return(exp(mean(log(x))))
+ }
> harmean <- function(x) {
+ return(1/mean(1/x))
+ }
> quamean <- function(x) {
+ return(sqrt(mean(x*x)))
+ }
> winmean <- function(x) {
+ x <-sort(x[!is.na(x)])
+ n<-length(x)
+ denom <- 3
+ nodenom <- n/denom
+ if (nodenom>40) denom <- n/40
+ sqrtn = sqrt(n)
+ roundnodenom = floor(nodenom)
+ win <- array(NA,dim=c(roundnodenom,2))
+ for (j in 1:roundnodenom) {
+ win[j,1] <- (j*x[j+1]+sum(x[(j+1):(n-j)])+j*x[n-j])/n
+ win[j,2] <- sd(c(rep(x[j+1],j),x[(j+1):(n-j)],rep(x[n-j],j)))/sqrtn
+ }
+ return(win)
+ }
> trimean <- function(x) {
+ x <-sort(x[!is.na(x)])
+ n<-length(x)
+ denom <- 3
+ nodenom <- n/denom
+ if (nodenom>40) denom <- n/40
+ sqrtn = sqrt(n)
+ roundnodenom = floor(nodenom)
+ tri <- array(NA,dim=c(roundnodenom,2))
+ for (j in 1:roundnodenom) {
+ tri[j,1] <- mean(x,trim=j/n)
+ tri[j,2] <- sd(x[(j+1):(n-j)]) / sqrt(n-j*2)
+ }
+ return(tri)
+ }
> midrange <- function(x) {
+ return((max(x)+min(x))/2)
+ }
> 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]
+ }
+ }
+ }
+ }
> iqd <- function(x,def) {
+ x <-sort(x[!is.na(x)])
+ n<-length(x)
+ if (def==1) {
+ qvalue1 <- q1(x,n,0.25,i,f)
+ qvalue3 <- q1(x,n,0.75,i,f)
+ }
+ if (def==2) {
+ qvalue1 <- q2(x,n,0.25,i,f)
+ qvalue3 <- q2(x,n,0.75,i,f)
+ }
+ if (def==3) {
+ qvalue1 <- q3(x,n,0.25,i,f)
+ qvalue3 <- q3(x,n,0.75,i,f)
+ }
+ if (def==4) {
+ qvalue1 <- q4(x,n,0.25,i,f)
+ qvalue3 <- q4(x,n,0.75,i,f)
+ }
+ if (def==5) {
+ qvalue1 <- q5(x,n,0.25,i,f)
+ qvalue3 <- q5(x,n,0.75,i,f)
+ }
+ if (def==6) {
+ qvalue1 <- q6(x,n,0.25,i,f)
+ qvalue3 <- q6(x,n,0.75,i,f)
+ }
+ if (def==7) {
+ qvalue1 <- q7(x,n,0.25,i,f)
+ qvalue3 <- q7(x,n,0.75,i,f)
+ }
+ if (def==8) {
+ qvalue1 <- q8(x,n,0.25,i,f)
+ qvalue3 <- q8(x,n,0.75,i,f)
+ }
+ iqdiff <- qvalue3 - qvalue1
+ return(c(iqdiff,iqdiff/2,iqdiff/(qvalue3 + qvalue1)))
+ }
> midmean <- function(x,def) {
+ x <-sort(x[!is.na(x)])
+ n<-length(x)
+ if (def==1) {
+ qvalue1 <- q1(x,n,0.25,i,f)
+ qvalue3 <- q1(x,n,0.75,i,f)
+ }
+ if (def==2) {
+ qvalue1 <- q2(x,n,0.25,i,f)
+ qvalue3 <- q2(x,n,0.75,i,f)
+ }
+ if (def==3) {
+ qvalue1 <- q3(x,n,0.25,i,f)
+ qvalue3 <- q3(x,n,0.75,i,f)
+ }
+ if (def==4) {
+ qvalue1 <- q4(x,n,0.25,i,f)
+ qvalue3 <- q4(x,n,0.75,i,f)
+ }
+ if (def==5) {
+ qvalue1 <- q5(x,n,0.25,i,f)
+ qvalue3 <- q5(x,n,0.75,i,f)
+ }
+ if (def==6) {
+ qvalue1 <- q6(x,n,0.25,i,f)
+ qvalue3 <- q6(x,n,0.75,i,f)
+ }
+ if (def==7) {
+ qvalue1 <- q7(x,n,0.25,i,f)
+ qvalue3 <- q7(x,n,0.75,i,f)
+ }
+ if (def==8) {
+ qvalue1 <- q8(x,n,0.25,i,f)
+ qvalue3 <- q8(x,n,0.75,i,f)
+ }
+ midm <- 0
+ myn <- 0
+ roundno4 <- round(n/4)
+ round3no4 <- round(3*n/4)
+ for (i in 1:n) {
+ if ((x[i]>=qvalue1) & (x[i]<=qvalue3)){
+ midm = midm + x[i]
+ myn = myn + 1
+ }
+ }
+ midm = midm / myn
+ return(midm)
+ }
> range <- max(x) - min(x)
> lx <- length(x)
> biasf <- (lx-1)/lx
> varx <- var(x)
> bvarx <- varx*biasf
> sdx <- sqrt(varx)
> mx <- mean(x)
> bsdx <- sqrt(bvarx)
> x2 <- x*x
> mse0 <- sum(x2)/lx
> xmm <- x-mx
> xmm2 <- xmm*xmm
> msem <- sum(xmm2)/lx
> axmm <- abs(x - mx)
> medx <- median(x)
> axmmed <- abs(x - medx)
> xmmed <- x - medx
> xmmed2 <- xmmed*xmmed
> msemed <- sum(xmmed2)/lx
> qarr <- array(NA,dim=c(8,3))
> for (j in 1:8) {
+ qarr[j,] <- iqd(x,j)
+ }
> sdpo <- 0
> adpo <- 0
> for (i in 1:(lx-1)) {
+ for (j in (i+1):lx) {
+ ldi <- x[i]-x[j]
+ aldi <- abs(ldi)
+ sdpo = sdpo + ldi * ldi
+ adpo = adpo + aldi
+ }
+ }
> denom <- (lx*(lx-1)/2)
> sdpo = sdpo / denom
> adpo = adpo / denom
> gmd <- 0
> for (i in 1:lx) {
+ for (j in 1:lx) {
+ ldi <- abs(x[i]-x[j])
+ gmd = gmd + ldi
+ }
+ }
> gmd <- gmd / (lx*(lx-1))
> sumx <- sum(x)
> pk <- x / sumx
> ck <- cumsum(pk)
> dk <- array(NA,dim=lx)
> for (i in 1:lx) {
+ if (ck[i] <= 0.5) dk[i] <- ck[i] else dk[i] <- 1 - ck[i]
+ }
> bigd <- sum(dk) * 2 / (lx-1)
> iod <- 1 - sum(pk*pk)
> res[1,] <- c('Absolute range','http://www.xycoon.com/absolute.htm', range)
> res[2,] <- c('Relative range (unbiased)','http://www.xycoon.com/relative.htm', range/sd(x))
> res[3,] <- c('Relative range (biased)','http://www.xycoon.com/relative.htm', range/sqrt(varx*biasf))
> res[4,] <- c('Variance (unbiased)','http://www.xycoon.com/unbiased.htm', varx)
> res[5,] <- c('Variance (biased)','http://www.xycoon.com/biased.htm', bvarx)
> res[6,] <- c('Standard Deviation (unbiased)','http://www.xycoon.com/unbiased1.htm', sdx)
> res[7,] <- c('Standard Deviation (biased)','http://www.xycoon.com/biased1.htm', bsdx)
> res[8,] <- c('Coefficient of Variation (unbiased)','http://www.xycoon.com/variation.htm', sdx/mx)
> res[9,] <- c('Coefficient of Variation (biased)','http://www.xycoon.com/variation.htm', bsdx/mx)
> res[10,] <- c('Mean Squared Error (MSE versus 0)','http://www.xycoon.com/mse.htm', mse0)
> res[11,] <- c('Mean Squared Error (MSE versus Mean)','http://www.xycoon.com/mse.htm', msem)
> res[12,] <- c('Mean Absolute Deviation from Mean (MAD Mean)', 'http://www.xycoon.com/mean2.htm', sum(axmm)/lx)
> res[13,] <- c('Mean Absolute Deviation from Median (MAD Median)', 'http://www.xycoon.com/median1.htm', sum(axmmed)/lx)
> res[14,] <- c('Median Absolute Deviation from Mean', 'http://www.xycoon.com/mean3.htm', median(axmm))
> res[15,] <- c('Median Absolute Deviation from Median', 'http://www.xycoon.com/median2.htm', median(axmmed))
> res[16,] <- c('Mean Squared Deviation from Mean', 'http://www.xycoon.com/mean1.htm', msem)
> res[17,] <- c('Mean Squared Deviation from Median', 'http://www.xycoon.com/median.htm', msemed)
> mylink1 <- hyperlink('http://www.xycoon.com/difference.htm','Interquartile Difference','')
> mylink2 <- paste(mylink1,hyperlink('http://www.xycoon.com/method_1.htm','(Weighted Average at Xnp)',''),sep=' ')
> res[18,] <- c('', mylink2, qarr[1,1])
> mylink2 <- paste(mylink1,hyperlink('http://www.xycoon.com/method_2.htm','(Weighted Average at X(n+1)p)',''),sep=' ')
> res[19,] <- c('', mylink2, qarr[2,1])
> mylink2 <- paste(mylink1,hyperlink('http://www.xycoon.com/method_3.htm','(Empirical Distribution Function)',''),sep=' ')
> res[20,] <- c('', mylink2, qarr[3,1])
> mylink2 <- paste(mylink1,hyperlink('http://www.xycoon.com/method_4.htm','(Empirical Distribution Function - Averaging)',''),sep=' ')
> res[21,] <- c('', mylink2, qarr[4,1])
> mylink2 <- paste(mylink1,hyperlink('http://www.xycoon.com/method_5.htm','(Empirical Distribution Function - Interpolation)',''),sep=' ')
> res[22,] <- c('', mylink2, qarr[5,1])
> mylink2 <- paste(mylink1,hyperlink('http://www.xycoon.com/method_6.htm','(Closest Observation)',''),sep=' ')
> res[23,] <- c('', mylink2, qarr[6,1])
> mylink2 <- paste(mylink1,hyperlink('http://www.xycoon.com/method_7.htm','(True Basic - Statistics Graphics Toolkit)',''),sep=' ')
> res[24,] <- c('', mylink2, qarr[7,1])
> mylink2 <- paste(mylink1,hyperlink('http://www.xycoon.com/method_8.htm','(MS Excel (old versions))',''),sep=' ')
> res[25,] <- c('', mylink2, qarr[8,1])
> mylink1 <- hyperlink('http://www.xycoon.com/deviation.htm','Semi Interquartile Difference','')
> mylink2 <- paste(mylink1,hyperlink('http://www.xycoon.com/method_1.htm','(Weighted Average at Xnp)',''),sep=' ')
> res[26,] <- c('', mylink2, qarr[1,2])
> mylink2 <- paste(mylink1,hyperlink('http://www.xycoon.com/method_2.htm','(Weighted Average at X(n+1)p)',''),sep=' ')
> res[27,] <- c('', mylink2, qarr[2,2])
> mylink2 <- paste(mylink1,hyperlink('http://www.xycoon.com/method_3.htm','(Empirical Distribution Function)',''),sep=' ')
> res[28,] <- c('', mylink2, qarr[3,2])
> mylink2 <- paste(mylink1,hyperlink('http://www.xycoon.com/method_4.htm','(Empirical Distribution Function - Averaging)',''),sep=' ')
> res[29,] <- c('', mylink2, qarr[4,2])
> mylink2 <- paste(mylink1,hyperlink('http://www.xycoon.com/method_5.htm','(Empirical Distribution Function - Interpolation)',''),sep=' ')
> res[30,] <- c('', mylink2, qarr[5,2])
> mylink2 <- paste(mylink1,hyperlink('http://www.xycoon.com/method_6.htm','(Closest Observation)',''),sep=' ')
> res[31,] <- c('', mylink2, qarr[6,2])
> mylink2 <- paste(mylink1,hyperlink('http://www.xycoon.com/method_7.htm','(True Basic - Statistics Graphics Toolkit)',''),sep=' ')
> res[32,] <- c('', mylink2, qarr[7,2])
> mylink2 <- paste(mylink1,hyperlink('http://www.xycoon.com/method_8.htm','(MS Excel (old versions))',''),sep=' ')
> res[33,] <- c('', mylink2, qarr[8,2])
> mylink1 <- hyperlink('http://www.xycoon.com/variation1.htm','Coefficient of Quartile Variation','')
> mylink2 <- paste(mylink1,hyperlink('http://www.xycoon.com/method_1.htm','(Weighted Average at Xnp)',''),sep=' ')
> res[34,] <- c('', mylink2, qarr[1,3])
> mylink2 <- paste(mylink1,hyperlink('http://www.xycoon.com/method_2.htm','(Weighted Average at X(n+1)p)',''),sep=' ')
> res[35,] <- c('', mylink2, qarr[2,3])
> mylink2 <- paste(mylink1,hyperlink('http://www.xycoon.com/method_3.htm','(Empirical Distribution Function)',''),sep=' ')
> res[36,] <- c('', mylink2, qarr[3,3])
> mylink2 <- paste(mylink1,hyperlink('http://www.xycoon.com/method_4.htm','(Empirical Distribution Function - Averaging)',''),sep=' ')
> res[37,] <- c('', mylink2, qarr[4,3])
> mylink2 <- paste(mylink1,hyperlink('http://www.xycoon.com/method_5.htm','(Empirical Distribution Function - Interpolation)',''),sep=' ')
> res[38,] <- c('', mylink2, qarr[5,3])
> mylink2 <- paste(mylink1,hyperlink('http://www.xycoon.com/method_6.htm','(Closest Observation)',''),sep=' ')
> res[39,] <- c('', mylink2, qarr[6,3])
> mylink2 <- paste(mylink1,hyperlink('http://www.xycoon.com/method_7.htm','(True Basic - Statistics Graphics Toolkit)',''),sep=' ')
> res[40,] <- c('', mylink2, qarr[7,3])
> mylink2 <- paste(mylink1,hyperlink('http://www.xycoon.com/method_8.htm','(MS Excel (old versions))',''),sep=' ')
> res[41,] <- c('', mylink2, qarr[8,3])
> res[42,] <- c('Number of all Pairs of Observations', 'http://www.xycoon.com/pair_numbers.htm', lx*(lx-1)/2)
> res[43,] <- c('Squared Differences between all Pairs of Observations', 'http://www.xycoon.com/squared_differences.htm', sdpo)
> res[44,] <- c('Mean Absolute Differences between all Pairs of Observations', 'http://www.xycoon.com/mean_abs_differences.htm', adpo)
> res[45,] <- c('Gini Mean Difference', 'http://www.xycoon.com/gini_mean_difference.htm', gmd)
> res[46,] <- c('Leik Measure of Dispersion', 'http://www.xycoon.com/leiks_d.htm', bigd)
> res[47,] <- c('Index of Diversity', 'http://www.xycoon.com/diversity.htm', iod)
> res[48,] <- c('Index of Qualitative Variation', 'http://www.xycoon.com/qualitative_variation.htm', iod*lx/(lx-1))
> res[49,] <- c('Coefficient of Dispersion', 'http://www.xycoon.com/dispersion.htm', sum(axmm)/lx/medx)
> res[50,] <- c('Observations', '', lx)
> res
[,1]
[1,] "Absolute range"
[2,] "Relative range (unbiased)"
[3,] "Relative range (biased)"
[4,] "Variance (unbiased)"
[5,] "Variance (biased)"
[6,] "Standard Deviation (unbiased)"
[7,] "Standard Deviation (biased)"
[8,] "Coefficient of Variation (unbiased)"
[9,] "Coefficient of Variation (biased)"
[10,] "Mean Squared Error (MSE versus 0)"
[11,] "Mean Squared Error (MSE versus Mean)"
[12,] "Mean Absolute Deviation from Mean (MAD Mean)"
[13,] "Mean Absolute Deviation from Median (MAD Median)"
[14,] "Median Absolute Deviation from Mean"
[15,] "Median Absolute Deviation from Median"
[16,] "Mean Squared Deviation from Mean"
[17,] "Mean Squared Deviation from Median"
[18,] ""
[19,] ""
[20,] ""
[21,] ""
[22,] ""
[23,] ""
[24,] ""
[25,] ""
[26,] ""
[27,] ""
[28,] ""
[29,] ""
[30,] ""
[31,] ""
[32,] ""
[33,] ""
[34,] ""
[35,] ""
[36,] ""
[37,] ""
[38,] ""
[39,] ""
[40,] ""
[41,] ""
[42,] "Number of all Pairs of Observations"
[43,] "Squared Differences between all Pairs of Observations"
[44,] "Mean Absolute Differences between all Pairs of Observations"
[45,] "Gini Mean Difference"
[46,] "Leik Measure of Dispersion"
[47,] "Index of Diversity"
[48,] "Index of Qualitative Variation"
[49,] "Coefficient of Dispersion"
[50,] "Observations"
[,2]
[1,] "http://www.xycoon.com/absolute.htm"
[2,] "http://www.xycoon.com/relative.htm"
[3,] "http://www.xycoon.com/relative.htm"
[4,] "http://www.xycoon.com/unbiased.htm"
[5,] "http://www.xycoon.com/biased.htm"
[6,] "http://www.xycoon.com/unbiased1.htm"
[7,] "http://www.xycoon.com/biased1.htm"
[8,] "http://www.xycoon.com/variation.htm"
[9,] "http://www.xycoon.com/variation.htm"
[10,] "http://www.xycoon.com/mse.htm"
[11,] "http://www.xycoon.com/mse.htm"
[12,] "http://www.xycoon.com/mean2.htm"
[13,] "http://www.xycoon.com/median1.htm"
[14,] "http://www.xycoon.com/mean3.htm"
[15,] "http://www.xycoon.com/median2.htm"
[16,] "http://www.xycoon.com/mean1.htm"
[17,] "http://www.xycoon.com/median.htm"
[18,] "Interquartile Difference (Weighted Average at Xnp)"
[19,] "Interquartile Difference (Weighted Average at X(n+1)p)"
[20,] "Interquartile Difference (Empirical Distribution Function)"
[21,] "Interquartile Difference (Empirical Distribution Function - Averaging)"
[22,] "Interquartile Difference (Empirical Distribution Function - Interpolation)"
[23,] "Interquartile Difference (Closest Observation)"
[24,] "Interquartile Difference (True Basic - Statistics Graphics Toolkit)"
[25,] "Interquartile Difference (MS Excel (old versions))"
[26,] "Semi Interquartile Difference (Weighted Average at Xnp)"
[27,] "Semi Interquartile Difference (Weighted Average at X(n+1)p)"
[28,] "Semi Interquartile Difference (Empirical Distribution Function)"
[29,] "Semi Interquartile Difference (Empirical Distribution Function - Averaging)"
[30,] "Semi Interquartile Difference (Empirical Distribution Function - Interpolation)"
[31,] "Semi Interquartile Difference (Closest Observation)"
[32,] "Semi Interquartile Difference (True Basic - Statistics Graphics Toolkit)"
[33,] "Semi Interquartile Difference (MS Excel (old versions))"
[34,] "Coefficient of Quartile Variation (Weighted Average at Xnp)"
[35,] "Coefficient of Quartile Variation (Weighted Average at X(n+1)p)"
[36,] "Coefficient of Quartile Variation (Empirical Distribution Function)"
[37,] "Coefficient of Quartile Variation (Empirical Distribution Function - Averaging)"
[38,] "Coefficient of Quartile Variation (Empirical Distribution Function - Interpolation)"
[39,] "Coefficient of Quartile Variation (Closest Observation)"
[40,] "Coefficient of Quartile Variation (True Basic - Statistics Graphics Toolkit)"
[41,] "Coefficient of Quartile Variation (MS Excel (old versions))"
[42,] "http://www.xycoon.com/pair_numbers.htm"
[43,] "http://www.xycoon.com/squared_differences.htm"
[44,] "http://www.xycoon.com/mean_abs_differences.htm"
[45,] "http://www.xycoon.com/gini_mean_difference.htm"
[46,] "http://www.xycoon.com/leiks_d.htm"
[47,] "http://www.xycoon.com/diversity.htm"
[48,] "http://www.xycoon.com/qualitative_variation.htm"
[49,] "http://www.xycoon.com/dispersion.htm"
[50,] ""
[,3]
[1,] "342.9"
[2,] "4.19635261171575"
[3,] "4.23176549787481"
[4,] "6677.14830225989"
[5,] "6565.86249722222"
[6,] "81.7138195304802"
[7,] "81.0300098557455"
[8,] "0.35142957701033"
[9,] "0.348488692027491"
[10,] "60630.6378333333"
[11,] "6565.86249722222"
[12,] "60.9832222222222"
[13,] "57.7883333333333"
[14,] "44.2683333333333"
[15,] "38"
[16,] "6565.86249722222"
[17,] "6886.92916666667"
[18,] "76"
[19,] "77.05"
[20,] "76"
[21,] "75.7"
[22,] "74.35"
[23,] "76"
[24,] "74.35"
[25,] "78.4"
[26,] "38"
[27,] "38.525"
[28,] "38"
[29,] "37.85"
[30,] "37.175"
[31,] "38"
[32,] "37.175"
[33,] "39.2"
[34,] "0.176744186046512"
[35,] "0.178129695988903"
[36,] "0.176744186046512"
[37,] "0.174948000924428"
[38,] "0.171768511031535"
[39,] "0.176744186046512"
[40,] "0.171768511031535"
[41,] "0.181313598519889"
[42,] "1770"
[43,] "13354.2966045198"
[44,] "86.9913559322034"
[45,] "86.9913559322036"
[46,] "0.502911804901114"
[47,] "0.981309260525483"
[48,] "0.997941620873372"
[49,] "0.284171585378482"
[50,] "60"
> (arm <- mean(x))
[1] 232.5183
> sqrtn <- sqrt(length(x))
> (armse <- sd(x) / sqrtn)
[1] 10.54921
> (armose <- arm / armse)
[1] 22.04131
> (geo <- geomean(x))
[1] 220.5207
> (har <- harmean(x))
[1] 210.3265
> (qua <- quamean(x))
[1] 246.2329
> (win <- winmean(x))
[,1] [,2]
[1,] 232.5583 10.499165
[2,] 231.7583 10.134070
[3,] 230.5433 9.547002
[4,] 229.2033 9.130374
[5,] 227.4450 8.632408
[6,] 226.6550 8.383609
[7,] 224.2750 7.727349
[8,] 223.6217 7.479555
[9,] 223.4267 7.366433
[10,] 223.2100 7.070068
[11,] 219.9650 5.865739
[12,] 216.2250 5.100162
[13,] 215.0550 4.502478
[14,] 215.6150 4.086329
[15,] 215.7650 3.869021
[16,] 215.6050 3.808966
[17,] 216.5683 3.288872
[18,] 215.0383 3.002308
[19,] 215.6400 2.798935
[20,] 216.3400 2.668498
> (tri <- trimean(x))
[,1] [,2]
[1,] 230.2828 9.937271
[2,] 227.8446 9.224196
[3,] 225.6704 8.578240
[4,] 223.7962 8.067306
[5,] 222.1740 7.596936
[6,] 220.8562 7.186154
[7,] 219.5957 6.740217
[8,] 218.6841 6.381719
[9,] 217.8024 5.986599
[10,] 216.8650 5.487903
[11,] 215.8632 4.896237
[12,] 215.2417 4.506784
[13,] 215.0971 4.226821
[14,] 215.1031 4.024538
[15,] 215.0300 3.864290
[16,] 214.9250 3.695119
[17,] 214.8269 3.454222
[18,] 214.5708 3.282333
[19,] 214.5000 3.122298
[20,] 214.3200 2.936437
> (midr <- midrange(x))
[1] 297.35
> midm <- array(NA,dim=8)
> for (j in 1:8) midm[j] <- midmean(x,j)
> midm
[1] 213.8032 215.0300 213.8032 215.0300 215.0300 213.8032 215.0300 215.1031
> postscript(file="/var/www/html/rcomp/tmp/1hrug1260705892.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> lb <- win[,1] - 2*win[,2]
> ub <- win[,1] + 2*win[,2]
> if ((ylimmin == '') | (ylimmax == '')) plot(win[,1],type='b',main='Robustness of Central Tendency', xlab='j', pch=19, ylab='Winsorized Mean(j/n)', ylim=c(min(lb),max(ub))) else plot(win[,1],type='l',main='Robustness of Central Tendency', xlab='j', pch=19, ylab='Winsorized Mean(j/n)', ylim=c(ylimmin,ylimmax))
> lines(ub,lty=3)
> lines(lb,lty=3)
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/2lac11260705892.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> lb <- tri[,1] - 2*tri[,2]
> ub <- tri[,1] + 2*tri[,2]
> if ((ylimmin == '') | (ylimmax == '')) plot(tri[,1],type='b',main='Robustness of Central Tendency', xlab='j', pch=19, ylab='Trimmed Mean(j/n)', ylim=c(min(lb),max(ub))) else plot(tri[,1],type='l',main='Robustness of Central Tendency', xlab='j', pch=19, ylab='Trimmed Mean(j/n)', ylim=c(ylimmin,ylimmax))
> lines(ub,lty=3)
> lines(lb,lty=3)
> grid()
> dev.off()
null device
1
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,'Central Tendency - Ungrouped Data',4,TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'Measure',header=TRUE)
> a<-table.element(a,'Value',header=TRUE)
> a<-table.element(a,'S.E.',header=TRUE)
> a<-table.element(a,'Value/S.E.',header=TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/arithmetic_mean.htm', 'Arithmetic Mean', 'click to view the definition of the Arithmetic Mean'),header=TRUE)
> a<-table.element(a,arm)
> a<-table.element(a,hyperlink('http://www.xycoon.com/arithmetic_mean_standard_error.htm', armse, 'click to view the definition of the Standard Error of the Arithmetic Mean'))
> a<-table.element(a,armose)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/geometric_mean.htm', 'Geometric Mean', 'click to view the definition of the Geometric Mean'),header=TRUE)
> a<-table.element(a,geo)
> a<-table.element(a,'')
> a<-table.element(a,'')
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/harmonic_mean.htm', 'Harmonic Mean', 'click to view the definition of the Harmonic Mean'),header=TRUE)
> a<-table.element(a,har)
> a<-table.element(a,'')
> a<-table.element(a,'')
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/quadratic_mean.htm', 'Quadratic Mean', 'click to view the definition of the Quadratic Mean'),header=TRUE)
> a<-table.element(a,qua)
> a<-table.element(a,'')
> a<-table.element(a,'')
> a<-table.row.end(a)
> for (j in 1:length(win[,1])) {
+ a<-table.row.start(a)
+ mylabel <- paste('Winsorized Mean (',j)
+ mylabel <- paste(mylabel,'/')
+ mylabel <- paste(mylabel,length(win[,1]))
+ mylabel <- paste(mylabel,')')
+ a<-table.element(a,hyperlink('http://www.xycoon.com/winsorized_mean.htm', mylabel, 'click to view the definition of the Winsorized Mean'),header=TRUE)
+ a<-table.element(a,win[j,1])
+ a<-table.element(a,win[j,2])
+ a<-table.element(a,win[j,1]/win[j,2])
+ a<-table.row.end(a)
+ }
> for (j in 1:length(tri[,1])) {
+ a<-table.row.start(a)
+ mylabel <- paste('Trimmed Mean (',j)
+ mylabel <- paste(mylabel,'/')
+ mylabel <- paste(mylabel,length(tri[,1]))
+ mylabel <- paste(mylabel,')')
+ a<-table.element(a,hyperlink('http://www.xycoon.com/arithmetic_mean.htm', mylabel, 'click to view the definition of the Trimmed Mean'),header=TRUE)
+ a<-table.element(a,tri[j,1])
+ a<-table.element(a,tri[j,2])
+ a<-table.element(a,tri[j,1]/tri[j,2])
+ a<-table.row.end(a)
+ }
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/median_1.htm', 'Median', 'click to view the definition of the Median'),header=TRUE)
> a<-table.element(a,median(x))
> a<-table.element(a,'')
> a<-table.element(a,'')
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/midrange.htm', 'Midrange', 'click to view the definition of the Midrange'),header=TRUE)
> a<-table.element(a,midr)
> a<-table.element(a,'')
> a<-table.element(a,'')
> a<-table.row.end(a)
> a<-table.row.start(a)
> mymid <- hyperlink('http://www.xycoon.com/midmean.htm', 'Midmean', 'click to view the definition of the Midmean')
> mylabel <- paste(mymid,hyperlink('http://www.xycoon.com/method_1.htm','Weighted Average at Xnp',''),sep=' - ')
> a<-table.element(a,mylabel,header=TRUE)
> a<-table.element(a,midm[1])
> a<-table.element(a,'')
> a<-table.element(a,'')
> a<-table.row.end(a)
> a<-table.row.start(a)
> mymid <- hyperlink('http://www.xycoon.com/midmean.htm', 'Midmean', 'click to view the definition of the Midmean')
> mylabel <- paste(mymid,hyperlink('http://www.xycoon.com/method_2.htm','Weighted Average at X(n+1)p',''),sep=' - ')
> a<-table.element(a,mylabel,header=TRUE)
> a<-table.element(a,midm[2])
> a<-table.element(a,'')
> a<-table.element(a,'')
> a<-table.row.end(a)
> a<-table.row.start(a)
> mymid <- hyperlink('http://www.xycoon.com/midmean.htm', 'Midmean', 'click to view the definition of the Midmean')
> mylabel <- paste(mymid,hyperlink('http://www.xycoon.com/method_3.htm','Empirical Distribution Function',''),sep=' - ')
> a<-table.element(a,mylabel,header=TRUE)
> a<-table.element(a,midm[3])
> a<-table.element(a,'')
> a<-table.element(a,'')
> a<-table.row.end(a)
> a<-table.row.start(a)
> mymid <- hyperlink('http://www.xycoon.com/midmean.htm', 'Midmean', 'click to view the definition of the Midmean')
> mylabel <- paste(mymid,hyperlink('http://www.xycoon.com/method_4.htm','Empirical Distribution Function - Averaging',''),sep=' - ')
> a<-table.element(a,mylabel,header=TRUE)
> a<-table.element(a,midm[4])
> a<-table.element(a,'')
> a<-table.element(a,'')
> a<-table.row.end(a)
> a<-table.row.start(a)
> mymid <- hyperlink('http://www.xycoon.com/midmean.htm', 'Midmean', 'click to view the definition of the Midmean')
> mylabel <- paste(mymid,hyperlink('http://www.xycoon.com/method_5.htm','Empirical Distribution Function - Interpolation',''),sep=' - ')
> a<-table.element(a,mylabel,header=TRUE)
> a<-table.element(a,midm[5])
> a<-table.element(a,'')
> a<-table.element(a,'')
> a<-table.row.end(a)
> a<-table.row.start(a)
> mymid <- hyperlink('http://www.xycoon.com/midmean.htm', 'Midmean', 'click to view the definition of the Midmean')
> mylabel <- paste(mymid,hyperlink('http://www.xycoon.com/method_6.htm','Closest Observation',''),sep=' - ')
> a<-table.element(a,mylabel,header=TRUE)
> a<-table.element(a,midm[6])
> a<-table.element(a,'')
> a<-table.element(a,'')
> a<-table.row.end(a)
> a<-table.row.start(a)
> mymid <- hyperlink('http://www.xycoon.com/midmean.htm', 'Midmean', 'click to view the definition of the Midmean')
> mylabel <- paste(mymid,hyperlink('http://www.xycoon.com/method_7.htm','True Basic - Statistics Graphics Toolkit',''),sep=' - ')
> a<-table.element(a,mylabel,header=TRUE)
> a<-table.element(a,midm[7])
> a<-table.element(a,'')
> a<-table.element(a,'')
> a<-table.row.end(a)
> a<-table.row.start(a)
> mymid <- hyperlink('http://www.xycoon.com/midmean.htm', 'Midmean', 'click to view the definition of the Midmean')
> mylabel <- paste(mymid,hyperlink('http://www.xycoon.com/method_8.htm','MS Excel (old versions)',''),sep=' - ')
> a<-table.element(a,mylabel,header=TRUE)
> a<-table.element(a,midm[8])
> a<-table.element(a,'')
> a<-table.element(a,'')
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'Number of observations',header=TRUE)
> a<-table.element(a,length(x))
> a<-table.element(a,'')
> a<-table.element(a,'')
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/3gx0a1260705892.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,'Variability - Ungrouped Data',2,TRUE)
> a<-table.row.end(a)
> for (i in 1:num) {
+ a<-table.row.start(a)
+ if (res[i,1] != '') {
+ a<-table.element(a,hyperlink(res[i,2],res[i,1],''),header=TRUE)
+ } else {
+ a<-table.element(a,res[i,2],header=TRUE)
+ }
+ a<-table.element(a,res[i,3])
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/4xvk31260705892.tab")
> 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/59mrt1260705892.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> myqqnorm <- qqnorm(x,col=2)
> qqline(x)
> grid()
> dev.off()
null device
1
> 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/6ot9w1260705893.tab")
> postscript(file="/var/www/html/rcomp/tmp/73wda1260705893.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> myhist<-hist(x)
> dev.off()
null device
1
> myhist
$breaks
[1] 100 150 200 250 300 350 400 450 500
$counts
[1] 8 15 20 6 4 3 2 2
$intensities
[1] 0.0026666661 0.0050000000 0.0066666667 0.0020000000 0.0013333333
[6] 0.0010000000 0.0006666667 0.0006666667
$density
[1] 0.0026666661 0.0050000000 0.0066666667 0.0020000000 0.0013333333
[6] 0.0010000000 0.0006666667 0.0006666667
$mids
[1] 125 175 225 275 325 375 425 475
$xname
[1] "x"
$equidist
[1] TRUE
attr(,"class")
[1] "histogram"
> n <- length(x)
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/histogram.htm','Frequency Table (Histogram)',''),6,TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'Bins',header=TRUE)
> a<-table.element(a,'Midpoint',header=TRUE)
> a<-table.element(a,'Abs. Frequency',header=TRUE)
> a<-table.element(a,'Rel. Frequency',header=TRUE)
> a<-table.element(a,'Cumul. Rel. Freq.',header=TRUE)
> a<-table.element(a,'Density',header=TRUE)
> a<-table.row.end(a)
> crf <- 0
> mybracket <- '['
> mynumrows <- (length(myhist$breaks)-1)
> for (i in 1:mynumrows) {
+ a<-table.row.start(a)
+ if (i == 1)
+ dum <- paste('[',myhist$breaks[i],sep='')
+ else
+ dum <- paste(mybracket,myhist$breaks[i],sep='')
+ dum <- paste(dum,myhist$breaks[i+1],sep=',')
+ if (i==mynumrows)
+ dum <- paste(dum,']',sep='')
+ else
+ dum <- paste(dum,mybracket,sep='')
+ a<-table.element(a,dum,header=TRUE)
+ a<-table.element(a,myhist$mids[i])
+ a<-table.element(a,myhist$counts[i])
+ rf <- myhist$counts[i]/n
+ crf <- crf + rf
+ a<-table.element(a,round(rf,6))
+ a<-table.element(a,round(crf,6))
+ a<-table.element(a,round(myhist$density[i],6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/89mg81260705893.tab")
> postscript(file="/var/www/html/rcomp/tmp/93tsy1260705893.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> mydensity1<-density(x,kernel='gaussian',na.rm=TRUE)
> plot(mydensity1,main='Gaussian Kernel')
> grid()
> dev.off()
null device
1
> mydensity1
Call:
density.default(x = x, kernel = "gaussian", na.rm = TRUE)
Data: x (60 obs.); Bandwidth 'bw' = 22.02
x y
Min. : 59.84 Min. :5.132e-06
1st Qu.:178.60 1st Qu.:6.219e-04
Median :297.35 Median :1.237e-03
Mean :297.35 Mean :2.103e-03
3rd Qu.:416.10 3rd Qu.:3.593e-03
Max. :534.86 Max. :6.750e-03
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,'Properties of Density Trace',2,TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'Bandwidth',header=TRUE)
> a<-table.element(a,mydensity1$bw)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'#Observations',header=TRUE)
> a<-table.element(a,mydensity1$n)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/10cag71260705893.tab")
>
> try(system("convert tmp/1hrug1260705892.ps tmp/1hrug1260705892.png",intern=TRUE))
character(0)
> try(system("convert tmp/2lac11260705892.ps tmp/2lac11260705892.png",intern=TRUE))
character(0)
> try(system("convert tmp/59mrt1260705892.ps tmp/59mrt1260705892.png",intern=TRUE))
character(0)
> try(system("convert tmp/73wda1260705893.ps tmp/73wda1260705893.png",intern=TRUE))
character(0)
> try(system("convert tmp/93tsy1260705893.ps tmp/93tsy1260705893.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
1.266 0.787 1.490