As many of the responses here have acknowledged, there are a lot of factors. Some other ideas that come to mind, not things to necessarily answer here, just things to think about --
The recognition that once you squeeze the trigger you are responsible for the round, wherever it ends up, informs all of this.
1) What are you defending against? Are we talking about low to moderately motivated random criminal behavior by amateurs with bad judgement, somebody full of PCP who can absorb tremendous damage and keep coming, professional thieves who aren't necessarily looking for engagement, professional bad guys who are targeting you personally and know what they are doing, a vague feeling on the basis of limited evidence that something bad might happen and you aren't entirely prepared, or three apartments in your building were hit this week, two while the people were home? Are your personal circumstances such that there are -- or are not -- additional means of defense?
2) What is the layout of your building? Do you have a good chance of a clear shot at a reasonable distance without endangering innocent people? What could it look like when you are awake and home compared to being awakened from sleep? What do your sight lines look like and what is the backstop behind an intruder?
3) Are there other people in the apartment? Do you have kids? Are you reasonably confident that you could be awakened from a sound sleep and have the necessary control in an engagement to not make an irreversible mistake?
4) From the moment an attack is initiated to the time the assailant is too close for you to get a shot, how much time do you think you have?
Of course there are more, these are just ideas that come to mind based upon your scenario. We all have our own priorities, experiences, skills, and abilities, and we all reach our own conclusions. I think what ABN_CBT_ENGR has written here is worth taking under thoughtful consideration -- I did some unscientific tests with a short 20 gauge on different construction materials and found that the only load that would not penetrate two layers of 1/2" drywall on a wood-frame uninsulated interior wall was a #9 birdshot.
Would a leather jacket stop this? Maybe. Would being hit in the face with a couple of rounds of it break your focus? Maybe. Would it change the balance in the subsequent engagement? Probably.
Do I want to discover that my neighbor across the hall who heard something and was coming out to see what was going on took a couple of pellets of 00 from a 3" magnum load? Probably not.
Another factor is those rounds with the impressive numbers come with serious recoil, this does slow down your target acquisition for subsequent shots. After trying the low-recoil rounds I wouldn't use anything else in the scenario you describe, the second and third shot happen much faster and more accurately.
Just a few more thoughts, no expertise being claimed here.