So how come when Hamlet is pondering whether "to be or not to be" he thinks it's relevant to ask "whether 'tis nobler in the mind to suffer / The slings and arrows of outrageous fortune, / Or to take arms against a sea of troubles / And by opposing end them?" It seems to me he should just be trying to figure our which option is nobler, not which is "nobler in the mind." Putting the question his way introduces a pretty strange circularity into the debate, since it would appear that he's trying to make up his mind about what the contents of his own mind are. Oh well.
There are some excellent comments on this, many as to what word "nobler" modifies. Here's my two cents:
Hamlet's a student, and enjoys the life of the mind more than the other kind. He prefers the company of his school chum Horatio to anyone else's; when Claudius wants to bamboozle him, he calls in a couple of other philosophy nerds. He doesn't seem to have much of a physical relationship with Ophelia -- the awful Kenneth Branagh version's flashbacks notwithstanding. He writes her nice letters and trades gifts with her. (Polonius worries about it, but he's a sentimental idiot, and seems to be in the play only to represent a sentimental point of view -- which is also why he gets killed first, as I'll explain in a minute.)
Hamlet bitches plenty about the unseemliness of the whole affair -- sex, food, ugh -- but for most of the first act, he doesn't mention the fact that he has a pretty good claim to the throne of Denmark -- not even to observe that he'd be cut to pieces if he challenged Claudius for it.
Prior to the Ghost's revelation to him, he actually plays along with the whole royal scam, though on his own snarky terms. Our image of Hamlet is a little skewed by his great poetry. If the Ghost hadn't showed, no doubt he'd have made a few more catty remarks and then fucked off to Wittenberg. He might even have stuffed himself on the "funeral baked meats that did coldly furnish forth the marriage table" -- he does look fat to someone at the final duel, I recall.
But then, the Ghost. The Ghost is a pretty odd device for Shakespeare to start a play with. He went out of his way to show us other people seeing the Ghost before Hamlet did -- so we wouldn't think it was a private hallucination. Of course, the Ghost only appears to the others -- to Hamlet, it speaks. The Ghost is something men of good will and clear eyesight might see, but it takes a Hamlet to divine meaning from it.
The Ghost changes everything. Hamlet's warning to his friends of an impending "antic disposition" is, I think, a double blind. He won't be faking -- but he wants them to think he will be, so that they will stay out of his way. He has just had a life-changing experience, and he doesn't want any of his buddies second-guessing him or trying to stop him as he visibly suffers the sea-change the Ghost has wrought on him. He knows that even Horatio will be amazed at what he sees him doing ("There are more things in heaven and earth..."), and he wants them to step off -- for he has found a new kingdom now, and it is the Kingdom of Death ("Shall I couple hell?").
They won't understand. They don't. It's amazing how little Horatio understands. Hamlet's sort of embarrassing testimonial to him is, I think, an indirect caution: he's saying, look, you're a nice guy, I like you, so don't bother your noble little head too much about this -- later I'll find a skull, and we can bullshit again, though my part of the conversation may seem a little harsher than usual. When Hamlet is dying, Horatio wants to die, too -- Hamlet stops him and tells him to instead "draw your breath in pain to tell my story." I don't think Hamlet, who a little while earlier was rapping about Caesar as a gob of mud, wants immortality or even fame so much as to keep anyone he cares about from following his example.
Because Hamlet's struggle is private, for all the political implications. His behavior suggests an extraordinarily intelligent suicide: first he puts his close friends at arm's length -- not rejecting them outright, just making sure they don't get in the way. Then he blows off his girlfriend. His first direct kill is the author (first as paternal instructor, then as political manipulator) of Ophelia's childish love-games, Polonius. Hamlet says he thought Polonius was Claudius, but there are no accidents in Shakespeare. It's as if he had to stop up the wellsprings of his own humanity before he could get down to some real blood-eyed killing.
He is about to embark on this crucial phase of his elaborate serial-murder/suicide when he gives the speech in question. He talks about conscience, but what is that to Hamlet? What action is he seen to take that is not all about naked self-interest (not interest in his own life, but in his own mind's life, his ideas), but for the offhand shielding of Horatio? (Hamlet only spares his mother because the Ghost commands him to.)
A lot of people think the "To be or not to be" speech means Hamlet is unsure that he's doing the right thing -- that he'll be damned ("What dreams may come") if he goes through with the self-slaughter. The question seems to be answered later, when he takes a cue from a battle march -- "the imminent death of ten thousand men" (I am quoting from imperfect memory here) for a meaningless patch of land -- and declares "my thoughts be bloody or be nothing worth." But this is not so much an answer as an excuse. He looks for excuses everywhere, even in a player's tears for a legendary Hecuba. Hamlet never answers the big questions for us -- only for himself. He even talks of a "spur" for his "dull revenge." Dull like a knife? Or dull like uninteresting -- something so dull he has to talk himself into it?
To even use these sorts of definitions, of course, is reductive. Hamlet speaks verse, mostly. His flights of poetry have intellectual integrity of their own -- but, unlike the poems of jealousy and ambition spoken by Othello and Macbeth, they are very difficult for those of us out here in the audience to apply to the smaller versions of those grand passions from which we ourselves suffer. To what is "To be or not to be" or "O that this too too solid flesh would melt" or "How all occasions do inform against me" applicable in our own lives except suicide?
When I studied drama, we were told that an actor can't just muck around with feelings -- one had to find an intention for actions (and speech is an action) that directed them, gave them focus. If you think of Hamlet as someone who wants to avenge his father, he seems pretty ridiculous (There's Claudius! I could kill him now! But he's praying! Naah -- that's not vengeful enough!). If you think of him as someone who wants to kill himself -- not in the small, pathetic way a world-weary clerk might, but in the fullest, most exalted manner of a world-class tragic hero -- it's a bit easier.
As regards Yglesias' question, I think the nobility refers to the suffering. Hamlet is laying the groundwork for his final exit, and the job is always mentally harder in the planning stages than at the coup de grace. Nobility is a real thing to the student prince -- but, like all high standards, something that can prove most fluid in meaning when you have a fixed goal in mind and the justification just isn't lining up right with the intent. A few scenes earlier, the Everlasting, Hamlet freely admitted, fixed his canon 'gainst self-slaughter, now, it's Conscience doth make cowards of us all -- and conscience seems to consist of worries over bad dreams that might never go away: a child's vision of hell. A few acts later, it won't even be that.
No wonder he seems a little cooler than Othello, Coriolanus, Macbeth, or Brutus -- next to Hamlet's, their respective poetries seem like vivid reports on where their desires have led them. They are partly outside themselves when they speak their soliloquies, commenting on their own actions and emotions, or telling us how much these have made them suffer. But Hamlet, younger and more impetuous (if that's the word) than the other tragic heroes, is making up his mind right in front of us. Which may be why we think so little about what he's making up his mind to do.