Library: | xplore |
See also: | var meanex |
Quantlet: | varex | |
Description: | an extended form of the var function - NaN and all values contained in excl are excluded from computation |
Usage: | varx = varex(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: | ||
varx | d1 x d2 x .. x d(j-1) x 1 x d(j+1) x .. x dn array |
library("xplore") randomize(666) x = rint(10 * uniform(3, 4)) x[2,1] = NaN x excl = 2 varex(x,excl)
Contents of x [1,] 3 9 4 1 [2,] +NAN 7 2 5 [3,] 1 9 5 2 Contents of varx [1,] 2 1.3333 0.5 8