Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: xplore
See also: mean sumex

Quantlet: meanex
Description: an extended form of the mean function - NaN and all values contained in excl are excluded from computation

Usage: meanx = meanex(x{, excl {, s}})
Input:
x d1 x d2 x .. x dn array, n <= 7
excl a matrix containing values to be excluded
s integer (number of dimension, default = 1)
Output:
meanx d1 x d2 x .. x d(j-1) x 1 x d(j+1) x .. x dn array

Note:

Example:
library("xplore")
randomize(666)
x = rint(10 * uniform(2, 4))
x[2,1] = NaN
x
excl = 2
meanex(x,excl)

Result:
Contents of x
[1,]        3        1        7        4
[2,]     +NAN        9        9        2

Contents of meanx
[1,]        3        5        8        4



Author: K. Komorad, W. Haerdle, 20010420 license MD*Tech
(C) MD*TECH Method and Data Technologies, 05.02.2006