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 17:07:56 +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/t1482423056h5dvk3lojb24cz2.htm/, Retrieved Fri, 01 Nov 2024 03:36:22 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=302551, Retrieved Fri, 01 Nov 2024 03:36:22 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact170
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [Central Tendency] [CT2] [2016-12-22 16:07:56] [636d0f72197ac5e1dae4a755427db02a] [Current]
Feedback Forum

Post a new message
Dataseries X:
3120
3360
3540
2700
2580
3480
3240
4440
3000
3720
1620
3360
3180
2100
3000
2520
2160
1980
4020
3480
2750
2640
3420
2640
2520
2040
2820
1860
3780
2520
2580
2880
2100
3060
2100
3720
2940
2820
4980
2400
2940
2640
2340
1680
4140
2640
3600
3240
3120
2460
2940

































































































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
R Framework error message
Warning: there are blank lines in the 'Data' field.
Please, use NA for missing data - blank lines are simply
 deleted and are NOT treated as missing values.

\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
R Framework error message & 
Warning: there are blank lines in the 'Data' field.
Please, use NA for missing data - blank lines are simply
 deleted and are NOT treated as missing values.
\tabularnewline \hline \end{tabular} %Source: https://freestatistics.org/blog/index.php?pk=302551&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] [ROW]R Framework error message[/C][C]
Warning: there are blank lines in the 'Data' field.
Please, use NA for missing data - blank lines are simply
 deleted and are NOT treated as missing values.
[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=302551&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302551&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
R Framework error message
Warning: there are blank lines in the 'Data' field.
Please, use NA for missing data - blank lines are simply
 deleted and are NOT treated as missing values.







Central Tendency - Ungrouped Data
MeasureValueS.E.Value/S.E.
Arithmetic Mean2919.897.649429.9009
Geometric Mean2839.2
Harmonic Mean2758.77
Quadratic Mean3000.34
Winsorized Mean ( 1 / 17 )2910.3993.357831.1746
Winsorized Mean ( 2 / 17 )2905.6988.000133.0191
Winsorized Mean ( 3 / 17 )2905.6984.463834.4015
Winsorized Mean ( 4 / 17 )2891.5778.821936.6848
Winsorized Mean ( 5 / 17 )2891.5776.273237.9107
Winsorized Mean ( 6 / 17 )2891.5776.273237.9107
Winsorized Mean ( 7 / 17 )2875.172.841739.4705
Winsorized Mean ( 8 / 17 )2875.169.020241.6559
Winsorized Mean ( 9 / 17 )2896.2760.759247.6681
Winsorized Mean ( 10 / 17 )2908.0458.662249.5726
Winsorized Mean ( 11 / 17 )2908.0453.974653.8779
Winsorized Mean ( 12 / 17 )2908.0449.04159.2981
Winsorized Mean ( 13 / 17 )2908.0449.04159.2981
Winsorized Mean ( 14 / 17 )2875.143.207166.5423
Winsorized Mean ( 15 / 17 )2892.7540.387471.6249
Winsorized Mean ( 16 / 17 )2873.9237.21877.2185
Winsorized Mean ( 17 / 17 )2873.9230.873793.0865
Trimmed Mean ( 1 / 17 )2904.2988.375432.8631
Trimmed Mean ( 2 / 17 )2897.6681.923735.3702
Trimmed Mean ( 3 / 17 )2893.1177.489537.3355
Trimmed Mean ( 4 / 17 )2888.1473.605339.2382
Trimmed Mean ( 5 / 17 )2887.0771.010340.6571
Trimmed Mean ( 6 / 17 )2885.968.51242.1225
Trimmed Mean ( 7 / 17 )2884.5965.087844.3185
Trimmed Mean ( 8 / 17 )2886.5761.599146.8606
Trimmed Mean ( 9 / 17 )2888.7958.06549.7509
Trimmed Mean ( 10 / 17 )2887.4255.933851.622
Trimmed Mean ( 11 / 17 )2883.7953.457853.9452
Trimmed Mean ( 12 / 17 )2879.6351.375656.0505
Trimmed Mean ( 13 / 17 )2874.849.870257.6456
Trimmed Mean ( 14 / 17 )2869.1347.260660.7087
Trimmed Mean ( 15 / 17 )2868.145.531962.9909
Trimmed Mean ( 16 / 17 )2863.6843.563665.7358
Trimmed Mean ( 17 / 17 )2861.7641.499868.9585
Median2880
Midrange3300
Midmean - Weighted Average at Xnp2879.63
Midmean - Weighted Average at X(n+1)p2879.63
Midmean - Empirical Distribution Function2879.63
Midmean - Empirical Distribution Function - Averaging2879.63
Midmean - Empirical Distribution Function - Interpolation2879.63
Midmean - Closest Observation2879.63
Midmean - True Basic - Statistics Graphics Toolkit2879.63
Midmean - MS Excel (old versions)2879.63
Number of observations51

\begin{tabular}{lllllllll}
\hline
Central Tendency - Ungrouped Data \tabularnewline
Measure & Value & S.E. & Value/S.E. \tabularnewline
Arithmetic Mean & 2919.8 & 97.6494 & 29.9009 \tabularnewline
Geometric Mean & 2839.2 &  &  \tabularnewline
Harmonic Mean & 2758.77 &  &  \tabularnewline
Quadratic Mean & 3000.34 &  &  \tabularnewline
Winsorized Mean ( 1 / 17 ) & 2910.39 & 93.3578 & 31.1746 \tabularnewline
Winsorized Mean ( 2 / 17 ) & 2905.69 & 88.0001 & 33.0191 \tabularnewline
Winsorized Mean ( 3 / 17 ) & 2905.69 & 84.4638 & 34.4015 \tabularnewline
Winsorized Mean ( 4 / 17 ) & 2891.57 & 78.8219 & 36.6848 \tabularnewline
Winsorized Mean ( 5 / 17 ) & 2891.57 & 76.2732 & 37.9107 \tabularnewline
Winsorized Mean ( 6 / 17 ) & 2891.57 & 76.2732 & 37.9107 \tabularnewline
Winsorized Mean ( 7 / 17 ) & 2875.1 & 72.8417 & 39.4705 \tabularnewline
Winsorized Mean ( 8 / 17 ) & 2875.1 & 69.0202 & 41.6559 \tabularnewline
Winsorized Mean ( 9 / 17 ) & 2896.27 & 60.7592 & 47.6681 \tabularnewline
Winsorized Mean ( 10 / 17 ) & 2908.04 & 58.6622 & 49.5726 \tabularnewline
Winsorized Mean ( 11 / 17 ) & 2908.04 & 53.9746 & 53.8779 \tabularnewline
Winsorized Mean ( 12 / 17 ) & 2908.04 & 49.041 & 59.2981 \tabularnewline
Winsorized Mean ( 13 / 17 ) & 2908.04 & 49.041 & 59.2981 \tabularnewline
Winsorized Mean ( 14 / 17 ) & 2875.1 & 43.2071 & 66.5423 \tabularnewline
Winsorized Mean ( 15 / 17 ) & 2892.75 & 40.3874 & 71.6249 \tabularnewline
Winsorized Mean ( 16 / 17 ) & 2873.92 & 37.218 & 77.2185 \tabularnewline
Winsorized Mean ( 17 / 17 ) & 2873.92 & 30.8737 & 93.0865 \tabularnewline
Trimmed Mean ( 1 / 17 ) & 2904.29 & 88.3754 & 32.8631 \tabularnewline
Trimmed Mean ( 2 / 17 ) & 2897.66 & 81.9237 & 35.3702 \tabularnewline
Trimmed Mean ( 3 / 17 ) & 2893.11 & 77.4895 & 37.3355 \tabularnewline
Trimmed Mean ( 4 / 17 ) & 2888.14 & 73.6053 & 39.2382 \tabularnewline
Trimmed Mean ( 5 / 17 ) & 2887.07 & 71.0103 & 40.6571 \tabularnewline
Trimmed Mean ( 6 / 17 ) & 2885.9 & 68.512 & 42.1225 \tabularnewline
Trimmed Mean ( 7 / 17 ) & 2884.59 & 65.0878 & 44.3185 \tabularnewline
Trimmed Mean ( 8 / 17 ) & 2886.57 & 61.5991 & 46.8606 \tabularnewline
Trimmed Mean ( 9 / 17 ) & 2888.79 & 58.065 & 49.7509 \tabularnewline
Trimmed Mean ( 10 / 17 ) & 2887.42 & 55.9338 & 51.622 \tabularnewline
Trimmed Mean ( 11 / 17 ) & 2883.79 & 53.4578 & 53.9452 \tabularnewline
Trimmed Mean ( 12 / 17 ) & 2879.63 & 51.3756 & 56.0505 \tabularnewline
Trimmed Mean ( 13 / 17 ) & 2874.8 & 49.8702 & 57.6456 \tabularnewline
Trimmed Mean ( 14 / 17 ) & 2869.13 & 47.2606 & 60.7087 \tabularnewline
Trimmed Mean ( 15 / 17 ) & 2868.1 & 45.5319 & 62.9909 \tabularnewline
Trimmed Mean ( 16 / 17 ) & 2863.68 & 43.5636 & 65.7358 \tabularnewline
Trimmed Mean ( 17 / 17 ) & 2861.76 & 41.4998 & 68.9585 \tabularnewline
Median & 2880 &  &  \tabularnewline
Midrange & 3300 &  &  \tabularnewline
Midmean - Weighted Average at Xnp & 2879.63 &  &  \tabularnewline
Midmean - Weighted Average at X(n+1)p & 2879.63 &  &  \tabularnewline
Midmean - Empirical Distribution Function & 2879.63 &  &  \tabularnewline
Midmean - Empirical Distribution Function - Averaging & 2879.63 &  &  \tabularnewline
Midmean - Empirical Distribution Function - Interpolation & 2879.63 &  &  \tabularnewline
Midmean - Closest Observation & 2879.63 &  &  \tabularnewline
Midmean - True Basic - Statistics Graphics Toolkit & 2879.63 &  &  \tabularnewline
Midmean - MS Excel (old versions) & 2879.63 &  &  \tabularnewline
Number of observations & 51 &  &  \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302551&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]2919.8[/C][C]97.6494[/C][C]29.9009[/C][/ROW]
[ROW][C]Geometric Mean[/C][C]2839.2[/C][C][/C][C][/C][/ROW]
[ROW][C]Harmonic Mean[/C][C]2758.77[/C][C][/C][C][/C][/ROW]
[ROW][C]Quadratic Mean[/C][C]3000.34[/C][C][/C][C][/C][/ROW]
[ROW][C]Winsorized Mean ( 1 / 17 )[/C][C]2910.39[/C][C]93.3578[/C][C]31.1746[/C][/ROW]
[ROW][C]Winsorized Mean ( 2 / 17 )[/C][C]2905.69[/C][C]88.0001[/C][C]33.0191[/C][/ROW]
[ROW][C]Winsorized Mean ( 3 / 17 )[/C][C]2905.69[/C][C]84.4638[/C][C]34.4015[/C][/ROW]
[ROW][C]Winsorized Mean ( 4 / 17 )[/C][C]2891.57[/C][C]78.8219[/C][C]36.6848[/C][/ROW]
[ROW][C]Winsorized Mean ( 5 / 17 )[/C][C]2891.57[/C][C]76.2732[/C][C]37.9107[/C][/ROW]
[ROW][C]Winsorized Mean ( 6 / 17 )[/C][C]2891.57[/C][C]76.2732[/C][C]37.9107[/C][/ROW]
[ROW][C]Winsorized Mean ( 7 / 17 )[/C][C]2875.1[/C][C]72.8417[/C][C]39.4705[/C][/ROW]
[ROW][C]Winsorized Mean ( 8 / 17 )[/C][C]2875.1[/C][C]69.0202[/C][C]41.6559[/C][/ROW]
[ROW][C]Winsorized Mean ( 9 / 17 )[/C][C]2896.27[/C][C]60.7592[/C][C]47.6681[/C][/ROW]
[ROW][C]Winsorized Mean ( 10 / 17 )[/C][C]2908.04[/C][C]58.6622[/C][C]49.5726[/C][/ROW]
[ROW][C]Winsorized Mean ( 11 / 17 )[/C][C]2908.04[/C][C]53.9746[/C][C]53.8779[/C][/ROW]
[ROW][C]Winsorized Mean ( 12 / 17 )[/C][C]2908.04[/C][C]49.041[/C][C]59.2981[/C][/ROW]
[ROW][C]Winsorized Mean ( 13 / 17 )[/C][C]2908.04[/C][C]49.041[/C][C]59.2981[/C][/ROW]
[ROW][C]Winsorized Mean ( 14 / 17 )[/C][C]2875.1[/C][C]43.2071[/C][C]66.5423[/C][/ROW]
[ROW][C]Winsorized Mean ( 15 / 17 )[/C][C]2892.75[/C][C]40.3874[/C][C]71.6249[/C][/ROW]
[ROW][C]Winsorized Mean ( 16 / 17 )[/C][C]2873.92[/C][C]37.218[/C][C]77.2185[/C][/ROW]
[ROW][C]Winsorized Mean ( 17 / 17 )[/C][C]2873.92[/C][C]30.8737[/C][C]93.0865[/C][/ROW]
[ROW][C]Trimmed Mean ( 1 / 17 )[/C][C]2904.29[/C][C]88.3754[/C][C]32.8631[/C][/ROW]
[ROW][C]Trimmed Mean ( 2 / 17 )[/C][C]2897.66[/C][C]81.9237[/C][C]35.3702[/C][/ROW]
[ROW][C]Trimmed Mean ( 3 / 17 )[/C][C]2893.11[/C][C]77.4895[/C][C]37.3355[/C][/ROW]
[ROW][C]Trimmed Mean ( 4 / 17 )[/C][C]2888.14[/C][C]73.6053[/C][C]39.2382[/C][/ROW]
[ROW][C]Trimmed Mean ( 5 / 17 )[/C][C]2887.07[/C][C]71.0103[/C][C]40.6571[/C][/ROW]
[ROW][C]Trimmed Mean ( 6 / 17 )[/C][C]2885.9[/C][C]68.512[/C][C]42.1225[/C][/ROW]
[ROW][C]Trimmed Mean ( 7 / 17 )[/C][C]2884.59[/C][C]65.0878[/C][C]44.3185[/C][/ROW]
[ROW][C]Trimmed Mean ( 8 / 17 )[/C][C]2886.57[/C][C]61.5991[/C][C]46.8606[/C][/ROW]
[ROW][C]Trimmed Mean ( 9 / 17 )[/C][C]2888.79[/C][C]58.065[/C][C]49.7509[/C][/ROW]
[ROW][C]Trimmed Mean ( 10 / 17 )[/C][C]2887.42[/C][C]55.9338[/C][C]51.622[/C][/ROW]
[ROW][C]Trimmed Mean ( 11 / 17 )[/C][C]2883.79[/C][C]53.4578[/C][C]53.9452[/C][/ROW]
[ROW][C]Trimmed Mean ( 12 / 17 )[/C][C]2879.63[/C][C]51.3756[/C][C]56.0505[/C][/ROW]
[ROW][C]Trimmed Mean ( 13 / 17 )[/C][C]2874.8[/C][C]49.8702[/C][C]57.6456[/C][/ROW]
[ROW][C]Trimmed Mean ( 14 / 17 )[/C][C]2869.13[/C][C]47.2606[/C][C]60.7087[/C][/ROW]
[ROW][C]Trimmed Mean ( 15 / 17 )[/C][C]2868.1[/C][C]45.5319[/C][C]62.9909[/C][/ROW]
[ROW][C]Trimmed Mean ( 16 / 17 )[/C][C]2863.68[/C][C]43.5636[/C][C]65.7358[/C][/ROW]
[ROW][C]Trimmed Mean ( 17 / 17 )[/C][C]2861.76[/C][C]41.4998[/C][C]68.9585[/C][/ROW]
[ROW][C]Median[/C][C]2880[/C][C][/C][C][/C][/ROW]
[ROW][C]Midrange[/C][C]3300[/C][C][/C][C][/C][/ROW]
[ROW][C]Midmean - Weighted Average at Xnp[/C][C]2879.63[/C][C][/C][C][/C][/ROW]
[ROW][C]Midmean - Weighted Average at X(n+1)p[/C][C]2879.63[/C][C][/C][C][/C][/ROW]
[ROW][C]Midmean - Empirical Distribution Function[/C][C]2879.63[/C][C][/C][C][/C][/ROW]
[ROW][C]Midmean - Empirical Distribution Function - Averaging[/C][C]2879.63[/C][C][/C][C][/C][/ROW]
[ROW][C]Midmean - Empirical Distribution Function - Interpolation[/C][C]2879.63[/C][C][/C][C][/C][/ROW]
[ROW][C]Midmean - Closest Observation[/C][C]2879.63[/C][C][/C][C][/C][/ROW]
[ROW][C]Midmean - True Basic - Statistics Graphics Toolkit[/C][C]2879.63[/C][C][/C][C][/C][/ROW]
[ROW][C]Midmean - MS Excel (old versions)[/C][C]2879.63[/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=302551&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302551&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 Mean2919.897.649429.9009
Geometric Mean2839.2
Harmonic Mean2758.77
Quadratic Mean3000.34
Winsorized Mean ( 1 / 17 )2910.3993.357831.1746
Winsorized Mean ( 2 / 17 )2905.6988.000133.0191
Winsorized Mean ( 3 / 17 )2905.6984.463834.4015
Winsorized Mean ( 4 / 17 )2891.5778.821936.6848
Winsorized Mean ( 5 / 17 )2891.5776.273237.9107
Winsorized Mean ( 6 / 17 )2891.5776.273237.9107
Winsorized Mean ( 7 / 17 )2875.172.841739.4705
Winsorized Mean ( 8 / 17 )2875.169.020241.6559
Winsorized Mean ( 9 / 17 )2896.2760.759247.6681
Winsorized Mean ( 10 / 17 )2908.0458.662249.5726
Winsorized Mean ( 11 / 17 )2908.0453.974653.8779
Winsorized Mean ( 12 / 17 )2908.0449.04159.2981
Winsorized Mean ( 13 / 17 )2908.0449.04159.2981
Winsorized Mean ( 14 / 17 )2875.143.207166.5423
Winsorized Mean ( 15 / 17 )2892.7540.387471.6249
Winsorized Mean ( 16 / 17 )2873.9237.21877.2185
Winsorized Mean ( 17 / 17 )2873.9230.873793.0865
Trimmed Mean ( 1 / 17 )2904.2988.375432.8631
Trimmed Mean ( 2 / 17 )2897.6681.923735.3702
Trimmed Mean ( 3 / 17 )2893.1177.489537.3355
Trimmed Mean ( 4 / 17 )2888.1473.605339.2382
Trimmed Mean ( 5 / 17 )2887.0771.010340.6571
Trimmed Mean ( 6 / 17 )2885.968.51242.1225
Trimmed Mean ( 7 / 17 )2884.5965.087844.3185
Trimmed Mean ( 8 / 17 )2886.5761.599146.8606
Trimmed Mean ( 9 / 17 )2888.7958.06549.7509
Trimmed Mean ( 10 / 17 )2887.4255.933851.622
Trimmed Mean ( 11 / 17 )2883.7953.457853.9452
Trimmed Mean ( 12 / 17 )2879.6351.375656.0505
Trimmed Mean ( 13 / 17 )2874.849.870257.6456
Trimmed Mean ( 14 / 17 )2869.1347.260660.7087
Trimmed Mean ( 15 / 17 )2868.145.531962.9909
Trimmed Mean ( 16 / 17 )2863.6843.563665.7358
Trimmed Mean ( 17 / 17 )2861.7641.499868.9585
Median2880
Midrange3300
Midmean - Weighted Average at Xnp2879.63
Midmean - Weighted Average at X(n+1)p2879.63
Midmean - Empirical Distribution Function2879.63
Midmean - Empirical Distribution Function - Averaging2879.63
Midmean - Empirical Distribution Function - Interpolation2879.63
Midmean - Closest Observation2879.63
Midmean - True Basic - Statistics Graphics Toolkit2879.63
Midmean - MS Excel (old versions)2879.63
Number of observations51



Parameters (Session):
par1 = 12 ; par2 = -0.3 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 1 ; par8 = 2 ; par9 = 0 ; par10 = FALSE ;
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')