1
votes

I have a dataset that has three variables which indicate a category of event at three time points (dispatch, beginning, end). I want to establish the number of cases where (a) the category is the same for all three time points (b) those which have changed at time point 2 (beginning) and (c) those which have changed at time point 3 (end).

Can anyone recommend some syntax or a starting point?

1
Could you describe how your data is stored/represented at each of these three time point variables? - Jignesh Sutar
Each time point has a string variable with either a numeric or alphanumeric value relating to each category. - TedAtmore
so, compute grpA=(dis=beg and beg=end). compute grpB=(dis<>beg and beg=end). - eli-k

1 Answers

0
votes

To measure a change (non-equivalent) against T0 (Time zero or in your case Dispatch), wouldn't you simply check for equivalence between respective variables?:

DATA LIST FREE  /ID T0 T1 T2.
BEGIN DATA.
1 1 1 1.
2 1 1 0.
3 1 0 1.
4 0 1 1.
5 1 0 0.
6 0 1 0.
7 0 0 1.
8 0 0 0.
END DATA.

COMPUTE ChangeT1=T0<>T1.
COMPUTE ChangeT2=T0<>T2.

To check all the values are the same across all three variables would be just (given you have string variables else otherwise you could do this differently if working with numeric variables such as Standard deviation):

COMPUTE CheckNoChange=T0=T1 & T0=T2.