Last data update: 2014.03.03

R: Median polish multidimensional.
MedianPolishM.defaultR Documentation

Median polish multidimensional.

Description

Fits an additive model for multidimensional array, using Tukey's median polish procedure.

Usage

## Default S3 method:
MedianPolishM(data, eps = 0.01, maxiter = 10L,
  na.rm = TRUE, ...)

Arguments

data

object of class array, table, or matrix, see details.

eps

real number greater than 0, default 0.01. A tolerance for convergence: see Details

maxiter

the maximum number of iterations. Default 10.

na.rm

logical. If the data contains NA's. Default TRUE.

...

ignored.

Details

the model fitted is additive constant + dim_{1} + dim_{2} + cdots + dim_{n}. The algorithm works by alternately removing medians of dim_{1}, cdots, dim_{n}, and continues until the proportional reduction in the sum of absolute residuals is less than eps or until there have been maxiter iterations. If na.rm is FALSE the presence of any NA value in x will cause an error, otherwise NA values are ignored. MedianPolishM returns an object of class MedianPolishM (see below). There are a plotting method for this class, plot.MedianPolishM.

Value

An object of class medpolish with the following named components in a list:

residuals

the residuals.

overall

the fitted constant term.

effects

the fitted every dimensions effects of array multidimensional.

iter

number of iterations used in the range maxiter.

References

Hoaglin, D. C., Mosteller, F., & Tukey, J. W. (Eds.). (2011). Exploring data tables, trends, and shapes (Vol. 101). John Wiley & Sons.[link]

Examples

A<-MedianPolishM(UCBAdmissions, eps=0.1, maxiter=2, na.rm=TRUE)
plot(A)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(STMedianPolish)
Loading required package: maptools
Loading required package: sp
Checking rgeos availability: TRUE
Loading required package: reshape2
Loading required package: spacetime
Loading required package: zoo

Attaching package: 'zoo'

The following objects are masked from 'package:base':

    as.Date, as.Date.numeric

> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/STMedianPolish/MedianPolishM.default.Rd_%03d_medium.png", width=480, height=480)
> ### Name: MedianPolishM.default
> ### Title: Median polish multidimensional.
> ### Aliases: MedianPolishM.default
> 
> ### ** Examples
> 
> A<-MedianPolishM(UCBAdmissions, eps=0.1, maxiter=2, na.rm=TRUE)
> plot(A)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>