For each index of dimensions 0...*n*-2, these procedures
calculate estimates, variances, skewnesses, kurtoses, medians, ranges,
and mid-ranges on moments of the *n*-1 dimension.

procedure stat2( x : float, xmean : float, xvar : float, nptused : integer ) procedure stat_trim( x : float, ptrim : float, xmeant : float, xsdt : float ) procedure stat4( x : float, xmean : float, xvar : float, xskew : float, xkurt : float, nptused : integer ) procedure stat_medrng( x : float, xmedian : float, xmrange : float, xrange : float, nptused : integer )

*x*- Input array of any dimensionality. Missing values should be
indicated by
*x*@_FillValue. If*x*@_FillValue is not set, then the NCL default (-999) will be assumed. *xmean*- Mean of
*x*(output, same dimensions as*x*, with last dimension omitted). Space for this variable must be explicitly allocated by the user. *xmeant*- Mean of trimmed
*x*(output, same dimensions as*xmean*). Space for this variable must be explicitly allocated by the user. *xvar*- Sample variance of
*x*(output, same dimensions as*xmean*). Space for this variable must be explicitly allocated by the user. *xsdt*- Sample standard deviation of trimmed
*x*(output, same dimensions as*xmean*). Space for this variable must be explicitly allocated by the user. *xskew*- Coefficient of skewness (output, same dimensions as
*xmean*). Space for this variable must be explicitly allocated by the user. *xkurt*- Coefficient of kurtosis (output, same dimensions as
*xmean*). Space for this variable must be explicitly allocated by the user. *xmedian*- Median value of
*x*(output, same dimensions as*xmean*). Space for this variable must be explicitly allocated by the user. *xmrange*- Mid-range value of
*x*(output, same dimensions as*xmean*). Space for this variable must be explicitly allocated by the user. *xrange*- Range of
*x*(output, same dimensions as*xmean*). Space for this variable must be explicitly allocated by the user. *nptused*- Number of points used (output, same dimensions as
*xmean*). Space for this variable must be explicitly allocated by the user. *ptrim*- Scalar, portion of series to be trimmed (0. <=
*ptrim*< 1.). If*ptrim*= 0, then calculate the whole series mean and standard deviation. Otherwise, a minimum of two points will be trimmed.

`stat2` calculates the first two moments of the n-1 dimension
of *x* containing missing data. This function returns the sample
variance.

`stat_trim` calculates trimmed estimates of the first two
moments of the vectors in *x* containing missing data.

`stat4` calculates estimates of the first four moments (mean,
variance, skewness, and kurtosis) of the vectors in *x*
containing missing data. This function returns the sample
variance.

`stat_medrng` calculates median, range, and mid-range
of the vectors in *x* containing missing data.

begin ; ; Define a 3 x 2 x 2 array ; x = (/(/(/1.,2./),(/3.,4./)/),(/(/5.,6./),(/-999,8./)/),\ (/(/9.,10./),(/11.,-999/)/)/) x@_FillValue = -999 xmean = new((/3,2/),float) xvar = new((/3,2/),float) xskew = new((/3,2/),float) xkurt = new((/3,2/),float) npts = new((/3,2/),integer) stat2(x,xmean,xvar,npts) print(xmean) print(xvar) print(npts) stat4(x,xmean,xvar,xskew,xkurt,npts) print(xmean) print(xvar) print(xskew) print(xkurt) print(npts) end

NG4.1 Home, Index, Examples, Glossary, Feedback, Ref Contents, Ref WhereAmI?