R version 2.6.2 (2008-02-08)
Copyright (C) 2008 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(883,891,893,895,896,898,901,903,910,917,889,898,887,899,908,904,905,883,885,888,910,899,900,900,898,900,902,904,905,911,891,895,903,898,903,890,883,915,896,900,892,907,893,894,898,893,888,889,898,907,904,902,901,876,892,899,906,893,902,881,911,886,896,889,883,903,922,881,896,911,896,911,900,882,890,914,901,905,923,897,920,906,885,885,893,905,901,894,914,895,877,899,891,901,888,902,893,898,890,902)
> 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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/freestat/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,] "47"
[2,] "4.83178953406851"
[3,] "4.85613119711254"
[4,] "94.619292929293"
[5,] "93.6731"
[6,] "9.72724487865361"
[7,] "9.67848645192005"
[8,] "0.0108336895972174"
[9,] "0.0107793850467440"
[10,] "806264.21"
[11,] "93.6731"
[12,] "7.623"
[13,] "7.61"
[14,] "6.13"
[15,] "6"
[16,] "93.6731"
[17,] "93.69"
[18,] "12"
[19,] "12.75"
[20,] "12"
[21,] "12.5"
[22,] "12.25"
[23,] "12"
[24,] "12.25"
[25,] "13"
[26,] "6"
[27,] "6.375"
[28,] "6"
[29,] "6.25"
[30,] "6.125"
[31,] "6"
[32,] "6.125"
[33,] "6.5"
[34,] "0.00668896321070234"
[35,] "0.00710405348934392"
[36,] "0.00668896321070234"
[37,] "0.00696572861521315"
[38,] "0.0068273651943709"
[39,] "0.00668896321070234"
[40,] "0.0068273651943709"
[41,] "0.00724233983286908"
[42,] "4950"
[43,] "189.238585858586"
[44,] "10.9933333333333"
[45,] "10.9933333333333"
[46,] "0.505004155176229"
[47,] "0.98999883804858"
[48,] "0.999998826311697"
[49,] "0.00848886414253897"
[50,] "100"
> (arm <- mean(x))
[1] 897.87
> sqrtn <- sqrt(length(x))
> (armse <- sd(x) / sqrtn)
[1] 0.9727245
> (armose <- arm / armse)
[1] 923.0466
> (geo <- geomean(x))
[1] 897.8179
> (har <- harmean(x))
[1] 897.7659
> (qua <- quamean(x))
[1] 897.9222
> (win <- winmean(x))
[,1] [,2]
[1,] 897.87 0.9679359
[2,] 897.91 0.9421762
[3,] 897.82 0.9220509
[4,] 897.78 0.8986612
[5,] 897.78 0.8804934
[6,] 897.78 0.8804934
[7,] 897.57 0.8440230
[8,] 897.57 0.8440230
[9,] 897.75 0.8140651
[10,] 897.75 0.8140651
[11,] 897.64 0.7963959
[12,] 897.76 0.7776058
[13,] 897.63 0.7182548
[14,] 897.63 0.6777346
[15,] 897.63 0.6777346
[16,] 897.47 0.6560449
[17,] 897.64 0.6318995
[18,] 897.46 0.6085950
[19,] 897.46 0.6085950
[20,] 897.66 0.5812248
[21,] 897.66 0.5812248
[22,] 897.44 0.5540156
[23,] 897.67 0.5235958
[24,] 897.67 0.5235958
[25,] 897.42 0.4940413
[26,] 897.68 0.4607591
[27,] 897.68 0.4607591
[28,] 897.96 0.4268560
[29,] 897.67 0.3933937
[30,] 897.67 0.3933937
[31,] 897.67 0.3933937
[32,] 897.67 0.3933937
[33,] 897.67 0.3933937
> (tri <- trimean(x))
[,1] [,2]
[1,] 897.8367 0.9320140
[2,] 897.8021 0.8909412
[3,] 897.7447 0.8598862
[4,] 897.7174 0.8332447
[5,] 897.7000 0.8108888
[6,] 897.6818 0.7905769
[7,] 897.6628 0.7672522
[8,] 897.6786 0.7489064
[9,] 897.6951 0.7277129
[10,] 897.6875 0.7092503
[11,] 897.6795 0.6877680
[12,] 897.6842 0.6660200
[13,] 897.6757 0.6439730
[14,] 897.6806 0.6285545
[15,] 897.6857 0.6170600
[16,] 897.6912 0.6033479
[17,] 897.7121 0.5904307
[18,] 897.7188 0.5788384
[19,] 897.7419 0.5683972
[20,] 897.7667 0.5555913
[21,] 897.7759 0.5444785
[22,] 897.7857 0.5306907
[23,] 897.8148 0.5180691
[24,] 897.8269 0.5076497
[25,] 897.8400 0.4943435
[26,] 897.8750 0.4825180
[27,] 897.8913 0.4736825
[28,] 897.9091 0.4618858
[29,] 897.9091 0.4531597
[30,] 897.9250 0.4477687
[31,] 897.9474 0.4397519
[32,] 897.9722 0.4281487
[33,] 898.0000 0.4115100
> (midr <- midrange(x))
[1] 899.5
> midm <- array(NA,dim=8)
> for (j in 1:8) midm[j] <- midmean(x,j)
> midm
[1] 897.5769 897.5769 897.5769 897.5769 897.5769 897.5769 897.5769 897.9273
> postscript(file="/var/www/html/freestat/rcomp/tmp/1064y1210965341.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/freestat/rcomp/tmp/2xujp1210965341.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/freestat/rcomp/tmp/30ubj1210965341.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/freestat/rcomp/tmp/4a6aw1210965341.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/freestat/rcomp/tmp/535i51210965341.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/freestat/rcomp/tmp/6n5201210965341.tab")
> postscript(file="/var/www/html/freestat/rcomp/tmp/7y1jf1210965341.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> myhist<-hist(x)
> dev.off()
null device
1
> myhist
$breaks
[1] 875 880 885 890 895 900 905 910 915 920 925
$counts
[1] 2 10 11 16 22 21 7 7 2 2
$intensities
[1] 0.003999999 0.020000000 0.022000000 0.032000000 0.044000000 0.042000000
[7] 0.014000000 0.014000000 0.004000000 0.004000000
$density
[1] 0.003999999 0.020000000 0.022000000 0.032000000 0.044000000 0.042000000
[7] 0.014000000 0.014000000 0.004000000 0.004000000
$mids
[1] 877.5 882.5 887.5 892.5 897.5 902.5 907.5 912.5 917.5 922.5
$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/freestat/rcomp/tmp/8kf0a1210965342.tab")
> postscript(file="/var/www/html/freestat/rcomp/tmp/9adxc1210965342.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 (100 obs.); Bandwidth 'bw' = 3.275
x y
Min. :866.2 Min. :1.905e-05
1st Qu.:882.8 1st Qu.:2.602e-03
Median :899.5 Median :1.028e-02
Mean :899.5 Mean :1.499e-02
3rd Qu.:916.2 3rd Qu.:2.644e-02
Max. :932.8 Max. :4.231e-02
> 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/freestat/rcomp/tmp/106nt91210965342.tab")
>
> system("convert tmp/1064y1210965341.ps tmp/1064y1210965341.png")
> system("convert tmp/2xujp1210965341.ps tmp/2xujp1210965341.png")
> system("convert tmp/535i51210965341.ps tmp/535i51210965341.png")
> system("convert tmp/7y1jf1210965341.ps tmp/7y1jf1210965341.png")
> system("convert tmp/9adxc1210965342.ps tmp/9adxc1210965342.png")
>
>
> proc.time()
user system elapsed
2.661 1.143 2.792