Oh, no. HELL no.
I don't know what these jokers in Tucson wanted from their intended victim, but I know that they were willing to commit aggravated robbery to get it, and have little doubt that they would have stopped at murder. Fortunately for the resident that they were attacking, they were not equipped with a plan to accompany their carbine. Had they been, the homeowner likely couldn't have driven them off with merely a handgun. (Video of the robbery attempt here.)
Even while he had them on the run, the homeowner had trouble scoring decisive hits, only wounding one bad guy that we know of, and creating new business for windshield repairmen. It's hard to do good, fast, effective work with a pistol against multiple attackers under stress. But when out and about, a pistol is at most all you're likely to have on you.
In your own castle, though, you should be able to have access to something a bit more substantial.
Apparently much hay was made about the fact that a house across the street was hit by errant bullets. May I suggest a reliable old semi-automatic shotgun? Your local pawn shop and Gun Broker.com have a multitude of them for under $250, if you're not picky about the way it looks. Make sure that it's reliable, hack off the barrel to just over 18" (measure twice!!), and stick some high-visibility sights and a side-saddle on it. Don't be married to 12 gauge-- the semi-auto 20 gauge is the best-kept secret in home defense.
Practice your order of arms with it, and learn for good and all that you can't depend on the pattern spread to make hits; you need to center your targets. Once you can do that well, practice changing targets faster. Then faster. Then FASTER. The good news about a shotgun is that, if you center-punch your non-armored target at tennis court distances with even #6 bird shot field loads, that target has been effectively addressed. You may move on to the next target. If your adversary is wearing body armor, might I suggest holding on their face?
This is pragmatic, and admittedly bloody talk, I know. But we, here in the United States, must not accept home invasion. It is abhorrent. If a citizen is safe nowhere else in the world, he should feel safe in his own home. If your state does not allow you do effectively deal with the problem, ask yourself these two questions: (1) Are you actively campaigning to change this fact? (2) If you're not so active, then why, exactly, do you still live there?