[CODE]
* Example generated by -dataex-. For more info, type help dataex
clear
input str7 MCSID byte(GC_L_GCGD GC_L_GCDB)
"M10016V" 6 2
"M10016V" 0 -1
"M10016V" 6 2
"M10016V" 6 2
"M10016V" 0 -1
"M10016V" 0 -1
"M10016V" 0 -1
"M10016V" 0 -1
"M10016V" 5 2
"M10016V" 0 -1
"M10016V" 0 -1
"M10016V" 0 -1
"M10016V" 7 1
"M10016V" 0 -1
"M10016V" 0 -1
"M10016V" 7 2
"M10016V" 8 2
"M10016V" 0 -1
"M10016V" 0 -1
"M10016V" 7 2
"M10044Z" 6 2
"M10044Z" 6 2
"M10044Z" 0 -1
"M10044Z" 0 -1
From the dataset above I am trying to create a final figure based on scores for exam results. However, if GC_L_GCDB==1 then I need the corresponding score on GC_L_GCGD to double. How do I then total the score for each MCSID to create one final score for each MCSID such that it does not appear multiple times? Many thanks, JE Rea
* Example generated by -dataex-. For more info, type help dataex
clear
input str7 MCSID byte(GC_L_GCGD GC_L_GCDB)
"M10016V" 6 2
"M10016V" 0 -1
"M10016V" 6 2
"M10016V" 6 2
"M10016V" 0 -1
"M10016V" 0 -1
"M10016V" 0 -1
"M10016V" 0 -1
"M10016V" 5 2
"M10016V" 0 -1
"M10016V" 0 -1
"M10016V" 0 -1
"M10016V" 7 1
"M10016V" 0 -1
"M10016V" 0 -1
"M10016V" 7 2
"M10016V" 8 2
"M10016V" 0 -1
"M10016V" 0 -1
"M10016V" 7 2
"M10044Z" 6 2
"M10044Z" 6 2
"M10044Z" 0 -1
"M10044Z" 0 -1
From the dataset above I am trying to create a final figure based on scores for exam results. However, if GC_L_GCDB==1 then I need the corresponding score on GC_L_GCGD to double. How do I then total the score for each MCSID to create one final score for each MCSID such that it does not appear multiple times? Many thanks, JE Rea
Comment