I have a dataset consisting of repeated measures(4 waves), one data point per row. These data are from a longitudinal study, and measured two different tools based on the study subjects age; therefore, at the moment, not every ID has assessed using one measuring tool at wave one.
the data looks like
subject_id wave AgeinMonths BITSEA CBCL
1 1 wave1 10 7 <NA>
2 1 wave2 38 Not applicable 66
3 1 wave3 56 Not applicable 73
4 1 wave4 76 Not applicable 87
5 2 wave1 38 Not applicable 57
6 2 wave2 46 Not applicable 63
7 2 wave3 66 Not applicable 77
8 3 wave1 23 27 <NA>
9 3 wave2 41 Not applicable 38
10 4 wave1 35 28 <NA>
11 4 wave2 56 Not applicable 70
12 4 wave3 76 Not applicable 77
13 4 wave4 98 Not applicable 97
14 5 wave1 36 Not applicable 66
15 5 wave2 54 Not applicable 45
16 5 wave3 74 Not applicable 67
17 5 wave4 92 Not applicable 68
18 6 wave1 38 Not applicable 54
19 6 wave2 58 Not applicable 63
20 7 wave1 11 23 Not applicable
21 7 wave2 36 Not applicable 45
22 7 wave3 49 Not applicable 51
23 7 wave4 69 Not applicable 65
24 8 wave1 17 26 Not applicable
25 8 wave2 37 Not applicable 45
26 8 wave3 55 Not applicable 57
27 9 wave1 36 Not applicable 56
28 10 wave1 36 Not applicable 45
29 10 wave2 54 Not applicable 55
30 10 wave3 72 Not applicable 65
31 10 wave4 90 Not applicable 71
So,
subject 1,4,7 has four repeated measures BITSEA at wave 1 and 2,3 and 4 CBCL
subject 5 & 7 have four repeated measures CBCL at all waves
I want to be able to extract data points involved in all repeated measures. I wish to obtain those with four repeated measures using BITSEA if subjects are between 9 and 35 months else CBCL at wave 1.
The background of my question is to create a data frame for those who have measured in all waves subsetting subjects measured at wave 1 using either BITSEA or CBCL.
Any thoughts, please?