R version 3.0.2 (2013-09-25) -- "Frisbee Sailing"
Copyright (C) 2013 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-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(0.057762265,0.090103357,0,0,0.095894024,0,0.098893929,0.243091192,0.117945826,0.029479131,0.094597338,0,0,0.533190139,0,0,0.239016269,0,0.261113127,0,0.123685166,0.015896594,0.216608494,0.032867387,0.187468237,0.071334989,0.06158354,0.040526053,0.012635302,0.053626447,0.028979682,0.022790195,0.049446964,0,0,0,0.128360589,0.10172336,0,0.115847174,0,0,0,0,0.693147181,0.274653072,0.176209756,0.229919702,0.072975089,0.020793082,0.096270442,0.202732554,0.095403555,0,0.059398328,0,0.091160778,0.070068491,0.096659395,0.032366241,0.018328881,0,0,0,0.082194878,0.050714443,0.028039353,0.063076589,0.025322438,0.044043051,0.019712249,0.129002479,0.069435452,0.017272216,0.144542902,0,0.113407967,0.075492586,0.11985994,0,0.019214848,0.029629355,0.02207454,0.169942342,0,0.223057247,0,0.097487033,0,0.074701712,0,0.022186241,0)
> ylimmax = ''
> ylimmin = ''
> #'GNU S' R Code compiled by R2WASP v. 1.2.291 ()
> #Author: root
> #To cite this work: Wessa P., (2012), Univariate Summary Statistics (v1.0.6) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_summary1.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #
>
> #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/wessaorg/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,] "0.693147181"
[2,] "6.41493360213538"
[3,] "6.44970314461965"
[4,] "0.0116752608261572"
[5,] "0.0115497203871663"
[6,] "0.108052120877645"
[7,] "0.107469625416516"
[8,] "1.43658329370851"
[9,] "1.42883885295786"
[10,] "0.0172069651393429"
[11,] "0.0115497203871663"
[12,] "0.0704644800360735"
[13,] "0.0662286199462366"
[14,] "0.056885776827957"
[15,] "0.040526053"
[16,] "0.0115497203871663"
[17,] "0.0127530196920765"
[18,] "0.0972801235"
[19,] "0.098190481"
[20,] "0.097487033"
[21,] "0.097487033"
[22,] "0.097487033"
[23,] "0.097487033"
[24,] "0.098190481"
[25,] "0.098190481"
[26,] "0.04864006175"
[27,] "0.0490952405"
[28,] "0.0487435165"
[29,] "0.0487435165"
[30,] "0.0487435165"
[31,] "0.0487435165"
[32,] "0.0490952405"
[33,] "0.0490952405"
[34,] "1"
[35,] "1"
[36,] "1"
[37,] "1"
[38,] "1"
[39,] "1"
[40,] "1"
[41,] "1"
[42,] "4278"
[43,] "0.0233505216523145"
[44,] "0.0962772943758766"
[45,] "0.0962772943758762"
[46,] "0.269533320436251"
[47,] "0.967294833680409"
[48,] "0.977808907959544"
[49,] "1.73874519771451"
[50,] "93"
> (arm <- mean(x))
[1] 0.07521466
> sqrtn <- sqrt(length(x))
> (armse <- sd(x) / sqrtn)
[1] 0.01120448
> (armose <- arm / armse)
[1] 6.712907
> (geo <- geomean(x))
[1] 0
> (har <- harmean(x))
[1] 0
> (qua <- quamean(x))
[1] 0.1311753
> (win <- winmean(x))
[,1] [,2]
[1,] 0.07349469 0.010266151
[2,] 0.06793475 0.008069680
[3,] 0.06749798 0.007951047
[4,] 0.06672284 0.007752541
[5,] 0.06650376 0.007698772
[6,] 0.06591689 0.007558070
[7,] 0.06540036 0.007437640
[8,] 0.06484563 0.007311141
[9,] 0.06350279 0.007014660
[10,] 0.06186147 0.006669381
[11,] 0.06052982 0.006402199
[12,] 0.05972112 0.006245193
[13,] 0.05617066 0.005598065
[14,] 0.05383124 0.005213412
[15,] 0.05372771 0.005197219
[16,] 0.05292334 0.005073448
[17,] 0.05222410 0.004968702
[18,] 0.05185363 0.004914213
[19,] 0.05142487 0.004851932
[20,] 0.05090031 0.004776769
[21,] 0.04826185 0.004414935
[22,] 0.04759253 0.004327756
[23,] 0.04724458 0.004283157
[24,] 0.04703100 0.004256005
[25,] 0.04692644 0.004242770
[26,] 0.04682121 0.004229482
[27,] 0.04667881 0.004211550
[28,] 0.04643608 0.004181092
[29,] 0.04930451 0.003588021
[30,] 0.05001543 0.003429374
[31,] 0.04783781 0.003050421
> (tri <- trimean(x))
[,1] [,2]
[1,] 0.06925073 0.009134655
[2,] 0.06481602 0.007677119
[3,] 0.06314911 0.007430775
[4,] 0.06156305 0.007196111
[5,] 0.06011769 0.006992943
[6,] 0.05865126 0.006770362
[7,] 0.05722573 0.006546658
[8,] 0.05581526 0.006312216
[9,] 0.05441556 0.006063489
[10,] 0.05312924 0.005835306
[11,] 0.05198544 0.005638478
[12,] 0.05093850 0.005458489
[13,] 0.05093850 0.005273454
[14,] 0.04923494 0.005177076
[15,] 0.04875029 0.005127535
[16,] 0.04824439 0.005066904
[17,] 0.04778344 0.005011200
[18,] 0.04735724 0.004957370
[19,] 0.04693485 0.004896566
[20,] 0.04652018 0.004828288
[21,] 0.04612082 0.004752817
[22,] 0.04592732 0.004719245
[23,] 0.04577754 0.004685591
[24,] 0.04564572 0.004643665
[25,] 0.04552089 0.004587610
[26,] 0.04552089 0.004510221
[27,] 0.04526240 0.004404443
[28,] 0.04513054 0.004261183
[29,] 0.04500665 0.004068919
[30,] 0.04458899 0.003954991
[31,] 0.04404635 0.003826051
> (midr <- midrange(x))
[1] 0.3465736
> midm <- array(NA,dim=8)
> for (j in 1:8) midm[j] <- midmean(x,j)
> midm
[1] 0.02976895 0.03073635 0.03073635 0.03073635 0.03073635 0.03073635 0.03073635
[8] 0.03073635
> postscript(file="/var/wessaorg/rcomp/tmp/1jigv1424646511.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/2ulzw1424646511.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/3l1251424646511.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/wessaorg/rcomp/tmp/4wgcs1424646511.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/wessaorg/rcomp/tmp/53ooz1424646511.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/6lqi71424646511.tab")
> postscript(file="/var/wessaorg/rcomp/tmp/7knno1424646511.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> myhist<-hist(x)
> dev.off()
null device
1
> myhist
$breaks
[1] 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7
$counts
[1] 71 12 8 0 0 1 1
$density
[1] 7.6344086 1.2903226 0.8602151 0.0000000 0.0000000 0.1075269 0.1075269
$mids
[1] 0.05 0.15 0.25 0.35 0.45 0.55 0.65
$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/wessaorg/rcomp/tmp/8fdof1424646511.tab")
> postscript(file="/var/wessaorg/rcomp/tmp/9o2091424646511.ps",horizontal=F,onefile=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 (93 obs.); Bandwidth 'bw' = 0.02645
x y
Min. :-0.07934 Min. :0.000002
1st Qu.: 0.13362 1st Qu.:0.017469
Median : 0.34657 Median :0.144679
Mean : 0.34657 Mean :1.172310
3rd Qu.: 0.55953 3rd Qu.:1.058621
Max. : 0.77249 Max. :7.250335
> 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/wessaorg/rcomp/tmp/10vwg81424646511.tab")
>
> try(system("convert tmp/1jigv1424646511.ps tmp/1jigv1424646511.png",intern=TRUE))
character(0)
> try(system("convert tmp/2ulzw1424646511.ps tmp/2ulzw1424646511.png",intern=TRUE))
character(0)
> try(system("convert tmp/53ooz1424646511.ps tmp/53ooz1424646511.png",intern=TRUE))
character(0)
> try(system("convert tmp/7knno1424646511.ps tmp/7knno1424646511.png",intern=TRUE))
character(0)
> try(system("convert tmp/9o2091424646511.ps tmp/9o2091424646511.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
2.395 0.352 2.769