Tracy Pollan, Michael J. Fox, Michael Gross and Gary David Goldberg of the cast and crew of “Family Ties” accept the Fan Favorite Award at the 9th Annual TV Land Awards. (Larry Busacca/Getty Images)

Gary David Goldberg, a television producer and writer who created the sitcom “Family Ties,” which made a star of Michael J. Fox as a briefcase-toting Republican teenager in frequent and affectionate confrontation with his hippie parents, died June 22 in Montecito, Calif. He was 68.

The cause was a brain tumor, said his son-in-law Rob Dubbin.

Airing on NBC from 1982 to 1989, “Family Ties” neatly captured an era of transition in American culture and stood out as one of the most popular programs on television. At its height, it ranked No. 2 — just behind “The Cosby Show,” another sitcom that featured a nuclear family finding its way in a changing world.

Fox and Mr. Goldberg reunited in 1996 for “Spin City,” an ABC sitcom starring the actor as deputy mayor of New York City; Charlie Sheen took over the lead role before the show was canceled in 2002. Mr. Goldberg pursued other creative ventures in television and film during his career, but he was best remembered for conceiving the Keaton clan of Columbus, Ohio, in “Family Ties.”

Among the show’s fans was President Ronald Reagan, whose conservative movement invigorated the Young Republicans represented by Fox’s character, Alex P. Keaton. Reagan was widely reported to have declared “Family Ties” his favorite show on television. It ran, as was often noted, almost exactly the length of his administration.

The show did not develop as Mr. Goldberg had originally intended. He planned for the Keatons’ story to revolve around the countercultural parents he had created in his own image — Steven, a PBS station manager played by Michael Gross, and Elyse, an architect played by Meredith Baxter-Birney.

Their daughters Mallory and Jennifer were played by Justine Bateman and Tina Yothers. Matthew Broderick was reported to have turned down the role of Alex, opening the way for the little-known Fox. As the extent of Fox’s comedic talent emerged, Mr. Goldberg adapted the story line to focus on his character.

Alex’s worldview was perhaps best summarized in a line in the pilot episode, in which the parents invite their children to watch a slideshow of them marching on Washington.

“What were you protesting?” Alex inquires. “Good grooming?”

Alex had a favorite economist (Milton Friedman) and displayed a portrait of Richard Nixon in his room. Once, a copy of the Wall Street Journal cropped up under his bed.

“Do you think he was switched at birth and the Rockefellers have our kid?” Steven asks Elyse.

At times, the show not so subtly challenged Alex’s fidelity to market economics. When he leaves his job at a family-owned grocery store for a higher-paying position at a chain store, he decides that he doesn’t much like being called “junior stockboy No. 28” and returns to the mom-and-pop operation.

Mr. Goldberg shared an Emmy Award for the writing of a 1987 episode in which Alex’s friend dies in a car crash while running an errand. Alex might have been killed, too, but he declined to help his friend with the task.

“My life was saved out of smallness, out of lack of generosity for a friend,” Alex says. “Why am I alive?”

New York Times television critic John J. O’Connor called the script a “masterfully constructed playlet.”

The show ends, poignantly, when Alex strikes out for New York after landing a job with a big Wall Street firm.

“I think it was . . . a Reagan-era show,” Mr. Goldberg told Newsday. “We were just kind of observing our own lives and reflecting on some of the strange turns of events, the behavior of our children. We didn’t realize we were on to anything.”

Gary David Goldberg was born June 25, 1944, in Brooklyn. His upbringing there inspired “Brooklyn Bridge,” a critically acclaimed but poorly rated show that he created and that ran on CBS in the early 1990s. “I had my childhood canceled,” Mr. Goldberg said when the network ended its run.

Mr. Goldberg embraced the 1960s culture and hitchhiked his way around the country and around the world until he settled in California, where he graduated from San Diego State University in 1975. He did not own a television, he said, until a professor brought to his attention his writing talent and an agent showed interest in his television scripts.

He landed a job as a writer for “The Bob Newhart Show,” later becoming a story editor and a producer of “The Tony Randall Show” and an Emmy-winning producer for “Lou Grant.” In 1981, he formed his own production company, Ubu Productions, named for his dog — the canine featured in the closing credit of “Family Ties.”

His film ventures included “Dad” (1989), starring Jack Lemmon, Ted Danson and Ethan Hawke; “Bye Bye Love” (1995), about divorced men played by Matthew Modine, Randy Quaid and Paul Reiser; and “Must Love Dogs” (2005), a romantic comedy with Diane Lane and John Cusack. His memoir, “Sit, Ubu, Sit: How I Went from Brooklyn to Hollywood with the Same Woman, the Same Dog, and a Lot Less Hair,” was released in 2008.

Survivors include his wife, Diana Meehan of Montecito; two daughters, Shana Silveri of Los Angeles and Cailin Goldberg-Meehan of New York City; a brother; and three grandchildren.

Mr. Goldberg once explained what he hoped to achieve with “Family Ties.”

“We had to accomplish three things,” he said. “The audience had to want to be part of this family, they had to see themselves in this family, and they had to feel like they could watch and learn how to be a better family.”