(CNN) Comedians used to tell a joke that goes like this:

"A comedian walks into a psychologist's office. The psychologist says, 'lie down and tell me everything you know.' "

The punch line: "I haven't been able to get an appointment since. He's been doing my act in Philadelphia."

The material that comes from a counselor's couch often makes great fodder for a comic's act. It's the sad clown paradox: The men and women who make people laugh for a living often struggle with mental health challenges offstage that are hardly a laughing matter.

It's unclear how many comedians struggle with mental challenges such as depression, but many of the most familiar names have talked and joked about the issue: Robin Williams, Sarah Silverman, Stephen Fry, Spike Jones, Woody Allen, Richard Pryor, Ellen DeGeneres. It's no accident that the Laugh Factory in Hollywood has an in-house psychologist.

"I despised myself from pretty much close to getting out of the womb," comedian Richard Lewis said in the documentary. "I was always wrong. Let's start with that. When you are always wrong, you seek an audience to disprove that theory."

It's unclear in scientific literature whether this is true for all comedians. Does one need a mental struggle to be funny? Or is it that some comedians better understand these challenges and can speak to them without experiencing the struggle themselves?

What we do know is that analyzing humor is a lot like dissecting a frog, the old joke goes: No one laughs, and the frog dies. Yet in increasing numbers, scientists are trying to understand what motivates the professional jokers to want to make us laugh, even if they can't always do it for themselves.

The research is laughably contradictory.

Legendary psychoanalyst Sigmund Freud theorized that comedians often tell jokes as a kind of relief system from some kind of anxiety.

More recently, an often-quoted study from 1975 (PDF) theorized that humor can leave the comedian with a feeling of control over a situation in which they would otherwise be powerless.

"One can note here the plethora of jokes about doctors, psychiatrists, undertakers, sex and mothers-in-law," study author Samuel James wrote. If a comedian did struggle with their own mental health, the jokes could act like a salve for a physical wound.

That 1975 study focused on 55 full-time comedians who were highly successful. They had national news coverage and had a salary well over six figures. Despite their enormous success, James found, 80% of them had sought some kind of therapy.

The majority of those comedians had a few personality traits in common. They had higher-than-average to well above-average intelligence; other studies have linked high intelligence to depression.

The study participants felt as if they understood themselves fairly well and had good relationships, yet they often felt "misunderstood, picked on or bullied." They were also more likely to be "angry, suspicious and depressed" compared with those outside that profession.

Humor can also decrease social distance between people.

more often reported being close with their mothers but had more distant and disapproving fathers. Other studies have The comicsmore often reported being closewith their mothers but had more distant and disapproving fathers. Other studies have found the opposite parental relationship in comedians.

study titled It merely adds up numbers but doesn't get at the reasons behind them. Mental illness is often linked to suicide, but scientists agree that despite high-profile cases such as Williams', there isn't a disproportionate number of suicides in the profession. However, comedians don't live as long as their less-funny peers, according to a 2014study titled "Does comedy kill?" It merely adds up numbers but doesn't get at the reasons behind them.

Photos: Comedic geniuses who left us too soon Photos: Comedic geniuses who left us too soon Comedic geniuses who left us too soon – Robin Williams was, without a doubt, an entertainment marvel. From television to film, and from comedy to drama, Williams set a standard that only he could reach. Versatile, boisterous and surprising, his comedic style cracked up and comforted generations. In August 2014, those generations mourned the loss of a comedic genius who changed the way we interpret, think about and enjoy comedy, much like these talents that follow: Hide Caption 1 of 19 Photos: Comedic geniuses who left us too soon We didn't have John Belushi for long, but when we did? It was epic. One of the first "Saturday Night Live" stars, Belushi gave us a master class in televised sketch work, rolling out impersonations of everyone from Truman Capote to Elizabeth Taylor. And when Belushi transitioned to the big screen with 1978's "Animal House," his role as the filthy frat boy Blutarsky became a cinema classic. It looked to his amazed fans that Belushi was just getting started, but in his private life the actor was also struggling with substance abuse. In March 1982, he overdosed at the age of 33. Hide Caption 2 of 19 Photos: Comedic geniuses who left us too soon The world still hasn't come to terms with the loss of Andy Kaufman. Given that Kaufman was a sublime comedian and consummate prankster, there are those who still cling to the hope that the actor/performance artist faked his own death. But as far as we know, comedy lost a great in May 1984, when a 35-year-old Kaufman died of a rare form of cancer. Rather than stew on the "what ifs," we'll instead say to Kaufman, "tank you veddy much." Hide Caption 3 of 19 Photos: Comedic geniuses who left us too soon Good luck finding a comedian today who doesn't count Richard Pryor as an influence. Unflinchingly honest and as foul-mouthed as he was funny, Pryor's uncanny observations and impeccable delivery turned the Illinois native, who had a notoriously tough childhood, into a legend. He took his talent from the comedy stage to the screen and back again during his career, and still performed even after being diagnosed with multiple sclerosis in 1986. Pryor died in December 2005, but his influence as a singularly gifted, uproarious storyteller lives on. Hide Caption 4 of 19 Photos: Comedic geniuses who left us too soon Knowing that we'd never get to see Chris Farley's infectious smile again was very tough to swallow upon his death in 1997. It felt like we'd just gotten to know the uncontainable comedian, who got his start on "Saturday Night Live" in 1990. Farley's career hurtled to the top of the comedy food chain, as he became an integral part of "SNL's" cast and starred in movies of his own. Yet in his personal life, Farley was struggling with alcohol and substance abuse. The actor, seen here with filmmakers Tyron Montgomery (left) and Thomas Stellmach (right) at the 69th Academy Awards in March 1997, died that December from an overdose. He was 33. Hide Caption 5 of 19 Photos: Comedic geniuses who left us too soon It takes a special kind of creative to dream up the zany world of Pee-wee Herman, as comedic actor/writer Phil Hartman (right) did with Paul Reubens in the '80s. Hartman served as Captain Carl before his memorable work on "Saturday Night Live." From there, he built a career that included work on standouts like "The Simpsons" and "NewsRadio." But tragedy in 1998 brought Hartman's career to an abrupt end; the actor, seen here co-starring with Arnold Schwarzenegger in the 1996 movie "Jingle All The Way," was shot to death by his wife, Brynn Hartman, who killed herself hours later. Hide Caption 6 of 19 Photos: Comedic geniuses who left us too soon The death of John Candy was like the death of childhood for many of his fans, who grew up watching him in classic comedies like 1987's "Planes, Trains and Automobiles." Candy's résumé reads like a list of pop culture's favorite films: "Blues Brothers," "Stripes," "National Lampoon's Vacation," "Splash," "Spaceballs" and "Home Alone," all made between 1980 and 1990, not to mention his ensemble work on the Emmy-winning TV series, "SCTV," or his starring role in 1993's "Cool Runnings." His comedy was gentler and more accessible than some of his raunchier brethren, but it was just as enthralling. A prolific actor, Candy, who struggled with his weight throughout his career, was at work on 1994's "Wagons East" when he died in his sleep on the set. He was 43. Hide Caption 7 of 19 Photos: Comedic geniuses who left us too soon Bill Hicks was never afraid to deliver a controversial message -- his gift was that he could make you belly laugh while doing so. Hicks' time in the spotlight was brief, but he honed his craft since he was a kid, and grew to be known in the '80s as a dark comedy giant and social critic, with frequent appearances on David Letterman's late-night programs. But before Hicks could gain his footing with an even broader audience, he died of cancer in 1994. He was 32. Hide Caption 8 of 19 Photos: Comedic geniuses who left us too soon It didn't matter if Mitch Hedberg was talking about koala bears or candy bars; when he stepped to the stage, he had your attention. The comedian once dubbed "the next Seinfeld" had reached cult status in the late '90s and was approaching mainstream popularity when he died suddenly in March 2005 of a drug overdose at age 37. Hide Caption 9 of 19 Photos: Comedic geniuses who left us too soon Patrice O'Neal is another stand-up comedian whose staunch frankness is missed to this day. At turns brilliant and gleefully brash, O'Neal was a comics' comic -- the kind of sharp storyteller who could enrapture even those who did stand-up for a living. His views and comedy were controversial, to be certain, but they were also a welcome challenge. O'Neal, seen here in September 2011, died from complications of a stroke that November at age 41. Hide Caption 10 of 19 Photos: Comedic geniuses who left us too soon By the time "The Bernie Mac Show" made its way to Fox in 2001, the comedy's tart-tongued star had been making audiences laugh for close to a decade, stretching all the way back to HBO's "Def Comedy Jam." But that sitcom gave Bernie Mac an even bigger platform for his distinctive delivery, snowballing an already successful career into stardom territory with movies like the "Ocean's Eleven" franchise, "Guess Who" and "Transformers." Mac's seemingly unstoppable rise was cut short in 2008 when the comedian died of complications from pneumonia at the age of 50. Hide Caption 11 of 19 Photos: Comedic geniuses who left us too soon Another original "Saturday Night Live" cast member, Gilda Radner, gave us the gift of characters like Roseanne Roseannadanna and her unforgettable spin on Barbara Walters, Baba Wawa. For anyone who thought comedy was a boy's game, Radner was there to prove them wrong, hanging in league with co-stars like John Belushi. Radner was poised to shine on film, with movies like 1982's "Hanky Panky," but she was diagnosed with ovarian cancer in 1986, and passed away three years later at the age of 42. Hide Caption 12 of 19 Photos: Comedic geniuses who left us too soon It's only right that John Ritter signed his autographs "with love and laughter," as that's what he brought to audiences during his decades-long career. With the start of "Three's Company" in 1977, Ritter became the roommate everyone wished they had as the secretly hetero Jack Tripper. He starred in movies and did voice work, but it seemed to be the sitcom Ritter loved most. At the time of his shocking death in 2003, Ritter was starring on ABC's "8 Simple Rules." His passing, caused by an aortic dissection, felt like a sucker punch for all of us hoping to see his charming smile for years to come. Hide Caption 13 of 19 Photos: Comedic geniuses who left us too soon Madeline Kahn has been called " a kind of toy person: diminutive, delightful, sexy, impish, cute and capable of squirting vinegar in your eye. '' Or, according to Mel Brooks, "one of the most talented people that ever lived." And he would know, as he directed Kahn in four classic films: "Blazing Saddles" (pictured here with Harvey Korman), "Young Frankenstein," "High Anxiety" and "History of the World Part 1." Whether her quirky comedy was featured on Broadway, film or TV, Kahn shone bright. Like, flames. Her light dimmed too soon when she died of ovarian cancer at 57. Hide Caption 14 of 19 Photos: Comedic geniuses who left us too soon Counterculture comedian, social satirist and expletive enthusiast, Lenny Bruce (seen here circa 1965), knew how to talk dirty and influence people. He kept his audience in rapt attention while speaking frankly -- often in a stream of consciousness -- about taboo subjects such as religion, politics and sex. But not everyone was amused. Bruce was arrested several times for obscenity in his act, ultimately leading to a conviction at trial following a 1964 charge. The good news is he was granted a full pardon. The bad news is that it came in 2003, 37 years after Bruce died of a drug overdose in his Hollywood house at the age of 40. Hide Caption 15 of 19 Photos: Comedic geniuses who left us too soon Greg Giraldo was such a talented insult comic, he could eviscerate you on stage or at a roast, and you would probably ask for more so you could revel in his acerbic wit. But in an all-too-familiar story, Giraldo -- a recovering alcoholic -- died of an accidental prescription pill overdose at 44. Fellow comics paid tribute to Giraldo in sincere tweets of mourning (Sarah Silverman and Patton Oswalt) to the appropriately tasteless. At a roast for Jim Florentine shortly after Giraldo's death, roastmaster Rich Vos said, "I wasn't the first choice to host. Greg Giraldo was asked, but he said he'd rather be dead than host this ." Giraldo is survived by three sons. Hide Caption 16 of 19 Photos: Comedic geniuses who left us too soon A rare glimpse of the comic out of his trademark duster and beret, shrieking Sam Kinison attends the Emmy Awards in 1991, a year before his untimely death at 38 from a head-on collision. Kinison -- who admitted to struggling with drugs, alcohol and his weight -- rose to mainstream fame in Rodney Dangerfield's "Back to School" and appearances on "Late Night with David Letterman" and "SNL." He also had his own HBO special, 1987's "Breaking the Rules." Hide Caption 17 of 19 Photos: Comedic geniuses who left us too soon If you tuned into "The Tonight Show" between 1988 and 2007, you have likely laughed at Richard Jeni's stand-up. Before his death, he clocked the most appearances on the late-night institution, both in the Johnny Carson and Jay Leno years. Sadly, those accolades could not prevent the dark turn of events that led to Jeni's death from an apparent self-inflicted shotgun wound. He was 49. Hide Caption 18 of 19 Photos: Comedic geniuses who left us too soon Freddie Prinze was a comic extraordinaire, titular star of "Chico and the Man" (with Jack Albertson, left) and father of "She's All That" heartthrob Freddie Prinze, Jr. Reportedly depressed over the breakup of his marriage and addicted to Quaaludes, Prinze shot himself in the head in 1977. He was just 22 years old. Originally, Prinze's death was ruled a suicide, but was later designated an accident in a civil case. Hide Caption 19 of 19

Gordon Claridge , a psychologist who is retired from the University of Oxford, is still gathering data about comedians to better understand their personalities.

He has found that comedians seem to have two competing personality traits: introverted anhedonia (inability to feel pleasure) and extroverted impulsiveness. Although they are similar to actors, who remain extroverted, open and interested in understanding the world around them, comedians have introverted traits that make them asocial and a little emotionally flat. Some also suffer from clinical depression.

That personality split with their impulsive, extroverted tendencies may be behind their funny perspective on the world.

"We found a rather curious set of conditions out there," Claridge said. "Comedy may partly be a form of self-medication, something we don't see at all with other artists."

In the CNN documentary, comedian Patton Oswalt agrees: "A lot of comedians are people that are very introverted, very shy, very sensitive to humiliation. The only way to combat it is to go to the one place where you are stripped bare."

has limitations in that it focused only on male comedians. Claridge's studyhas limitations in that it focused only on male comedians. Other studies contradict his research, finding that there is no more depression among comedians than non-comics.

Claridge has gathered data about female comedians and will investigate whether they will have similar personality traits.

When he has presented his work to comedians, they've said that his findings were obvious from the people they knew on the circuit.

"My dad's humor came from life, and I don't think Dad had a choice," Pryor's daughter Rain Pryor said in the documentary. "You either laugh your way through it, or you die through it."

If comedians truly do have competing personality traits, humor may be their way of forcing their introverted selves to interact.

looking at comedians and circus clowns found that comics tend to make more negative remarks about themselves compared with other performers. A study from 2014looking at comedians and circus clowns found that comics tend to make more negative remarks about themselves compared with other performers.

Follow CNN Health on Facebook and Twitter See the latest news and share your comments with CNN Health on Facebook and Twitter.

And despite the perception given by comedians like Woody Allen, they are not typically neurotic, studies show. They score high in creativity and openness, although they tend to display lower conscientious and agreeable behavior than other performers (PDF) and writers, and they tend to be more critical and suspicious. This may give them the distance they need to observe human behavior with a comic eye.

A survey of comedians for a study in 2014 found that some standup artists did it largely for what one comedian in the study said was the "validation via the audience. We are trying to fill a hole." That research concluded that comics have a kind of "paradox of identification."

Claridge believes that, whether they have a personal struggle or are merely good at observing others, comedians all have an interesting story beyond the laughs.

"They all seem to have a hidden depth to their personalities," he said. "Comedy seems to be a way to deal with it, and we all benefit from it."