I have a series of lists of this form: {1, 1, 1, 1, 0, 0, 1, 1}. I would like to perform a survival analysis on these lists. To do that, I need a code that would check each elements of these lists, do nothing as long as these are 1s, but as soon as one element is 0, it would change all the following elements to zero.
As an example, this code would transform the above list to {1, 1, 1, 1, 0, 0, 0, 0}. I can't seem to find a way to do this. Thanks.
