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, 17 Dec 2016 15:18:59 +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/17/t1481984389ad8o8401hqsj8hi.htm/, Retrieved Fri, 01 Nov 2024 03:34:32 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=300804, Retrieved Fri, 01 Nov 2024 03:34:32 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact124
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [Central Tendency] [Central Tendency ...] [2016-12-17 14:18:59] [153c3207812fd13fe5ceee3276565119] [Current]
Feedback Forum

Post a new message
Dataseries X:
200
2100
1250
2250
5850
4900
4700
3650
4950
10250
3850
3050
9150
8650
7350
7050
8150
9200
7050
11800
10950
13200
5250
14500
8000
8350
8750
7750
7300
9750
7100
9500
7050
7300
5900
8350
8050
4200
7300
6900
5300
9600
7900
4150
4900
8100
7200
6700
7350
4650
7100




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time1 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 time1 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300804&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]1 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=300804&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300804&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 time1 seconds
R ServerBig Analytics Cloud Computing Center







Central Tendency - Ungrouped Data
MeasureValueS.E.Value/S.E.
Arithmetic Mean6937.25396.43217.4992
Geometric Mean6044.83
Harmonic Mean3692.72
Quadratic Mean7482.21
Winsorized Mean ( 1 / 17 )6932.35380.7818.2056
Winsorized Mean ( 2 / 17 )6910.78354.60919.4885
Winsorized Mean ( 3 / 17 )6869.61339.28420.2473
Winsorized Mean ( 4 / 17 )6877.45310.37122.1588
Winsorized Mean ( 5 / 17 )6887.25286.19224.0652
Winsorized Mean ( 6 / 17 )6893.14277.46124.8437
Winsorized Mean ( 7 / 17 )6920.59265.9826.0192
Winsorized Mean ( 8 / 17 )6881.37255.526.933
Winsorized Mean ( 9 / 17 )6951.96237.84129.2294
Winsorized Mean ( 10 / 17 )6883.33222.06530.9969
Winsorized Mean ( 11 / 17 )6904.9210.09932.865
Winsorized Mean ( 12 / 17 )6834.31198.84234.3705
Winsorized Mean ( 13 / 17 )6847.06196.37134.868
Winsorized Mean ( 14 / 17 )6874.51172.36739.8829
Winsorized Mean ( 15 / 17 )6874.51167.43441.0581
Winsorized Mean ( 16 / 17 )7031.37133.4952.6735
Winsorized Mean ( 17 / 17 )7031.37128.00954.9289
Trimmed Mean ( 1 / 17 )6920.41356.04319.437
Trimmed Mean ( 2 / 17 )6907.45323.71621.338
Trimmed Mean ( 3 / 17 )6905.56301.10222.9343
Trimmed Mean ( 4 / 17 )6919.77279.88224.7239
Trimmed Mean ( 5 / 17 )6932.93265.26326.136
Trimmed Mean ( 6 / 17 )6944.87255.41227.1908
Trimmed Mean ( 7 / 17 )6956.76245.14228.3785
Trimmed Mean ( 8 / 17 )6964.29234.96429.6397
Trimmed Mean ( 9 / 17 )6980.3224.13531.1433
Trimmed Mean ( 10 / 17 )6985.48214.80432.5202
Trimmed Mean ( 11 / 17 )7003.45206.31833.9448
Trimmed Mean ( 12 / 17 )7020.37197.6435.521
Trimmed Mean ( 13 / 17 )7052187.67237.5763
Trimmed Mean ( 14 / 17 )7086.96172.18141.1598
Trimmed Mean ( 15 / 17 )7123.81157.87345.1235
Trimmed Mean ( 16 / 17 )7168.42134.1153.4517
Trimmed Mean ( 17 / 17 )7194.12115.43462.3223
Median7200
Midrange7350
Midmean - Weighted Average at Xnp6944.64
Midmean - Weighted Average at X(n+1)p6944.64
Midmean - Empirical Distribution Function6944.64
Midmean - Empirical Distribution Function - Averaging6944.64
Midmean - Empirical Distribution Function - Interpolation7101.92
Midmean - Closest Observation6944.64
Midmean - True Basic - Statistics Graphics Toolkit6944.64
Midmean - MS Excel (old versions)6944.64
Number of observations51

\begin{tabular}{lllllllll}
\hline
Central Tendency - Ungrouped Data \tabularnewline
Measure & Value & S.E. & Value/S.E. \tabularnewline
Arithmetic Mean & 6937.25 & 396.432 & 17.4992 \tabularnewline
Geometric Mean & 6044.83 &  &  \tabularnewline
Harmonic Mean & 3692.72 &  &  \tabularnewline
Quadratic Mean & 7482.21 &  &  \tabularnewline
Winsorized Mean ( 1 / 17 ) & 6932.35 & 380.78 & 18.2056 \tabularnewline
Winsorized Mean ( 2 / 17 ) & 6910.78 & 354.609 & 19.4885 \tabularnewline
Winsorized Mean ( 3 / 17 ) & 6869.61 & 339.284 & 20.2473 \tabularnewline
Winsorized Mean ( 4 / 17 ) & 6877.45 & 310.371 & 22.1588 \tabularnewline
Winsorized Mean ( 5 / 17 ) & 6887.25 & 286.192 & 24.0652 \tabularnewline
Winsorized Mean ( 6 / 17 ) & 6893.14 & 277.461 & 24.8437 \tabularnewline
Winsorized Mean ( 7 / 17 ) & 6920.59 & 265.98 & 26.0192 \tabularnewline
Winsorized Mean ( 8 / 17 ) & 6881.37 & 255.5 & 26.933 \tabularnewline
Winsorized Mean ( 9 / 17 ) & 6951.96 & 237.841 & 29.2294 \tabularnewline
Winsorized Mean ( 10 / 17 ) & 6883.33 & 222.065 & 30.9969 \tabularnewline
Winsorized Mean ( 11 / 17 ) & 6904.9 & 210.099 & 32.865 \tabularnewline
Winsorized Mean ( 12 / 17 ) & 6834.31 & 198.842 & 34.3705 \tabularnewline
Winsorized Mean ( 13 / 17 ) & 6847.06 & 196.371 & 34.868 \tabularnewline
Winsorized Mean ( 14 / 17 ) & 6874.51 & 172.367 & 39.8829 \tabularnewline
Winsorized Mean ( 15 / 17 ) & 6874.51 & 167.434 & 41.0581 \tabularnewline
Winsorized Mean ( 16 / 17 ) & 7031.37 & 133.49 & 52.6735 \tabularnewline
Winsorized Mean ( 17 / 17 ) & 7031.37 & 128.009 & 54.9289 \tabularnewline
Trimmed Mean ( 1 / 17 ) & 6920.41 & 356.043 & 19.437 \tabularnewline
Trimmed Mean ( 2 / 17 ) & 6907.45 & 323.716 & 21.338 \tabularnewline
Trimmed Mean ( 3 / 17 ) & 6905.56 & 301.102 & 22.9343 \tabularnewline
Trimmed Mean ( 4 / 17 ) & 6919.77 & 279.882 & 24.7239 \tabularnewline
Trimmed Mean ( 5 / 17 ) & 6932.93 & 265.263 & 26.136 \tabularnewline
Trimmed Mean ( 6 / 17 ) & 6944.87 & 255.412 & 27.1908 \tabularnewline
Trimmed Mean ( 7 / 17 ) & 6956.76 & 245.142 & 28.3785 \tabularnewline
Trimmed Mean ( 8 / 17 ) & 6964.29 & 234.964 & 29.6397 \tabularnewline
Trimmed Mean ( 9 / 17 ) & 6980.3 & 224.135 & 31.1433 \tabularnewline
Trimmed Mean ( 10 / 17 ) & 6985.48 & 214.804 & 32.5202 \tabularnewline
Trimmed Mean ( 11 / 17 ) & 7003.45 & 206.318 & 33.9448 \tabularnewline
Trimmed Mean ( 12 / 17 ) & 7020.37 & 197.64 & 35.521 \tabularnewline
Trimmed Mean ( 13 / 17 ) & 7052 & 187.672 & 37.5763 \tabularnewline
Trimmed Mean ( 14 / 17 ) & 7086.96 & 172.181 & 41.1598 \tabularnewline
Trimmed Mean ( 15 / 17 ) & 7123.81 & 157.873 & 45.1235 \tabularnewline
Trimmed Mean ( 16 / 17 ) & 7168.42 & 134.11 & 53.4517 \tabularnewline
Trimmed Mean ( 17 / 17 ) & 7194.12 & 115.434 & 62.3223 \tabularnewline
Median & 7200 &  &  \tabularnewline
Midrange & 7350 &  &  \tabularnewline
Midmean - Weighted Average at Xnp & 6944.64 &  &  \tabularnewline
Midmean - Weighted Average at X(n+1)p & 6944.64 &  &  \tabularnewline
Midmean - Empirical Distribution Function & 6944.64 &  &  \tabularnewline
Midmean - Empirical Distribution Function - Averaging & 6944.64 &  &  \tabularnewline
Midmean - Empirical Distribution Function - Interpolation & 7101.92 &  &  \tabularnewline
Midmean - Closest Observation & 6944.64 &  &  \tabularnewline
Midmean - True Basic - Statistics Graphics Toolkit & 6944.64 &  &  \tabularnewline
Midmean - MS Excel (old versions) & 6944.64 &  &  \tabularnewline
Number of observations & 51 &  &  \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300804&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]6937.25[/C][C]396.432[/C][C]17.4992[/C][/ROW]
[ROW][C]Geometric Mean[/C][C]6044.83[/C][C][/C][C][/C][/ROW]
[ROW][C]Harmonic Mean[/C][C]3692.72[/C][C][/C][C][/C][/ROW]
[ROW][C]Quadratic Mean[/C][C]7482.21[/C][C][/C][C][/C][/ROW]
[ROW][C]Winsorized Mean ( 1 / 17 )[/C][C]6932.35[/C][C]380.78[/C][C]18.2056[/C][/ROW]
[ROW][C]Winsorized Mean ( 2 / 17 )[/C][C]6910.78[/C][C]354.609[/C][C]19.4885[/C][/ROW]
[ROW][C]Winsorized Mean ( 3 / 17 )[/C][C]6869.61[/C][C]339.284[/C][C]20.2473[/C][/ROW]
[ROW][C]Winsorized Mean ( 4 / 17 )[/C][C]6877.45[/C][C]310.371[/C][C]22.1588[/C][/ROW]
[ROW][C]Winsorized Mean ( 5 / 17 )[/C][C]6887.25[/C][C]286.192[/C][C]24.0652[/C][/ROW]
[ROW][C]Winsorized Mean ( 6 / 17 )[/C][C]6893.14[/C][C]277.461[/C][C]24.8437[/C][/ROW]
[ROW][C]Winsorized Mean ( 7 / 17 )[/C][C]6920.59[/C][C]265.98[/C][C]26.0192[/C][/ROW]
[ROW][C]Winsorized Mean ( 8 / 17 )[/C][C]6881.37[/C][C]255.5[/C][C]26.933[/C][/ROW]
[ROW][C]Winsorized Mean ( 9 / 17 )[/C][C]6951.96[/C][C]237.841[/C][C]29.2294[/C][/ROW]
[ROW][C]Winsorized Mean ( 10 / 17 )[/C][C]6883.33[/C][C]222.065[/C][C]30.9969[/C][/ROW]
[ROW][C]Winsorized Mean ( 11 / 17 )[/C][C]6904.9[/C][C]210.099[/C][C]32.865[/C][/ROW]
[ROW][C]Winsorized Mean ( 12 / 17 )[/C][C]6834.31[/C][C]198.842[/C][C]34.3705[/C][/ROW]
[ROW][C]Winsorized Mean ( 13 / 17 )[/C][C]6847.06[/C][C]196.371[/C][C]34.868[/C][/ROW]
[ROW][C]Winsorized Mean ( 14 / 17 )[/C][C]6874.51[/C][C]172.367[/C][C]39.8829[/C][/ROW]
[ROW][C]Winsorized Mean ( 15 / 17 )[/C][C]6874.51[/C][C]167.434[/C][C]41.0581[/C][/ROW]
[ROW][C]Winsorized Mean ( 16 / 17 )[/C][C]7031.37[/C][C]133.49[/C][C]52.6735[/C][/ROW]
[ROW][C]Winsorized Mean ( 17 / 17 )[/C][C]7031.37[/C][C]128.009[/C][C]54.9289[/C][/ROW]
[ROW][C]Trimmed Mean ( 1 / 17 )[/C][C]6920.41[/C][C]356.043[/C][C]19.437[/C][/ROW]
[ROW][C]Trimmed Mean ( 2 / 17 )[/C][C]6907.45[/C][C]323.716[/C][C]21.338[/C][/ROW]
[ROW][C]Trimmed Mean ( 3 / 17 )[/C][C]6905.56[/C][C]301.102[/C][C]22.9343[/C][/ROW]
[ROW][C]Trimmed Mean ( 4 / 17 )[/C][C]6919.77[/C][C]279.882[/C][C]24.7239[/C][/ROW]
[ROW][C]Trimmed Mean ( 5 / 17 )[/C][C]6932.93[/C][C]265.263[/C][C]26.136[/C][/ROW]
[ROW][C]Trimmed Mean ( 6 / 17 )[/C][C]6944.87[/C][C]255.412[/C][C]27.1908[/C][/ROW]
[ROW][C]Trimmed Mean ( 7 / 17 )[/C][C]6956.76[/C][C]245.142[/C][C]28.3785[/C][/ROW]
[ROW][C]Trimmed Mean ( 8 / 17 )[/C][C]6964.29[/C][C]234.964[/C][C]29.6397[/C][/ROW]
[ROW][C]Trimmed Mean ( 9 / 17 )[/C][C]6980.3[/C][C]224.135[/C][C]31.1433[/C][/ROW]
[ROW][C]Trimmed Mean ( 10 / 17 )[/C][C]6985.48[/C][C]214.804[/C][C]32.5202[/C][/ROW]
[ROW][C]Trimmed Mean ( 11 / 17 )[/C][C]7003.45[/C][C]206.318[/C][C]33.9448[/C][/ROW]
[ROW][C]Trimmed Mean ( 12 / 17 )[/C][C]7020.37[/C][C]197.64[/C][C]35.521[/C][/ROW]
[ROW][C]Trimmed Mean ( 13 / 17 )[/C][C]7052[/C][C]187.672[/C][C]37.5763[/C][/ROW]
[ROW][C]Trimmed Mean ( 14 / 17 )[/C][C]7086.96[/C][C]172.181[/C][C]41.1598[/C][/ROW]
[ROW][C]Trimmed Mean ( 15 / 17 )[/C][C]7123.81[/C][C]157.873[/C][C]45.1235[/C][/ROW]
[ROW][C]Trimmed Mean ( 16 / 17 )[/C][C]7168.42[/C][C]134.11[/C][C]53.4517[/C][/ROW]
[ROW][C]Trimmed Mean ( 17 / 17 )[/C][C]7194.12[/C][C]115.434[/C][C]62.3223[/C][/ROW]
[ROW][C]Median[/C][C]7200[/C][C][/C][C][/C][/ROW]
[ROW][C]Midrange[/C][C]7350[/C][C][/C][C][/C][/ROW]
[ROW][C]Midmean - Weighted Average at Xnp[/C][C]6944.64[/C][C][/C][C][/C][/ROW]
[ROW][C]Midmean - Weighted Average at X(n+1)p[/C][C]6944.64[/C][C][/C][C][/C][/ROW]
[ROW][C]Midmean - Empirical Distribution Function[/C][C]6944.64[/C][C][/C][C][/C][/ROW]
[ROW][C]Midmean - Empirical Distribution Function - Averaging[/C][C]6944.64[/C][C][/C][C][/C][/ROW]
[ROW][C]Midmean - Empirical Distribution Function - Interpolation[/C][C]7101.92[/C][C][/C][C][/C][/ROW]
[ROW][C]Midmean - Closest Observation[/C][C]6944.64[/C][C][/C][C][/C][/ROW]
[ROW][C]Midmean - True Basic - Statistics Graphics Toolkit[/C][C]6944.64[/C][C][/C][C][/C][/ROW]
[ROW][C]Midmean - MS Excel (old versions)[/C][C]6944.64[/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=300804&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300804&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 Mean6937.25396.43217.4992
Geometric Mean6044.83
Harmonic Mean3692.72
Quadratic Mean7482.21
Winsorized Mean ( 1 / 17 )6932.35380.7818.2056
Winsorized Mean ( 2 / 17 )6910.78354.60919.4885
Winsorized Mean ( 3 / 17 )6869.61339.28420.2473
Winsorized Mean ( 4 / 17 )6877.45310.37122.1588
Winsorized Mean ( 5 / 17 )6887.25286.19224.0652
Winsorized Mean ( 6 / 17 )6893.14277.46124.8437
Winsorized Mean ( 7 / 17 )6920.59265.9826.0192
Winsorized Mean ( 8 / 17 )6881.37255.526.933
Winsorized Mean ( 9 / 17 )6951.96237.84129.2294
Winsorized Mean ( 10 / 17 )6883.33222.06530.9969
Winsorized Mean ( 11 / 17 )6904.9210.09932.865
Winsorized Mean ( 12 / 17 )6834.31198.84234.3705
Winsorized Mean ( 13 / 17 )6847.06196.37134.868
Winsorized Mean ( 14 / 17 )6874.51172.36739.8829
Winsorized Mean ( 15 / 17 )6874.51167.43441.0581
Winsorized Mean ( 16 / 17 )7031.37133.4952.6735
Winsorized Mean ( 17 / 17 )7031.37128.00954.9289
Trimmed Mean ( 1 / 17 )6920.41356.04319.437
Trimmed Mean ( 2 / 17 )6907.45323.71621.338
Trimmed Mean ( 3 / 17 )6905.56301.10222.9343
Trimmed Mean ( 4 / 17 )6919.77279.88224.7239
Trimmed Mean ( 5 / 17 )6932.93265.26326.136
Trimmed Mean ( 6 / 17 )6944.87255.41227.1908
Trimmed Mean ( 7 / 17 )6956.76245.14228.3785
Trimmed Mean ( 8 / 17 )6964.29234.96429.6397
Trimmed Mean ( 9 / 17 )6980.3224.13531.1433
Trimmed Mean ( 10 / 17 )6985.48214.80432.5202
Trimmed Mean ( 11 / 17 )7003.45206.31833.9448
Trimmed Mean ( 12 / 17 )7020.37197.6435.521
Trimmed Mean ( 13 / 17 )7052187.67237.5763
Trimmed Mean ( 14 / 17 )7086.96172.18141.1598
Trimmed Mean ( 15 / 17 )7123.81157.87345.1235
Trimmed Mean ( 16 / 17 )7168.42134.1153.4517
Trimmed Mean ( 17 / 17 )7194.12115.43462.3223
Median7200
Midrange7350
Midmean - Weighted Average at Xnp6944.64
Midmean - Weighted Average at X(n+1)p6944.64
Midmean - Empirical Distribution Function6944.64
Midmean - Empirical Distribution Function - Averaging6944.64
Midmean - Empirical Distribution Function - Interpolation7101.92
Midmean - Closest Observation6944.64
Midmean - True Basic - Statistics Graphics Toolkit6944.64
Midmean - MS Excel (old versions)6944.64
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')