\name{Spread}
\alias{Spread}
\title{
  Compute InterQuartile Range, Maximum-Minimum, Standard Deviation and Median 
  Absolute Deviation
}
\description{
  Compute InterQuartile Range, Maximum-Mininum, Standard Deviation and Median 
  Absolute Deviation along the (posdim)th dimension of matrix var.
  The confidence interval is computed by bootstrapping.
}
\usage{
  Spread(var, posdim = 2, narm = T)
}
\arguments{
  \item{var}{
    Matrix of any number of dimensions up to 10.
  }
  \item{posdim}{
    Dimensions along which to compute IQR/MaxMin/SD/MAD.
  }
  \item{narm}{
    T/F if NA removed/kept before computation. Default = T.
  }
}
\details{
  Example:
  --------
  To compute IQR, Max-Min, SD & MAD accross members and start dates of var 
  output from load or ano, call:
    spread(var, posdim = c(2, 3), narm = T)
}
\value{
  Matrix with same dimensions as var except along the first posdim dimension 
  which is replaced by a length 3 dimension, corresponding to the lower limit 
  of the 95% confidence interval, the computed spread over the whole sample and 
  the upper limit of the 95% confidence interval for each point of the matrix 
  along all the other dimensions except for the other posdim dimensions which 
  disappear.
  \item{$iqr}{
    InterQuartile Range.
  }
  \item{$maxmin}{
    Maximum - minimum.
  }
  \item{$sd}{
    Standard deviation.
  }
  \item{$mad}{
    Median value.
  }
}
\author{
  History:
  1.0  -  2011-03  (V. Guemas, \email{vguemas@ic3.cat})  -  Original code
}
\keyword{datagen}
