It depends on what you want and the circumstances for the book. But lets assume we're speaking equally, about a book that can easily be picked up by the big 5 publishers. You have the choice between, say, an average Random House contract and a self-publishing contract.
It's possible that, because your book is presumably well-written and good (hence the interest from Random House), you might be able to sell copies self-publishing as well. So here are a few advantages to taking the contract:
1) Money up front. Random House would pay you an advance (likely a fairly nice one, as your agent will be negotiating for you. I'm not talking tons, but I've seen in a few places that the average agented advance for a first-time author is $10,000. I'd take $10,000 in a heartbeat. That's over half what I make in a year.
2) You don't have to pay an expense up front. With self-publishing, you have to cover the art, editing, formatting, etc. You're starting out with a negative baseline. Editing alone can cost $1500, so you're looking at being out a fair amount of money. As we're assuming your book is stellar enough to rock Random House's socks, it might sell enough to make up the costs, maaaybe even earn what you would have gotten from the advance, but it's a gamble. You've spent a lot of money with no guarantee of making any of it back.
3) Random House will try to get your book into bookstores. Not everyone has ereaders. A lot of book sales still happen in bookstores, and you're giving up a fairly large proportion of potential sales if you go only print or only ebooks. A contract will almost certainly give you both. A self-publisher can perhaps have print books set up to be sold POD online, but getting them into more than a local bookstore or two won't happen.
4) You'll get help with promotion in various ways that might lead to higher sales.
5) If the book doesn't sell well, you've still got your advance. You were still paid for the work and effort that went into it. If you self-publish and don't sell well, you get nothing (and keeping in mind you started out in the red, this is harder than it looks).
6) You don't have to worry about the logistics of finding an artist, editor, formatter, blah blah blah, or doing constant promotions and marketing. Amanda Hocking had said she spent the majority of her time marketing and not writing as a self-publisher, which was one of her main reasons for taking a contract when offered. Just a lot less to stress about.
Now, there are reasons why it might be a good idea to self-publish. You think it sounds fun and don't mind if you don't sell many copies (you have to be okay with this because there is no guarantee and most don't). You just want to see if you can do it, or do it for the experience of it. You have enough money to spend on it without getting pinched if it goes badly. You have a book that you want to share with family and friends and making money/a career out of it isn't your goal. You have a book that's out of print that you'd like to make some extra money on. You have a book that is really great but got turned down because it fits into a weird marketing niche that a big publisher isn't willing to take a risk on.
That being said, the above assumes that the book is of publishable quality. One of the most important things you would need as a self-publisher is competent writing ability, and that's what a lot of people lack. If you do decide to self-publish, make sure you've done your homework and put in the time and effort into a quality product. That means going beyond having friends or family proofread it for you. It means getting beta readers who can tell you in an unbiased way whether or not your writing is up to speed. Put some parts into SYW. Make sure you have an editor who can help you with content, and preferably an editor to check for errors as well.
I've heard a lot of people say that they don't want to wait, but consider that it often takes years for someone to be good enough to ask people to spend money on their work. For many, writing is a long game. It's something we spend a lot of time perfecting and learning about.
Whenever I see someone who is in a hurry, my first thought is to slow down. Before you ever consider which path, you need to spend a lot of time doing the research on both forms to truly understand them as much as possible before you make decisions. I spent six months researching before I ever sent out my first query. It's important to understand how this industry works and what the expectations are so that you can present yourself professionally and have a chance at success.
Don't rush it. It's fun to have a book that you're excited about and you just want to see it out there on shelves RIGHT NOW, but this just isn't a world that moves fast. Even when self-publishing, if doing it right it's going to take time.
Considering this came from the Strategic forum, I'm going to guess that more research is a good place to start.