The Dow Jones Industrial Average rose 45.14 points, or 0.4 percent, to close at 12,605.32.
Intel led the blue-chip average lower after news that Goldman Sachs downgraded the chip maker to "sell" from "neutral," citing slowing shipments on processors, rising competition and increasing capital expenditures.
The brokerage also cut its overall view of the semiconductor sector to "cautious" and downgraded Applied Materials to "neutral" from "buy." Hewlett-Packard fell for a third day in the wake of a weak earnings outlook earlier this week. Citigroup also cut HP's price target to $45 a share from $65.
The S&P 500 rose 2.92 points, or 0.2 percent, to close at 1,343.60, while the tech-heavy Nasdaq rose 8.31 points, or 0.3 percent, to close at 2,823.31. The CBOE Volatility Index, widely considered the best gauge of fear in the market, fell below 16.
Among key S&P 500 sectors, industrials and telecom fell, while health care rose.
The main reason the markets rose on Thursday in the face of Goldman's downgrade of Intel, and a host of weak economic news, was the success of the LinkedIn offering, said Todd Schoenberger, managing director at LandColt Trading.
"The markets would have crumbled today if not for the IPO," Schoenberger said.
In Schoenberger's view, the IPO doesn't represent a frothy market top like the Internet bubble of the late 1990s. Instead, he notes, "40 percent of the company's revenues come from the services they sell to recruiters and their tools are very unique."
Stocks had weakened earlier in the session as investors digested a slew of economic news, much of it pointing to further signs of sluggishness in the economy.
One of the more optimistic reports was that initial jobless claims fell last week, although the four-week moving average of claims reached a six-month high.
Still, for individuals who remain unemployed, "there is no recovery without a job," Penrod says. "Until individuals are back, the overall feeling is going to be one of we're not there yet."
That was evident in Conference Board's index of leading indicators, which fell for the first time since June 2010. "While there weren't big moves expected, small positive moves is what we were hoping for," Penrod said. "Unfortunately there is still more uncertainty than people thought there would be."
Another factor in Thursday's markets is tomorrow's expiration day for stock index and equity options, which can lead to volatility as investors roll over contracts.
History has shown that the market often rises going into the day of expirations, said J.J. Kinahan, chief derivatives strategist at TD Ameritrade. "If you're long you are usually better off," Kinahan said.
Perhaps the biggest boost to the market on Thursday was the soaring performance of LinkedIn, which began trading at $83 a share Thursday morning, nearly double its pricing level of $45 a share. The social networking site for professionals, trading under the symbol LNKD, traded at around $108 a share in the early afternoon. At that price, LinkedIn's market cap would be $10.2 billion, bigger than the market caps of some of the market's most well known names, including AMD, Southwest Airlines and NYSE Euronext. The price fell back later in the session, although the shares still rose more than 100 percent.
The dollar fell against a basket of currencies and oil prices slipped after U.S. economic data showed signs of a slow growth. U.S. light, sweet crude fell 1.66 percent to settle at $98.44 a barrel, while in London, Brent crude fell 0.8 percent to settle at $111.42.
Precious metals prices fell slightly on the weak economic news. Gold fell 0.23 percent to settle at $1,492.20 on Thursday, while silver fell 0.48 percent to $34.927.
But Dollar Tree beat profit expectations as the low-priced chain continued to benefit from shoppers trying to get the most for their money.
GameStop rose despite delivering a disappointing second quarter earnings outlook as the video game retailer posted stronger-than-expected results for the first quarter.
Limited Brands fell Thursday despite reporting a 47 percent gain in profits and a double-digit gain in same-store sales. Also Lazard Capital raised its price target for the owner of Victoria's Secret to $55 a share from $45.
Also trading lower was Hot Topic, which reported a bigger loss in the first quarter than expected, and Children's Place, which beat earnings expectations but reported little change in profit margins.
More retail earnings will be reported after the bell when Gap releases results, and cloud computing company Salesforce.com also delivers earnings.
Elsewhere, Sodastream jumped after news the maker of home carbonation systems plans to create products for offices, restaurants and the hospitality industry next year, the company CEO told Reuters.
In M&A news, Thermo Fisher Scientific is buying Phadia, a privately-held Swedish company, for about $3.5 billion in cash. Phadia makes blood test systems.
Volume on the consolidated tape of the New York Stock Exchange was 3.2 billion shares, while 872 million changed hands on the NYSE floor.
Several economic reports released on Thursday provided investors with evidence the economy remains weak.
The Philadelphia Fed's business activity index tumbled to 3.9 in May from 18.5 in April, a surprising drop. Economists had expected the index to rise to 20, according to Reuters.
Initial claims for unemployment fell by 29,000 to 409,000 in week ended May 14 from an upwardly revised 438,000 claims the week before, the Labor Department said. Economists surveyed by Reuters expected claims to fall to 420,000 from the previously reported 434,000.
The four-week moving average of claims, however, reached a six-month high, rising 1,250 to 439,000. Continuing claims fell to 3.71 million in the week ended May 7 from 3.79 million.
Shares in Europe closed higher, led by energy stocks.