Performs a median polish of two-way data (D.B. Baird).
||Maximum number of iterations; default 50|
||Tolerance for convergence; default 0.0001|
||Two-way data to be polished|
||Row definitions for a
||Column definitions for a
||Row effects removed from polished results|
||Column effects removed from polished results|
||Polished result in same format as
||Estimate of overall centre point|
MPOLISH performs a median polish of two-way data, supplied by the
DATA parameter. This can be a two-dimensional table, a matrix or a pointer of variates. Alternatively, it can be a single variate. The rows and columns are then defined by factors supplied by the
COLUMNS parameters, or by just the
COLUMNS parameter with the data valueS assumed to be sorted into row order within each column.
MAXCYCLE option sets a limit on the number of iterations. The
TOLERANCE option specifies the convergence criterion: convergence occurs when
ABS(1-SUM(ABS(OldPolish)) / SUM(ABS(NewPolish))) < TOLERANCE
The polished data can be saved by the
POLISH parameter, row effects by the
ROWEFFECTS parameter, column effects by the
COLEFFECTS parameter, and the overall centre point by the
Commands for: Calculations and manipulation.
CAPTION 'MPOLISH example'; STYLE=meta FACTOR [LEVELS=10; VALUES=8(1...10)] Block FACTOR [LABELS=!t(A,B,C,D,E,F,G,H); VALUES=(1...8)10] Treat "Log-Normally distributed effects & residuals" CALCULATE [SEED=130403] TMeans = EXP(GRNORMAL(8; 1; 2)) & [SEED=0] BMeans = EXP(GRNORMAL(10; 0.5; 1)) "Centre Effects around zero" CALCULATE TMeans,BMeans = TMeans,BMeans - MEDIAN(TMeans,BMeans) & Y = NEWLEVELS(Block;BMeans) + NEWLEVELS(Treat;TMeans) +\ EXP(GRNORMAL(80;1;0.5)) MPOLISH [TOLERANCE=0.0001] Y; ROWS=Block; COLUMNS=Treat;\ ROWEFFECTS=Blk_Effects; COLEFFECTS=Trt_Effects;\ POLISH=Residuals; CENTRE=Centre CAPTION 'True and estimated treatment effects'; STYLE=minor PRINT TMeans,Trt_Effects; FIELD=14; DECIMALS=1 CAPTION 'True and estimated block effects'; STYLE=minor PRINT BMeans,Blk_Effects; FIELD=14; DECIMALS=1 "Shade plot of residuals" TABULATE [CLASS=Block,Treat;PRINT=*] Residuals; MEANS=Res_Table DSHADE [TITLE='Residuals from MPOLISH'] Res_Table; PEN=!(4,2); NGROUPS=256