Discontinue Rule with Dichotomized Data

Hi All,

I currently have a fairly large data set of dichotomized data point (1,0), denoting a right and wrong response.

I was wondering if there was a way to create a script that will start summing correct responses, but stop summing after four 0s in a row (which I would like to perform by case, so, row by row).

In the attached data set, to hopefully clarify the issue.

R Sample Data

The score for ID 1 should be 49, for ID 2, it should be 1, for ID 3, it should be 3, and for ID 4, a score of 0.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.