I have an unbalanced panel of scores for a test done monthly at different points in time. I want to calculate the difference between scores in the first test done and in the last test. However the panel of observations is unbalanced and some respondents only had one test and hence nothing to difference with. For this ones, I want to maintain their singe score as their "difference" but will deal with this as the "differences" will be outliers. The MWE of the data is as below:

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input double pid int submitted float av_sc_check_in
 123456789 21967   3
1011608088 21843   4
1011608088 21864 4.5
1011608088 21886   4
1011608088 21927   4
end
format %td submitted
So I want a variable that will hold values for the difference between 4 and 4 = 0 for observation 1011608088. Note variable submitted is a date variable.