The help file for mvencode states that
There are two problems with this.
First, the meaning of "data" might be misleading here. mvencode only checks whether the values are observed in the specified varlist -- not in the (entire) data(set). This should be clearly documented.
Second, mvencode fails to detect (some) non-integers stored in float precision. Here is a reproducible example, that should result in an error but does not:
Without this option [ override ], mvencode refuses to make the requested change if any of the numeric values are already used in the data.
There are two problems with this.
First, the meaning of "data" might be misleading here. mvencode only checks whether the values are observed in the specified varlist -- not in the (entire) data(set). This should be clearly documented.
Second, mvencode fails to detect (some) non-integers stored in float precision. Here is a reproducible example, that should result in an error but does not:
Code:
sysuse auto generate float x = 1.2 replace x = . in 1 mvencode x , mv(.=1.2) assert x == float(1.2)
Comment