David Rakoff, a prizewinning humorist whose mordant, neurotic essays examined everything from his surreal stint portraying Sigmund Freud in a Christmastime shop window display to his all-too-real battles with cancer, died on Thursday in Manhattan. He was 47.


His death was announced by his mother, Gina Shochat-Rakoff. Mr. Rakoff’s cancer had first appeared when he was 22 and recently reappeared as a tumor in his left shoulder.


The return of his cancer, and the possibility that his arm and shoulder would have to be amputated, were the subjects of the concluding essay in Mr. Rakoff’s most recent collection, “Half Empty” (2010), a darkly comic paean to negativity.


For his incisive wit and keen eye for the preposterous, Mr. Rakoff (pronounced RACK-off) was often likened to the essayist David Sedaris, a mentor and close friend. Like Mr. Sedaris, he was a frequent contributor to “This American Life,” broadcast on public radio.


Mr. Rakoff’s print essays appeared in The New York Times, GQ, Details, Salon, Slate and elsewhere. They formed the meat of his three published collections, which, besides “Half Empty,” include “Fraud” (2001), in which he chronicled, among other things, his brief appearance on a television soap opera (Mr. Rakoff was also an actor); and “Don’t Get Too Comfortable” (2005), which, as its jacket copy proclaims, skewers the American demographic beset by “the never-ending quest for artisanal olive oil and other first world problems.”


A self-described gay Jewish Canadian transplant to New York City, Mr. Rakoff was a social anthropologist of postmodern life. His research often entailed firsthand field work, as when, in pursuit of conspicuous consumption, he became a passenger on one of the last flights of the Concorde.


He described the trip in his essay “As It Is in Heaven”: “At 42,000 feet and Mach 1.71 (1,110 m.p.h.), we are given some small canapés. Triple rounds of edible money: filet mignon topped with caviar, smoked salmon, foie gras and a gooseberry.”


(As a cultural counterweight, Mr. Rakoff next flew on Hooters Air, the short-lived airline operated by the Hooters restaurant chain and with a crew that included its pneumatic, scarcely clad hostesses, an experience recounted in the same essay.)


While some critics faulted Mr. Rakoff’s writing as overly aphoristic, many praised his singular style, which combined an amiable dyspepsia with an almost palpable undercurrent of melancholy.


In his essay “Christmas Freud,” Mr. Rakoff tells of volunteering to spend several weeks as Freud in a tableau vivant, part of the 1996 holiday window displays at Barneys New York, the luxury emporium. (He knew the store’s creative director.)


Gawked at by passers-by, the display included little more at first than Mr. Rakoff, a chair and an analyst’s couch. That, he soon determined, would not do.


“I’ve decided to start seeing patients,” he wrote. “I’m simply not man enough to sit exposed in a window doing nothing; it’s too humiliating and too boring.” Manhattan being Manhattan, they came in droves; many spoke to the good doctor about Christmastime anxiety.


One such “patient,” a writer for the British newspaper The Independent, described Mr. Rakoff’s analytical spiel as follows:


“ ‘Let’s look at the name. Father Christmas,’ ” he says, emphatically. “ ‘It’s obviously an Oedipal fantasy. Santa Claus is supposed to come down a chimney, a simulacrum for a vagina. Then he leaves presents, and children are always anxious about what kind. So it’s really all about parents engaged in sex, an act that necessarily excludes their kids.’ ”


David Benjamin Rakoff was born in Montreal on Nov. 27, 1964, and reared in Toronto. He earned a bachelor’s degree in East Asian studies from Columbia in 1986 and afterward worked in Japan as a translator.


His stay in Japan was cut short by a diagnosis of Hodgkin’s lymphoma. He moved back to Canada for more than a year of treatment and remained free of cancer for two decades.


Returning to New York, Mr. Rakoff worked as an editor and publicist for various publishers before gathering sufficient nerve to pursue writing in earnest. A letter he wrote to Mr. Sedaris in the early 1990s after hearing him on the radio, and Mr. Sedaris’s subsequent championing of Mr. Rakoff’s work, led to his own radio career, which in turn led to his books.


Mr. Rakoff acted in several stage plays by Mr. Sedaris and his sister Amy. He also wrote the screen adaptation for, and starred in, a 20-minute film, “The New Tenants” — a ghoulish comedy about the worst New York rental experience imaginable — which won the Academy Award for best live-action short film in 2009.


Besides his father, Vivian Rakoff, a psychiatrist, and his mother, a physician, Mr. Rakoff’s survivors include a brother, Simon, a well-known stand-up comic in Canada, and a sister, Ruth Rakoff, whose memoir, “When My World Was Very Small” (2010), recounts her own battle with cancer.


Mr. Rakoff received the Thurber Prize for American Humor for “Half Empty.” “Fraud” and “Don’t Get Too Comfortable” received Lambda Literary Awards, an annual honor for lesbian- and gay-themed books.


When Mr. Rakoff’s cancer returned and he risked amputation, he ruminated on life without his arm and shoulder. It was not so much the physical loss that worried him, he said, but something far larger.


“There are other extrafunctional and noncosmetic realities I have to consider,” Mr. Rakoff wrote in “Another Shoe,” his essay about the tumor. “How does someone without a left arm know he’s having a heart attack, for example?”