Copy of a series using current or preceding non-missing value.
Syntax: @bridge(x)
x: series
Return: series
Returns a copy of series x with NAs replaced by the nearest preceding non-NA value.
This function is panel aware.
Examples
series x = @recode(@rnd < 0.5, na, @nrnd)
show @bridge(x)
The first line create a series x of NAs and IID standard normal variates. The second line shows x with @bridge applied. Note that NAs that appear at the beginning of the series do not get replaced.
Cross-references