I do not have numbers but I am quite sure that in most cases the samurais killed themselves either when ordered to do so by the superiors or expected the superiors to order so. In fact the samurais in Japan enjoyed one privilege that the lower classes did not: they had the right to "honorably" commit suicide instead of being dishonorably executed. So instead of just execute a samurai, his superior would order him to kill himself. If he refused to do so, then the soldiers of the superior would come, capture the samurai and execute him.