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 computationThu, 22 Dec 2016 12:30:08 +0100
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2016/Dec/22/t14824063426y47k3v6b9a3zep.htm/, Retrieved Fri, 01 Nov 2024 03:40:55 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=302532, Retrieved Fri, 01 Nov 2024 03:40:55 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact154
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [Central Tendency] [Central Tendency] [2016-12-22 11:30:08] [da1cd5b79b9c78a074da6b069a6d8376] [Current]
Feedback Forum

Post a new message
Dataseries X:
4200
5800
7850
6000
4850
5100
7450
4900
4850
3450
4150
3600
11100
2650
4800
4300
1950
3500
5450
5450
4850
4800
3150
6550
6550
6900
5850
5300
5850
4700
3650
2750
10200
4800
6650
4400
2250
3900
5450
3450
3700
2400
4700
3850
6200
2350
4900
4150
2750
5550
3450




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R ServerBig Analytics Cloud Computing Center

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input view raw input (R code)  \tabularnewline
Raw Outputview raw output of R engine  \tabularnewline
Computing time2 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302532&T=0

[TABLE]
[ROW]
Summary of computational transaction[/C][/ROW] [ROW]Raw Input[/C] view raw input (R code) [/C][/ROW] [ROW]Raw Output[/C]view raw output of R engine [/C][/ROW] [ROW]Computing time[/C]2 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=302532&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302532&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 Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R ServerBig Analytics Cloud Computing Center







Central Tendency - Ungrouped Data
MeasureValueS.E.Value/S.E.
Arithmetic Mean4850.98253.92419.1041
Geometric Mean4547.23
Harmonic Mean4257.04
Quadratic Mean5172.61
Winsorized Mean ( 1 / 17 )4839.22244.40519.8
Winsorized Mean ( 2 / 17 )4750.98209.16522.714
Winsorized Mean ( 3 / 17 )4730.39201.82523.438
Winsorized Mean ( 4 / 17 )4706.86186.47925.2407
Winsorized Mean ( 5 / 17 )4692.16178.76126.2482
Winsorized Mean ( 6 / 17 )4680.39176.22426.5593
Winsorized Mean ( 7 / 17 )4735.29164.90828.7147
Winsorized Mean ( 8 / 17 )4727.45144.53732.7077
Winsorized Mean ( 9 / 17 )4692.16137.5834.105
Winsorized Mean ( 10 / 17 )4662.75132.13835.2869
Winsorized Mean ( 11 / 17 )4673.53130.17635.9016
Winsorized Mean ( 12 / 17 )4685.29123.8737.8244
Winsorized Mean ( 13 / 17 )4634.31110.58241.9083
Winsorized Mean ( 14 / 17 )4620.59103.6744.5703
Winsorized Mean ( 15 / 17 )4664.7196.001448.59
Winsorized Mean ( 16 / 17 )4680.3993.358750.1335
Winsorized Mean ( 17 / 17 )4713.7371.552565.8778
Trimmed Mean ( 1 / 17 )4782.65222.77121.4689
Trimmed Mean ( 2 / 17 )4721.28193.30124.4245
Trimmed Mean ( 3 / 17 )4704.44181.68625.8933
Trimmed Mean ( 4 / 17 )4694.19170.50827.5305
Trimmed Mean ( 5 / 17 )4690.24162.7928.8116
Trimmed Mean ( 6 / 17 )4689.74155.54530.1504
Trimmed Mean ( 7 / 17 )4691.89146.61532.0015
Trimmed Mean ( 8 / 17 )4682.86138.41833.8314
Trimmed Mean ( 9 / 17 )4674.24134.0534.8695
Trimmed Mean ( 10 / 17 )4670.97130.00835.9284
Trimmed Mean ( 11 / 17 )4672.41125.73937.1597
Trimmed Mean ( 12 / 17 )4672.22119.80938.9972
Trimmed Mean ( 13 / 17 )4670112.95341.3447
Trimmed Mean ( 14 / 17 )4676.09107.42543.5287
Trimmed Mean ( 15 / 17 )4685.71101.01546.3862
Trimmed Mean ( 16 / 17 )4689.4793.703850.0457
Trimmed Mean ( 17 / 17 )4691.1881.375557.6485
Median4800
Midrange6525
Midmean - Weighted Average at Xnp4628.85
Midmean - Weighted Average at X(n+1)p4672.22
Midmean - Empirical Distribution Function4672.22
Midmean - Empirical Distribution Function - Averaging4672.22
Midmean - Empirical Distribution Function - Interpolation4670
Midmean - Closest Observation4628.85
Midmean - True Basic - Statistics Graphics Toolkit4672.22
Midmean - MS Excel (old versions)4672.22
Number of observations51

\begin{tabular}{lllllllll}
\hline
Central Tendency - Ungrouped Data \tabularnewline
Measure & Value & S.E. & Value/S.E. \tabularnewline
Arithmetic Mean & 4850.98 & 253.924 & 19.1041 \tabularnewline
Geometric Mean & 4547.23 &  &  \tabularnewline
Harmonic Mean & 4257.04 &  &  \tabularnewline
Quadratic Mean & 5172.61 &  &  \tabularnewline
Winsorized Mean ( 1 / 17 ) & 4839.22 & 244.405 & 19.8 \tabularnewline
Winsorized Mean ( 2 / 17 ) & 4750.98 & 209.165 & 22.714 \tabularnewline
Winsorized Mean ( 3 / 17 ) & 4730.39 & 201.825 & 23.438 \tabularnewline
Winsorized Mean ( 4 / 17 ) & 4706.86 & 186.479 & 25.2407 \tabularnewline
Winsorized Mean ( 5 / 17 ) & 4692.16 & 178.761 & 26.2482 \tabularnewline
Winsorized Mean ( 6 / 17 ) & 4680.39 & 176.224 & 26.5593 \tabularnewline
Winsorized Mean ( 7 / 17 ) & 4735.29 & 164.908 & 28.7147 \tabularnewline
Winsorized Mean ( 8 / 17 ) & 4727.45 & 144.537 & 32.7077 \tabularnewline
Winsorized Mean ( 9 / 17 ) & 4692.16 & 137.58 & 34.105 \tabularnewline
Winsorized Mean ( 10 / 17 ) & 4662.75 & 132.138 & 35.2869 \tabularnewline
Winsorized Mean ( 11 / 17 ) & 4673.53 & 130.176 & 35.9016 \tabularnewline
Winsorized Mean ( 12 / 17 ) & 4685.29 & 123.87 & 37.8244 \tabularnewline
Winsorized Mean ( 13 / 17 ) & 4634.31 & 110.582 & 41.9083 \tabularnewline
Winsorized Mean ( 14 / 17 ) & 4620.59 & 103.67 & 44.5703 \tabularnewline
Winsorized Mean ( 15 / 17 ) & 4664.71 & 96.0014 & 48.59 \tabularnewline
Winsorized Mean ( 16 / 17 ) & 4680.39 & 93.3587 & 50.1335 \tabularnewline
Winsorized Mean ( 17 / 17 ) & 4713.73 & 71.5525 & 65.8778 \tabularnewline
Trimmed Mean ( 1 / 17 ) & 4782.65 & 222.771 & 21.4689 \tabularnewline
Trimmed Mean ( 2 / 17 ) & 4721.28 & 193.301 & 24.4245 \tabularnewline
Trimmed Mean ( 3 / 17 ) & 4704.44 & 181.686 & 25.8933 \tabularnewline
Trimmed Mean ( 4 / 17 ) & 4694.19 & 170.508 & 27.5305 \tabularnewline
Trimmed Mean ( 5 / 17 ) & 4690.24 & 162.79 & 28.8116 \tabularnewline
Trimmed Mean ( 6 / 17 ) & 4689.74 & 155.545 & 30.1504 \tabularnewline
Trimmed Mean ( 7 / 17 ) & 4691.89 & 146.615 & 32.0015 \tabularnewline
Trimmed Mean ( 8 / 17 ) & 4682.86 & 138.418 & 33.8314 \tabularnewline
Trimmed Mean ( 9 / 17 ) & 4674.24 & 134.05 & 34.8695 \tabularnewline
Trimmed Mean ( 10 / 17 ) & 4670.97 & 130.008 & 35.9284 \tabularnewline
Trimmed Mean ( 11 / 17 ) & 4672.41 & 125.739 & 37.1597 \tabularnewline
Trimmed Mean ( 12 / 17 ) & 4672.22 & 119.809 & 38.9972 \tabularnewline
Trimmed Mean ( 13 / 17 ) & 4670 & 112.953 & 41.3447 \tabularnewline
Trimmed Mean ( 14 / 17 ) & 4676.09 & 107.425 & 43.5287 \tabularnewline
Trimmed Mean ( 15 / 17 ) & 4685.71 & 101.015 & 46.3862 \tabularnewline
Trimmed Mean ( 16 / 17 ) & 4689.47 & 93.7038 & 50.0457 \tabularnewline
Trimmed Mean ( 17 / 17 ) & 4691.18 & 81.3755 & 57.6485 \tabularnewline
Median & 4800 &  &  \tabularnewline
Midrange & 6525 &  &  \tabularnewline
Midmean - Weighted Average at Xnp & 4628.85 &  &  \tabularnewline
Midmean - Weighted Average at X(n+1)p & 4672.22 &  &  \tabularnewline
Midmean - Empirical Distribution Function & 4672.22 &  &  \tabularnewline
Midmean - Empirical Distribution Function - Averaging & 4672.22 &  &  \tabularnewline
Midmean - Empirical Distribution Function - Interpolation & 4670 &  &  \tabularnewline
Midmean - Closest Observation & 4628.85 &  &  \tabularnewline
Midmean - True Basic - Statistics Graphics Toolkit & 4672.22 &  &  \tabularnewline
Midmean - MS Excel (old versions) & 4672.22 &  &  \tabularnewline
Number of observations & 51 &  &  \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302532&T=1

[TABLE]
[ROW][C]Central Tendency - Ungrouped Data[/C][/ROW]
[ROW][C]Measure[/C][C]Value[/C][C]S.E.[/C][C]Value/S.E.[/C][/ROW]
[ROW][C]Arithmetic Mean[/C][C]4850.98[/C][C]253.924[/C][C]19.1041[/C][/ROW]
[ROW][C]Geometric Mean[/C][C]4547.23[/C][C][/C][C][/C][/ROW]
[ROW][C]Harmonic Mean[/C][C]4257.04[/C][C][/C][C][/C][/ROW]
[ROW][C]Quadratic Mean[/C][C]5172.61[/C][C][/C][C][/C][/ROW]
[ROW][C]Winsorized Mean ( 1 / 17 )[/C][C]4839.22[/C][C]244.405[/C][C]19.8[/C][/ROW]
[ROW][C]Winsorized Mean ( 2 / 17 )[/C][C]4750.98[/C][C]209.165[/C][C]22.714[/C][/ROW]
[ROW][C]Winsorized Mean ( 3 / 17 )[/C][C]4730.39[/C][C]201.825[/C][C]23.438[/C][/ROW]
[ROW][C]Winsorized Mean ( 4 / 17 )[/C][C]4706.86[/C][C]186.479[/C][C]25.2407[/C][/ROW]
[ROW][C]Winsorized Mean ( 5 / 17 )[/C][C]4692.16[/C][C]178.761[/C][C]26.2482[/C][/ROW]
[ROW][C]Winsorized Mean ( 6 / 17 )[/C][C]4680.39[/C][C]176.224[/C][C]26.5593[/C][/ROW]
[ROW][C]Winsorized Mean ( 7 / 17 )[/C][C]4735.29[/C][C]164.908[/C][C]28.7147[/C][/ROW]
[ROW][C]Winsorized Mean ( 8 / 17 )[/C][C]4727.45[/C][C]144.537[/C][C]32.7077[/C][/ROW]
[ROW][C]Winsorized Mean ( 9 / 17 )[/C][C]4692.16[/C][C]137.58[/C][C]34.105[/C][/ROW]
[ROW][C]Winsorized Mean ( 10 / 17 )[/C][C]4662.75[/C][C]132.138[/C][C]35.2869[/C][/ROW]
[ROW][C]Winsorized Mean ( 11 / 17 )[/C][C]4673.53[/C][C]130.176[/C][C]35.9016[/C][/ROW]
[ROW][C]Winsorized Mean ( 12 / 17 )[/C][C]4685.29[/C][C]123.87[/C][C]37.8244[/C][/ROW]
[ROW][C]Winsorized Mean ( 13 / 17 )[/C][C]4634.31[/C][C]110.582[/C][C]41.9083[/C][/ROW]
[ROW][C]Winsorized Mean ( 14 / 17 )[/C][C]4620.59[/C][C]103.67[/C][C]44.5703[/C][/ROW]
[ROW][C]Winsorized Mean ( 15 / 17 )[/C][C]4664.71[/C][C]96.0014[/C][C]48.59[/C][/ROW]
[ROW][C]Winsorized Mean ( 16 / 17 )[/C][C]4680.39[/C][C]93.3587[/C][C]50.1335[/C][/ROW]
[ROW][C]Winsorized Mean ( 17 / 17 )[/C][C]4713.73[/C][C]71.5525[/C][C]65.8778[/C][/ROW]
[ROW][C]Trimmed Mean ( 1 / 17 )[/C][C]4782.65[/C][C]222.771[/C][C]21.4689[/C][/ROW]
[ROW][C]Trimmed Mean ( 2 / 17 )[/C][C]4721.28[/C][C]193.301[/C][C]24.4245[/C][/ROW]
[ROW][C]Trimmed Mean ( 3 / 17 )[/C][C]4704.44[/C][C]181.686[/C][C]25.8933[/C][/ROW]
[ROW][C]Trimmed Mean ( 4 / 17 )[/C][C]4694.19[/C][C]170.508[/C][C]27.5305[/C][/ROW]
[ROW][C]Trimmed Mean ( 5 / 17 )[/C][C]4690.24[/C][C]162.79[/C][C]28.8116[/C][/ROW]
[ROW][C]Trimmed Mean ( 6 / 17 )[/C][C]4689.74[/C][C]155.545[/C][C]30.1504[/C][/ROW]
[ROW][C]Trimmed Mean ( 7 / 17 )[/C][C]4691.89[/C][C]146.615[/C][C]32.0015[/C][/ROW]
[ROW][C]Trimmed Mean ( 8 / 17 )[/C][C]4682.86[/C][C]138.418[/C][C]33.8314[/C][/ROW]
[ROW][C]Trimmed Mean ( 9 / 17 )[/C][C]4674.24[/C][C]134.05[/C][C]34.8695[/C][/ROW]
[ROW][C]Trimmed Mean ( 10 / 17 )[/C][C]4670.97[/C][C]130.008[/C][C]35.9284[/C][/ROW]
[ROW][C]Trimmed Mean ( 11 / 17 )[/C][C]4672.41[/C][C]125.739[/C][C]37.1597[/C][/ROW]
[ROW][C]Trimmed Mean ( 12 / 17 )[/C][C]4672.22[/C][C]119.809[/C][C]38.9972[/C][/ROW]
[ROW][C]Trimmed Mean ( 13 / 17 )[/C][C]4670[/C][C]112.953[/C][C]41.3447[/C][/ROW]
[ROW][C]Trimmed Mean ( 14 / 17 )[/C][C]4676.09[/C][C]107.425[/C][C]43.5287[/C][/ROW]
[ROW][C]Trimmed Mean ( 15 / 17 )[/C][C]4685.71[/C][C]101.015[/C][C]46.3862[/C][/ROW]
[ROW][C]Trimmed Mean ( 16 / 17 )[/C][C]4689.47[/C][C]93.7038[/C][C]50.0457[/C][/ROW]
[ROW][C]Trimmed Mean ( 17 / 17 )[/C][C]4691.18[/C][C]81.3755[/C][C]57.6485[/C][/ROW]
[ROW][C]Median[/C][C]4800[/C][C][/C][C][/C][/ROW]
[ROW][C]Midrange[/C][C]6525[/C][C][/C][C][/C][/ROW]
[ROW][C]Midmean - Weighted Average at Xnp[/C][C]4628.85[/C][C][/C][C][/C][/ROW]
[ROW][C]Midmean - Weighted Average at X(n+1)p[/C][C]4672.22[/C][C][/C][C][/C][/ROW]
[ROW][C]Midmean - Empirical Distribution Function[/C][C]4672.22[/C][C][/C][C][/C][/ROW]
[ROW][C]Midmean - Empirical Distribution Function - Averaging[/C][C]4672.22[/C][C][/C][C][/C][/ROW]
[ROW][C]Midmean - Empirical Distribution Function - Interpolation[/C][C]4670[/C][C][/C][C][/C][/ROW]
[ROW][C]Midmean - Closest Observation[/C][C]4628.85[/C][C][/C][C][/C][/ROW]
[ROW][C]Midmean - True Basic - Statistics Graphics Toolkit[/C][C]4672.22[/C][C][/C][C][/C][/ROW]
[ROW][C]Midmean - MS Excel (old versions)[/C][C]4672.22[/C][C][/C][C][/C][/ROW]
[ROW][C]Number of observations[/C][C]51[/C][C][/C][C][/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302532&T=1

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

As an alternative you can also use a QR Code:  

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

Central Tendency - Ungrouped Data
MeasureValueS.E.Value/S.E.
Arithmetic Mean4850.98253.92419.1041
Geometric Mean4547.23
Harmonic Mean4257.04
Quadratic Mean5172.61
Winsorized Mean ( 1 / 17 )4839.22244.40519.8
Winsorized Mean ( 2 / 17 )4750.98209.16522.714
Winsorized Mean ( 3 / 17 )4730.39201.82523.438
Winsorized Mean ( 4 / 17 )4706.86186.47925.2407
Winsorized Mean ( 5 / 17 )4692.16178.76126.2482
Winsorized Mean ( 6 / 17 )4680.39176.22426.5593
Winsorized Mean ( 7 / 17 )4735.29164.90828.7147
Winsorized Mean ( 8 / 17 )4727.45144.53732.7077
Winsorized Mean ( 9 / 17 )4692.16137.5834.105
Winsorized Mean ( 10 / 17 )4662.75132.13835.2869
Winsorized Mean ( 11 / 17 )4673.53130.17635.9016
Winsorized Mean ( 12 / 17 )4685.29123.8737.8244
Winsorized Mean ( 13 / 17 )4634.31110.58241.9083
Winsorized Mean ( 14 / 17 )4620.59103.6744.5703
Winsorized Mean ( 15 / 17 )4664.7196.001448.59
Winsorized Mean ( 16 / 17 )4680.3993.358750.1335
Winsorized Mean ( 17 / 17 )4713.7371.552565.8778
Trimmed Mean ( 1 / 17 )4782.65222.77121.4689
Trimmed Mean ( 2 / 17 )4721.28193.30124.4245
Trimmed Mean ( 3 / 17 )4704.44181.68625.8933
Trimmed Mean ( 4 / 17 )4694.19170.50827.5305
Trimmed Mean ( 5 / 17 )4690.24162.7928.8116
Trimmed Mean ( 6 / 17 )4689.74155.54530.1504
Trimmed Mean ( 7 / 17 )4691.89146.61532.0015
Trimmed Mean ( 8 / 17 )4682.86138.41833.8314
Trimmed Mean ( 9 / 17 )4674.24134.0534.8695
Trimmed Mean ( 10 / 17 )4670.97130.00835.9284
Trimmed Mean ( 11 / 17 )4672.41125.73937.1597
Trimmed Mean ( 12 / 17 )4672.22119.80938.9972
Trimmed Mean ( 13 / 17 )4670112.95341.3447
Trimmed Mean ( 14 / 17 )4676.09107.42543.5287
Trimmed Mean ( 15 / 17 )4685.71101.01546.3862
Trimmed Mean ( 16 / 17 )4689.4793.703850.0457
Trimmed Mean ( 17 / 17 )4691.1881.375557.6485
Median4800
Midrange6525
Midmean - Weighted Average at Xnp4628.85
Midmean - Weighted Average at X(n+1)p4672.22
Midmean - Empirical Distribution Function4672.22
Midmean - Empirical Distribution Function - Averaging4672.22
Midmean - Empirical Distribution Function - Interpolation4670
Midmean - Closest Observation4628.85
Midmean - True Basic - Statistics Graphics Toolkit4672.22
Midmean - MS Excel (old versions)4672.22
Number of observations51



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,'Arithmetic Mean',header=TRUE)
a<-table.element(a,signif(arm,6))
a<-table.element(a, signif(armse,6))
a<-table.element(a,signif(armose,6))
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Geometric Mean',header=TRUE)
a<-table.element(a,signif(geo,6))
a<-table.element(a,'')
a<-table.element(a,'')
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Harmonic Mean',header=TRUE)
a<-table.element(a,signif(har,6))
a<-table.element(a,'')
a<-table.element(a,'')
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Quadratic Mean',header=TRUE)
a<-table.element(a,signif(qua,6))
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, mylabel,header=TRUE)
a<-table.element(a,signif(win[j,1],6))
a<-table.element(a,signif(win[j,2],6))
a<-table.element(a,signif(win[j,1]/win[j,2],6))
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, mylabel,header=TRUE)
a<-table.element(a,signif(tri[j,1],6))
a<-table.element(a,signif(tri[j,2],6))
a<-table.element(a,signif(tri[j,1]/tri[j,2],6))
a<-table.row.end(a)
}
a<-table.row.start(a)
a<-table.element(a, 'Median',header=TRUE)
a<-table.element(a,signif(median(x),6))
a<-table.element(a,'')
a<-table.element(a,'')
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Midrange',header=TRUE)
a<-table.element(a,signif(midr,6))
a<-table.element(a,'')
a<-table.element(a,'')
a<-table.row.end(a)
a<-table.row.start(a)
mymid <- 'Midmean'
mylabel <- paste(mymid,'Weighted Average at Xnp',sep=' - ')
a<-table.element(a,mylabel,header=TRUE)
a<-table.element(a,signif(midm[1],6))
a<-table.element(a,'')
a<-table.element(a,'')
a<-table.row.end(a)
a<-table.row.start(a)
mymid <- 'Midmean'
mylabel <- paste(mymid,'Weighted Average at X(n+1)p',sep=' - ')
a<-table.element(a,mylabel,header=TRUE)
a<-table.element(a,signif(midm[2],6))
a<-table.element(a,'')
a<-table.element(a,'')
a<-table.row.end(a)
a<-table.row.start(a)
mymid <- 'Midmean'
mylabel <- paste(mymid,'Empirical Distribution Function',sep=' - ')
a<-table.element(a,mylabel,header=TRUE)
a<-table.element(a,signif(midm[3],6))
a<-table.element(a,'')
a<-table.element(a,'')
a<-table.row.end(a)
a<-table.row.start(a)
mymid <- 'Midmean'
mylabel <- paste(mymid,'Empirical Distribution Function - Averaging',sep=' - ')
a<-table.element(a,mylabel,header=TRUE)
a<-table.element(a,signif(midm[4],6))
a<-table.element(a,'')
a<-table.element(a,'')
a<-table.row.end(a)
a<-table.row.start(a)
mymid <- 'Midmean'
mylabel <- paste(mymid,'Empirical Distribution Function - Interpolation',sep=' - ')
a<-table.element(a,mylabel,header=TRUE)
a<-table.element(a,signif(midm[5],6))
a<-table.element(a,'')
a<-table.element(a,'')
a<-table.row.end(a)
a<-table.row.start(a)
mymid <- 'Midmean'
mylabel <- paste(mymid,'Closest Observation',sep=' - ')
a<-table.element(a,mylabel,header=TRUE)
a<-table.element(a,signif(midm[6],6))
a<-table.element(a,'')
a<-table.element(a,'')
a<-table.row.end(a)
a<-table.row.start(a)
mymid <- 'Midmean'
mylabel <- paste(mymid,'True Basic - Statistics Graphics Toolkit',sep=' - ')
a<-table.element(a,mylabel,header=TRUE)
a<-table.element(a,signif(midm[7],6))
a<-table.element(a,'')
a<-table.element(a,'')
a<-table.row.end(a)
a<-table.row.start(a)
mymid <- 'Midmean'
mylabel <- paste(mymid,'MS Excel (old versions)',sep=' - ')
a<-table.element(a,mylabel,header=TRUE)
a<-table.element(a,signif(midm[8],6))
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,signif(length(x),6))
a<-table.element(a,'')
a<-table.element(a,'')
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable.tab')