Recently, I submitted two manuscripts in two different journals. The papers are related, but their contents and purposes are different; and they also made use of different data sets. One of these manuscripts got accepted for publication, but one of the reviewers for the second manuscript informed the editor the paper was a duplicated paper that he or she recently reviewed. Evidently, that the same reviewer has reviewed my both manuscripts. However, the editor has asked me to clarify and provide evidence that my paper is not a duplicate. So how should I respond to convince the editor and reviewer that this paper is a legitimately separate work?
Just enumerate in which ways the two papers actually differ. As you already do in your question above: they differ in (i) contents, (ii) purposes, (iii) data sets.
The reviewer may of course still think that these differences are not large enough to warrant a second paper. In that case, you need to reconsider whether you actually think that the second paper can stand alone. But your first step is articulating how you think the two papers are different.
I have seen this happen a number of times. In the most recent situation, the authors cited a paper of theirs as being submitted and it had a very similar title to the manuscript we were considering. We asked the authors to clarify this and they said that the second manuscript was being reviewed by another journal and that it was different from the one we had. We asked the authors to provide us a confidential copy of the second manuscript so that we could be satisfied that the claims were accurate. They wrote informed the other journal that this was going to happen and sent us a confidential copy. We confirmed that the two manuscripts were different.
Why did we go through all this trouble? Well, copyright for the manuscript we were considering rests with us and it becomes problematic if a second manuscript that was substantially similar were to be published under different copyright.
What would have happened if we found that there was substantial overlap between the two manuscripts? We would have halted the manuscript preparation process and have asked the authors to clarify the situation. If the clarification is not satisfactory, then we would reject the manuscript outright.