Would someone please let me know what the equals function in WinBUGS return if one of the elements in the equals brackets is NA?
Specifically, I want to do the transformation:
for(i in 1:N){
newvar[i] <- 1*equals(oldvar[i],0) + 2*equals(oldvar[i],1.5) + 3*equals(oldvar[i],4) + 4*equals(oldvar[i],8)
}
and want to preserve NA's, so records with NA in oldvar[i] also has NA in newvar[i], but I am afraid that this tranformation turns NA's into 0's.
Any and all advice is much appreciated.
Trang