nanmeanf - mean (ignoring Nan's) with a given frequency.

Calling Sequence

m=nanmean(val,fre)
m=nanmean(val,fre,'r') (or m=nanmean(val,fre,1))
m=nanmean(val,fre,'c') (or m=nanmean(val,fre,2))

Parameters

Description

This function returns in scalar m the mean of the values (ignoring the NANs) of a vector or matrix val , each counted with a frequency signaled by the corresponding values of the integer vector or matrix fre with the same type of val .

For a vector or matrix val , m=nanmeanf(val,fre) or m=nanmeanf(val,fre,'*') returns in scalar m the mean of all the entries (ignoring the NANs) of val , each value counted with the multiplicity indicated by the corresponding value of fre .

m=nanmeanf(val,fre,'r') (or, equivalently, m=nanmeanf(val,fre,1) ) returns in each entry of the row vector m of type 1xsize(val,'c') the mean of each column of val (ignoring the NANs), each value counted with the multiplicity indicated by the corresponding value of fre .

m=nanmeanf(val,fre,'c') (or, equivalently, m=nanmeanf(val,fre,2)) returns in each entry of the column vector m of type size(val,'c')x1 the mean of each row of val (ignoring the NANs), each value counted with the multiplicity indicated by the corresponding value of fre.

In Labostat, NAN values stand for missing values in tables.

Examples

Author

Bibliography

Wonacott, T.H. & Wonacott, R.J.; Introductory Statistics, fifth edition, J.Wiley & Sons, 1990.