Elyse Cottrell-Martin
2019-06-05 13:58:35 UTC
I have stacked data that I want to do a few things with.
For most people they have 3 sets of data (before, right after, and a follow up for an event) but some do not.
example:
ID# Date Score Time
1 01/02/2015 1.2 Before
1 01/03/2015 1.5 After
1 02/05/2015 1.3 Followup
2 01/06/2015 2.3 Before
2 01/08/2015 1.4 After
3 01/08/2015 1.5 Before
3 02/05/2015 0.2 After
3 02/10/2015 1.1 Followup
4 03/20/2015 0.3 Followup
4 03/25/2015 1.2 Followup
I only want to include people who have a before, after, AND followup data point (so in the above I would want to exclude ID#2 and ID#4 because they only have two (some people only have 1, and some people have 3 but they're not the right time code, for example they have an After and 2 followups). I have over 3000 lines of data though so I need syntax or how to do this using the GUI.
I think this is a two step process? Grouping IDs and then selecting cases? I know how to group data using aggregate, and I know how to select cases, but I can't seem to figure out how to combine these things.
Help is greatly appreciated, thank you.
For most people they have 3 sets of data (before, right after, and a follow up for an event) but some do not.
example:
ID# Date Score Time
1 01/02/2015 1.2 Before
1 01/03/2015 1.5 After
1 02/05/2015 1.3 Followup
2 01/06/2015 2.3 Before
2 01/08/2015 1.4 After
3 01/08/2015 1.5 Before
3 02/05/2015 0.2 After
3 02/10/2015 1.1 Followup
4 03/20/2015 0.3 Followup
4 03/25/2015 1.2 Followup
I only want to include people who have a before, after, AND followup data point (so in the above I would want to exclude ID#2 and ID#4 because they only have two (some people only have 1, and some people have 3 but they're not the right time code, for example they have an After and 2 followups). I have over 3000 lines of data though so I need syntax or how to do this using the GUI.
I think this is a two step process? Grouping IDs and then selecting cases? I know how to group data using aggregate, and I know how to select cases, but I can't seem to figure out how to combine these things.
Help is greatly appreciated, thank you.