summary of the scores into one row
clear
input id question str10 d1 str10 d2 str10 d3 scores smoking
1 2.1 "23/01/2013" "05/02/2015" "14/02/2015" 4 1
1 2.2 "23/01/2013" "20/02/2015" "14/02/2015" 3 1
1 2.3 "23/01/2013" "08/03/2015" "14/02/2015" 4 1
1 2.4 "23/01/2013" "07/05/2015" "14/02/2015" 2 1
1 2.5 "23/01/2013" "17/08/2015" "14/02/2015" 0 1
1 2.1 "23/01/2013" "05/02/2015" "16/03/2015" 4 1
1 2.2 "23/01/2013" "20/02/2015" "16/03/2015" 3 1
1 2.3 "23/01/2013" "08/03/2015" "16/03/2015" 5 1
1 2.4 "23/01/2013" "07/05/2015" "16/03/2015" 5 1
1 2.5 "23/01/2013" "17/08/2015" "16/03/2015" 5 1
1 2.1 "23/01/2013" "05/02/2015" "17/04/2015" 4 0
1 2.2 "23/01/2013" "20/02/2015" "17/04/2015" 2 0
1 2.3 "23/01/2013" "08/03/2015" "17/04/2015" 2 0
1 2.4 "23/01/2013" "07/05/2015" "17/04/2015" 2 0
1 2.5 "23/01/2013" "17/08/2015" "17/04/2015" 0 0
2 2.1 "23/01/2013" "05/02/2015" "15/02/2015" 0 0
2 2.2 "23/01/2013" "20/02/2015" "15/02/2015" 2 0
2 2.3 "23/01/2013" "08/03/2015" "15/02/2015" 5 0
2 2.4 "23/01/2013" "07/05/2015" "15/02/2015" 5 0
2 2.5 "23/01/2013" "17/08/2015" "15/02/2015" 4 0
3 2.1 "23/01/2013" "05/02/2015" "16/02/2015" 2 1
3 2.2 "23/01/2013" "20/02/2015" "16/02/2015" 4 1
3 2.3 "23/01/2013" "08/03/2015" "16/02/2015" 5 1
3 2.4 "23/01/2013" "07/05/2015" "16/02/2015" 3 1
3 2.5 "23/01/2013" "17/08/2015" "16/02/2015" 3 1
3 2.1 "23/01/2013" "05/02/2015" "17/03/2015" 0 1
3 2.2 "23/01/2013" "20/02/2015" "17/03/2015" 1 1
3 2.3 "23/01/2013" "08/03/2015" "17/03/2015" 1 1
3 2.4 "23/01/2013" "07/05/2015" "17/03/2015" 2 1
3 2.5 "23/01/2013" "17/08/2015" "17/03/2015" 2 1
end
I need help with the above data set to get the summary scores for each call for each ID in one row.
ID1 has 3 calls, ID2 has one call, ID3 has 2 calls
d1 is programme enrol date
d3 is the interview date
The result will be one row for each ID as below.
e.g. ID1 has 3 calls. To get the summary scores for each interview date. (ID1 will have summaryscores for 3 calls, ID2 will have summaryscores for 1 calls, ID3 wil have summaryscores for 2 calls)
id call1 call2 call3 smoking
Thank your for your help.
0 Response to summary of the scores into one row
Post a Comment