Skip to content
Prev 318276 / 398502 Next

creating variable that codes for the match/mismatch between two other variables

Hi
Well, why so complicated?

(mydat$Stimulus == mydat$Prediction)*1

gives you vector of 1 when there is match and 0 when there is no match. 

I do not understand your no prediction though. How is no prediction coded? If NA, the resulting vector will have NA in corresponding item too.

Regards
Petr