Skip to content
Prev 169978 / 398506 Next

ifelse()

ifelse goes through your vector X, 1 element at a time, and if the element is greater than zero it returns a 1, otherwise, 0.  The resulting vector of 1s and 0s is assigned to Y

Hope this is helpful,

Dan

Daniel J. Nordlund
Washington State Department of Social and Health Services
Planning, Performance, and Accountability
Research and Data Analysis Division
Olympia, WA  98504-5204