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 computationTue, 11 Nov 2014 10:13:28 +0000
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2014/Nov/11/t1415700824rvpusis4rudmh2w.htm/, Retrieved Sun, 19 May 2024 12:40:19 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=253532, Retrieved Sun, 19 May 2024 12:40:19 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact115
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [Central Tendency] [] [2014-11-11 10:13:28] [e4bec374a19c70fe4499af2adad38eb7] [Current]
Feedback Forum

Post a new message
Dataseries X:
12	141.138	-211.377
11	937.341	162.659
14	152.481	-124.809
12	150.281	-302.809
21	115.127	948.726
12	100.574	19.426
22	135.959	840.414
11	125.892	-158.916
10	122.824	-228.244
13	12.149	0.851045
10	103.608	-0.360797
8	103.704	-23.704
15	159.866	-0.986595
14	124.602	153.982
10	918.765	0.812351
14	139.172	0.082788
14	128.805	111.946
11	949.744	150.256
10	131.454	-314.541
13	124.543	0.545672
9.5	105.618	-106.176
14	154.217	-142.175
12	135.627	-156.273
14	152.666	-126.661
11	980.144	119.856
9	157.355	-673.545
11	113.339	-0.333925
15	132.443	175.566
14	119.653	203.471
13	15.624	-262.398
9	11.283	-228.299
15	153.829	-0.382925
10	110.193	-101.934
11	116.249	-0.624919
13	130.245	-0.0244947
8	123.451	-434.509
20	178.038	21.962
12	124.362	-0.436158
10	10.825	-0.825006
10	138.783	-387.832
9	121.031	-310.309
14	11.567	243.302
8	119.888	-398.882
14	157.186	-171.861
11	124.998	-149.985
13	156.977	-269.772
9	127.216	-372.161
11	122.556	-125.563
15	107.291	42.709
11	135.622	-256.223
10	116.047	-160.474
14	135.347	0.465273
18	160.389	196.112
14	14.97	-0.969953
11	157.728	-477.282
14.5	122.963	220.375
13	112.871	171.293
9	127.193	-371.927
10	143.838	-438.384
15	145.408	0.459231
20	188.951	110.493
12	132.863	-128.626
12	146.271	-262.707
14	144.153	-0.415303
13	132.605	-0.260549
11	152.569	-425.689
17	15.166	1.834
12	142.838	-228.382
13	130.122	-0.0121782
14	124.309	156.911
13	137.885	-0.788538
15	129.019	209.814
13	115.757	142.428
10	121.292	-212.916
11	129.773	-197.728
19	13.759	524.104
13	10.86	214.003
17	138.708	312.924
13	124.391	0.56089
9	145.563	-55.563
11	119.305	-0.93046
9	12.319	-331.904
12	114.909	0.509069
12	124.563	-0.45635
13	127.714	0.228635
13	122.681	0.731929
12	13.187	-118.701
15	14.855	0.145049
22	181.926	380.745
13	113.449	165.512
15	14.456	0.543997
13	120.116	0.988396
15	125.398	246.021
12.5	13.654	-115.405
11	110.184	-0.018439
16	144.586	154.144
11	12.676	-1.676
11	102.501	0.749892
10	123.622	-236.223
10	10.458	-0.458006
16	142.877	171.229
12	103.561	164.389
11	155.951	-45.951
16	11.978	402.201
19	168.223	217.768
11	111.261	-0.126093
16	121.355	386.451
15	16.806	-180.596
24	175.342	646.585
14	116.796	232.036
15	150.474	-0.047381
11	128.552	-185.524
15	152.404	-0.240378
12	102.276	177.236
10	104.631	-0.463133
14	142.199	-0.21987
13	13.592	-0.592045
9	134.878	-448.776
15	118.619	313.808
15	157.634	-0.76342
14	127.857	121.427
11	114.949	-0.494876
8	119.277	-392.769
11	121.947	-119.471
11	133.186	-231.862
8	980.878	-180.878
10	103.835	-0.38355
11	914.162	185.838
13	126.178	0.382216
11	138.653	-286.527
20	176.231	237.688
10	119.245	-192.453
15	132.517	174.833
12	122.706	-0.270601
14	109.564	304.365
23	165.868	641.317
14	136.122	0.387799
16	167.641	-0.764125
11	131.515	-215.154
12	14.496	-249.602
10	134.533	-345.325
14	112.137	278.629
12	121.737	-0.173696
12	120.432	-0.0432014
11	110.344	-0.0344116
12	111.519	0.848073
13	160.069	-300.692
11	14.286	-328.598
19	167.867	221.334
12	114.067	0.593313
17	131.264	387.359
9	11.727	-272.697
12	145.698	-256.981
19	16.863	213.703
18	140.142	39.858
15	14.456	0.543997
14	136.669	0.333075
11	914.162	185.838
9	130.389	-403.888
18	14.294	370.604
16	142.525	17.475
24	166.617	733.833
14	129.876	10.124
20	107.236	92.764
18	160.088	199.121
23	170.685	593.146
12	129.801	-0.980061
14	149.428	-0.942786
16	162.791	-0.279144
18	167.387	126.126
20	164.926	350.741
12	115.188	0.481168
12	163.932	-439.316
17	152.819	17.181
13	118.119	118.809
9	135.505	-455.051
16	17.123	-112.299
18	15.116	288.395
10	12.152	-215.201
14	153.335	-133.349
11	139.412	-294.118
9	145.203	-552.027
11	121.531	-11.531
10	124.822	-248.216
11	116.786	-0.678616
19	135.539	544.613
14	127.459	125.409
12	117.388	0.261203
14	154.374	-143.738
21	16.446	455.404
13	17.28	-427.998
10	12.729	-272.896
15	130.958	190.415
16	156.942	0.305804
14	126.469	13.531
12	145.393	-253.925
19	12.653	634.699
15	122.014	279.858
19	18.097	0.902978
13	136.674	-0.667428
17	168.144	0.185587
12	12.975	-0.975019
11	111.881	-0.188145
14	150.466	-104.664
11	125.027	-150.271
13	122.927	0.707313
12	122.738	-0.273833
15	126.633	233.671
14	142.349	-0.234915
12	110.274	0.972595
17	173.398	-0.339769
11	110.886	-0.0886144
18	14.498	350.203
13	157.527	-275.269
17	153.741	162.594
13	130.318	-0.0318217
11	101.025	0.897482
12	124.375	-0.437463
22	181.837	381.627
14	117.741	222.594
12	151.239	-312.392
12	12.46	-0.459963
17	159.396	106.037
9	127.954	-379.536
21	188.052	219.481
10	121.793	-217.932
11	107.521	0.247934
12	152.028	-320.275
23	181.077	489.235
13	156.749	-267.488
12	13.44	-143.997
16	174.711	-147.114
9	132.824	-428.241
17	13.229	3.771
9	118.697	-286.969
14	156.435	-164.354
17	15.286	171.396
13	150.802	-208.022
11	159.753	-497.526
12	156.601	-366.011
10	141.927	-419.274
19	186.739	0.326123
16	161.198	-0.119846
16	151.305	0.869543
14	117.377	226.227
20	159.219	407.807
15	142.517	0.748261
23	150.862	791.382
20	175.912	240.876
16	16.237	-0.236992
14	130.632	0.936757
17	140.477	295.233
11	142.027	-320.266
13	137.958	-0.795812
17	149.361	206.391
15	148.862	0.113795
21	163.634	463.661
18	17.471	0.529048
15	127.495	225.051
8	164.624	-846.241
12	137.517	-175.167
12	129.722	-0.972249
22	189.191	308.095
12	133.944	-13.944




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time0 seconds
R Server'Gwilym Jenkins' @ jenkins.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 & 0 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ jenkins.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=253532&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]0 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Gwilym Jenkins' @ jenkins.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=253532&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=253532&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 time0 seconds
R Server'Gwilym Jenkins' @ jenkins.wessa.net



Parameters (Session):
par1 = 6 ; par2 = Do not include Seasonal Dummies ; par3 = No Linear Trend ;
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')