In a longitudinal data, the frequency can be calculated by proc freq, but what if I want to know whether a subject has a particular response or not over the time in a long format. I think it will be necessary to have a summarized table. For example, I have a long format data like below. time id v1 1 1 no 2 1 no 3 1 yes 4 1 yes 1 2 no 2 2 no 3 2 no 4 2 no 1 3 yes 2 3 no 3 3 no 4 3 no from this table, I want to know how many subjects (id) have at least one response (yes) for v1 over time. In this case v1 is shown in id 1 and id 3 so that will be 2. Is it necessary to have a table like below to obtain the results? If it's the case, could you please let me know the programming code? Thanks. id total_v1 v1_freq 1 yes 2 2 no 0 3 yes 1
... View more