Dear All, I have this data set.
Code:
* Example generated by -dataex-. For more info, type help dataex
clear
input str10 P float(t x)
"A" 0          2
"B" 1  10.333333
"C" 0          1
"C" 1         -5
end
There are two observations when P="C" (with t=0 and 1). This is what I need, and don't need to do anything.

However, when P="A", only one observation is available (t=0), I need another observation to be exactly the same as the (t=0) observation but with t=1, and x=0.

Similarly, when P="B", only one observation is available (t=1), I need another observation to be exactly the same as the (t=1) observation but with t=0, and x=0.

The desired result is something like
Code:
* Example generated by -dataex-. For more info, type help dataex
clear
input str10 P float(t x z)
"A" 0          2  1
"A" 1          0  1
"B" 0  0  2
"B" 1  10.333333  2
"C" 0          1  3
"C" 1         -5  4
end
Any suggestions are highly appreciated.