fillmthd()

Description:

Fill missing values according to the specified method.

Syntax:

A.fillmthd(m)

Note:

The function fills missing values in vector/ matrix A according to the specified method.

 

There are four methods for filling missing values:

1. Or “previous”: The previous non-missing value;

2. Or “next”: The next non-missing value;

3. Or “nearest”: The nearest non-missing value;

4. Or “linear”: The neighboring non-missing value’s linear interpolation – only a numeric value is valid; the double type (with the decimal point) is required for data entry.

Parameter:

A

A sequence

m

A method for filling missing values

Return value:

Sequence

Example:

 

A

 

1

=[1,,2,,2,,,5,,7,,8]

2

=A1.fillmthd("previous")

3

=[[1,2,,,5,,7,8],[2,3,4,,,,5,]]

 

4

=A3.fillmthd(1)

Return [[1,2,2,2,5,5,7,8],[2,3,4,4,4,4,5,5]].

5

=["one","two"," ","one"," "," "," ","two"," "]

 

6

=A5.fillmthd("next")

7

=[1.0,3.0,,,5.0,]

 

8

=A7.fillmthd("linear")