replace missing standard deviation of a measure x by a percentage of x

replaceMissingSdByPercentage(sdX, x, perc = 0.2, minSdX = 0.7)

Arguments

sdX

numeric vector: with missing to be repalce

x

numeric vector of length(sdX): value form which percentage is computed

perc

numeric scalar: sdX = perc * x

minSdX

numeric scalar: minimum of sdX to be applied for low x

Value

sdX with non-finite values replaced.

Details

If either perc or inSdX is NA then only the other criterion is applied. If both are NA then all missings are set to NA.