Skip to content
Prev 304075 / 398503 Next

if then in R versus SAS

I would second Mark's recommendation to carefully work through "An Introduction to R" and to get Robert Muenchen's book.  If the variables otype, ocond, and entry are scalar values, then the translation from SAS to R is very straight-forward:

if(otype=='M' && ocond=='1' && entry=='a.Prop') MOC <- 1 else MOC <- 0


Hope this is helpful,

Dan

Daniel Nordlund
Bothell, WA USA