Free Statistics

of Irreproducible Research!

Author's title

Author*The author of this computation has been verified*
R Software Modulerwasp_centraltendency.wasp
Title produced by softwareCentral Tendency
Date of computationSat, 10 Dec 2011 06:59:01 -0500
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2011/Dec/10/t13235183564s2iyi80zctgvs5.htm/, Retrieved Sun, 05 May 2024 02:32:31 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=153488, Retrieved Sun, 05 May 2024 02:32:31 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact125
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [Central Tendency] [Central Tendency] [2011-12-10 11:59:01] [03e2d80b807f43987d5267414f2021cf] [Current]
Feedback Forum

Post a new message
Dataseries X:
-0.570875874954911
-0.511137633876425
-102.711.574.887.165
-0.247459135140635
-0.595944868112521
-0.681163109535305
0.345185635144615
151.024.603.582.169
-0.418019414772234
-0.311267072375839
167.163.081.198.947
-0.539506946905068
140.945.065.934.532
22.420.522.686.079
11.650.962.896.284
242.060.649.786.476
0.0682279397221915
-0.11067421906174
0.024453242603238
-0.497693857719122
-0.595630964725977
0.115390547461763
-0.675239658349256
-0.57778043034228
0.50210834818284
0.283004867702643
0.430374653934966
-0.695202084018761
-0.430981910529177
-0.970212998970839
-110.289.156.964.033
-0.506294026344613
-11.356.372.838.091
-0.716198265950065
238.909.456.645.549
0.766445974578577
0.20101606034162
0.938576757692077
-0.975096254853228
-0.0782947847538538
0.215600369809319
111.394.756.921.882
16.878.843.005.693
0.740961084054461
-0.278511975869071
0.105272624006693
-0.871792516446899
103.273.141.271
115.764.643.511.619
-136.281.718.857.765
-122.079.671.087.844
302.664.994.074.065
-114.348.881.138.996
-101.628.030.645.187
-0.954424929131502
-0.21738667106372
-0.949233018879874
-104.076.580.006.722
-0.86871330354106
-0.895786571506119
-138.421.385.241.876
-0.502591734605609
-0.979653837088994
-0.756778917390011
-102.509.893.199.872
0.775078491645856
-0.577057910071895
-113.886.240.901.432
0.62205809771103
-0.265105972838122
287.802.336.297.808
-0.382208027407422
-0.803820507579544
-0.136143485767757
11.797.677.238.516
399.082.323.347.408
-0.600638307090792
-0.311939888127828
133.010.622.026.773
-0.0109999670812058
0.0925603270401305
0.0666536056689318
-0.0976293348785303
0.123635635988901
-0.518466391586699
-0.697414295956901
-126.611.290.183.839
0.516880230125759
0.763210392895926
-317.516.924.292.666
0.301867748783821
124.353.362.687.794
0.356838232267432
0.804523450098973
-0.736843535921125
145.248.739.251.206
-0.183442920152471
-132.915.521.507.038
0.505243391464097
-0.252827982423921
-0.0820050030754919
0.806423061579241
-133.566.333.741.937
114.870.981.436.885
0.143480495184982
-0.629857613263178
-0.278502748669541
-0.0922405695467127
0.331799201089393
-0.641972295179589
-0.52925336602269
-0.292544657144514
-0.48090361413658
-0.231631079662059
-0.546752715146306
-0.0781488200211302
-142.330.899.184.991
474.593.671.144.418
-103.729.791.587.256
11.870.975.602.054
-148.483.448.678.642
-111.006.560.160.739
0.602873113818105
0.393348983328672
-0.962148755968666
0.0184697158565785
-0.563883593450448
0.166315739043732
-108.186.987.396.044
-118.733.053.107.029
0.237743031994863
0.611036185140024
-0.79400692107665
0.278478683949076
-0.40622276355127
0.925398335411391
-119.614.998.561.647
-108.864.464.497.138
0.106042607339614
-0.937805020621083
-0.951761263569382
0.595660179931811
-262.322.849.033.463
206.484.177.835.207
-115.690.136.846.534
-0.971783998547422
-0.611926215083187
-0.674696186077007
-0.343071672001661
0.0120489059140767
-0.1383795628118
-0.749301027572427
-0.0329519337637752
-109.832.797.043.057
-117.865.313.545.005
-102.319.960.877.937
-0.63343703425983
-0.667677699369087
0.242137116993484
-0.237785307537331
-128.283.276.733.994
-0.319221905012263
-107.577.434.747.054
-113.649.959.159.528
-0.716757290883056
0.0050195699244691
-0.504182930963768
113.739.429.185.878
-0.794477152263173
-0.676009433293868
-0.129975959035785
-127.220.519.162.244
-0.755237196212232
362.224.545.199.573
-0.560259328998728
-0.250527785501192
-0.958991696990211
0.708498584924803
330.076.531.741.245
-0.937278704405174
-0.46112570699458
-135.080.551.053.675
-0.387951998968327
-0.132809676479671
0.686880241158722
-114.841.695.968.091
-0.198286402619942
-0.953424606143797
-0.831357405076732
227.625.252.139.011
434.870.014.838.875
-0.319775027225167
0.97886788111642
0.325925998526894
-0.110945361117234
-0.365480129339294
-0.288011496869506
-0.710975104172849
-18.080.416.080.161
-0.235072089058427
0.13336071414661
-0.481494207191557
-0.206654552341621
-0.71794143881947
-0.535845992452363
-0.64391059755181
0.205363138599996
0.0508051028472974
276.211.043.555.277
0.133938984226997
188.662.225.519.968
0.381866764736397
-0.827580442911865
-0.81926704434319
-117.447.429.123.239
-106.053.401.149.788
0.362718967032987
-0.607230297987153
-0.795842078874565
219.018.109.168.148
-0.960928566996128
0.695807217144514
29.531.433.869.023
0.449333749972229
0.936197534191918
0.00708092406711823
-10.470.414.190.653
-0.309764250493209
0.56233230889481
0.52203654340317
148.231.766.408.574
-207.880.984.858.141
0.296482095485587
-0.891179833788977
0.80794132077361
-0.552056351725605
-0.552867908673155
0.54325251003202
-0.542639108993608
-114.471.096.835.535
0.897529324353421
-0.0587815608245133
-107.951.863.367.864
-0.321172778596499
363.437.594.437.048
-0.947415480617462
-0.444699816200167
-0.565734426226205
-10.922.253.156.685
-0.459435345163184
-0.142489401411015
-0.97883583888393
-0.128394706781461
-0.844820295970723
-0.449188164589142
269.711.549.482.262
-0.833866835914459
0.798123612465257
-156.644.291.213.894
-0.858564280379805
-123.272.160.763.895
0.552974531733387
-108.885.968.599.948
-0.9105726069444
-0.467094210025088
-0.144975212059016
0.368273096383276
-102.227.305.524.387
-0.178894554646343
-0.956520150164327
0.993268299278574
-0.0751935665325974
-0.247427657865658
-104.209.423.708.647
-143.838.747.724.043
-0.868914642846923
-0.373821984452502
-0.95991791584591
-106.980.573.040.423
0.289510851234438
-0.978451460994812
0.0320063620547714
-104.991.171.481.537
222.634.733.938.379
0.0845744976638473
-0.268053463733876
0.849962268527854
0.0927671230687298
-100.214.059.100.251




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Gertrude Mary Cox' @ cox.wessa.net

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 1 seconds \tabularnewline
R Server & 'Gertrude Mary Cox' @ cox.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=153488&T=0

[TABLE]
[ROW][C]Summary of computational transaction[/C][/ROW]
[ROW][C]Raw Input[/C][C]view raw input (R code) [/C][/ROW]
[ROW][C]Raw Output[/C][C]view raw output of R engine [/C][/ROW]
[ROW][C]Computing time[/C][C]1 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Gertrude Mary Cox' @ cox.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=153488&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=153488&T=0

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Gertrude Mary Cox' @ cox.wessa.net



Parameters (Session):
Parameters (R input):
R code (references can be found in the software module):
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]
}
}
}
}
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)
}
(arm <- mean(x))
sqrtn <- sqrt(length(x))
(armse <- sd(x) / sqrtn)
(armose <- arm / armse)
(geo <- geomean(x))
(har <- harmean(x))
(qua <- quamean(x))
(win <- winmean(x))
(tri <- trimean(x))
(midr <- midrange(x))
midm <- array(NA,dim=8)
for (j in 1:8) midm[j] <- midmean(x,j)
midm
bitmap(file='test1.png')
lb <- win[,1] - 2*win[,2]
ub <- win[,1] + 2*win[,2]
if ((ylimmin == '') | (ylimmax == '')) plot(win[,1],type='b',main=main, xlab='j', pch=19, ylab='Winsorized Mean(j/n)', ylim=c(min(lb),max(ub))) else plot(win[,1],type='l',main=main, xlab='j', pch=19, ylab='Winsorized Mean(j/n)', ylim=c(ylimmin,ylimmax))
lines(ub,lty=3)
lines(lb,lty=3)
grid()
dev.off()
bitmap(file='test2.png')
lb <- tri[,1] - 2*tri[,2]
ub <- tri[,1] + 2*tri[,2]
if ((ylimmin == '') | (ylimmax == '')) plot(tri[,1],type='b',main=main, xlab='j', pch=19, ylab='Trimmed Mean(j/n)', ylim=c(min(lb),max(ub))) else plot(tri[,1],type='l',main=main, xlab='j', pch=19, ylab='Trimmed Mean(j/n)', ylim=c(ylimmin,ylimmax))
lines(ub,lty=3)
lines(lb,lty=3)
grid()
dev.off()
load(file='createtable')
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('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('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('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('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('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('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('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('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('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('midmean.htm', 'Midmean', 'click to view the definition of the Midmean')
mylabel <- paste(mymid,hyperlink('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('midmean.htm', 'Midmean', 'click to view the definition of the Midmean')
mylabel <- paste(mymid,hyperlink('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('midmean.htm', 'Midmean', 'click to view the definition of the Midmean')
mylabel <- paste(mymid,hyperlink('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('midmean.htm', 'Midmean', 'click to view the definition of the Midmean')
mylabel <- paste(mymid,hyperlink('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('midmean.htm', 'Midmean', 'click to view the definition of the Midmean')
mylabel <- paste(mymid,hyperlink('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('midmean.htm', 'Midmean', 'click to view the definition of the Midmean')
mylabel <- paste(mymid,hyperlink('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('midmean.htm', 'Midmean', 'click to view the definition of the Midmean')
mylabel <- paste(mymid,hyperlink('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('midmean.htm', 'Midmean', 'click to view the definition of the Midmean')
mylabel <- paste(mymid,hyperlink('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='mytable.tab')