Years ago, during the Myspace era, there was a study done on the empirical effects of prayer on sick people. The results showed that prayer made no difference in the health of the patient*. I thought the experiment silly since, as God is a person who decides things (not quite like humans do, but I imagine it’s similar) and not a vending machine, answers to prayers are not “input + process = output.” There’s no way of scientifically knowing if a prayer “worked” because there’s nothing to measure; it could’ve worked out the way God intended all along. Bodily death was not originally part of God’s plan but it’s the state of affairs we’re stuck with now—He has already worked it into the equation.
C.S. Lewis addressed the same issue in “The Efficacy of Prayer” from The World’s Last Night (full text here).
Thus in some measure the same doubt that hangs about the causal efficacy of our prayers to God hangs also about our prayers to man. Whatever we get we might have been going to get anyway. But only, as I say, in some measure. Our friend, boss, and wife may tell us that they acted because we asked; and we may know them so well as to feel sure, first that they are saying what they believe to be true, and secondly that they understand their own motives well enough to be right. But notice that when this happens our assurance has not been gained by the methods of science. We do not try the control experiment of refusing the raise or breaking off the engagement and then making our request again under fresh conditions. Our assurance is quite different in kind from scientific knowledge. It is born out of our personal relation to the other parties; not from knowing things about them but from knowing them.
Our assurance if we reach an assurance that God always hears and sometimes grants our prayers, and that apparent grantings are not merely fortuitous, can only come in the same sort of way. There can be no question of tabulating successes and failures and trying to decide whether the successes are too numerous to be accounted for by chance. Those who best know a man best know whether, when he did what they asked, he did it because they asked. I think those who best know God will best know whether He sent me to the barber’s shop because the barber prayed.
* The study was fundamentally flawed, at least as far as Christian doctrine is concerned. In some contexts it might be apropos for church elders to “lay hands” and pray for the sick. Granted, that isn’t the only way but the experiment would have been more comprehensive if that was a considered variable.