William B. Kannel, an epidemiologist whose work for six decades on the landmark Framingham Heart Study helped revolutionize the way heart disease is treated, died Aug. 20 at a nursing center in Natick, Mass. He was 87 and had colon cancer, his daughter Patricia Hoffman said.

Any patient ever told by a doctor to eat better, exercise more, lose weight, quit smoking or take cholesterol medication to lower the risk of heart disease owes that life-saving advice in large part to Dr. Kannel.

Although those guidelines may sound like common knowledge today, they did not exist in 1950 when Dr. Kannel joined the fledgling Framingham Heart Study. The study, originally overseen by the U.S. Public Health Service, is recognized as one of the top medical achievements of the past century.

Henry Blackburn, a professor emeritus with the University of Minnesota School of Public Health, said that Dr. Kannel did “most of the heavy work” on the concepts behind the project and the writing that came from it. As its director from 1966 until 1979, he kept the project running and funded by being its “squeaky wheel.”

At its inception, the study proposed to follow the lives of 5,209 people in Framingham, Mass. The goal: To determine the causes of heart attack, stroke and other cardiovascular diseases. Little was known about “risk factors” — years later, Dr. Kannel would be credited with coining that term — and American death rates were skyrocketing.

Unlike earlier studies, the Framingham Heart Study did not gather patients who were already afflicted by heart disease and then try to determine what had made them sick.

Instead, it followed its participants in good health and bad. When someone had a heart attack or a stroke, researchers referred to that person’s medical history and tried to explain why. Today, the Framingham study is in its third generation, with a total of 14,427 participants.

William Bernard Kannel was born Dec. 13, 1923, in Brooklyn, N.Y., the first of three sons.

He turned 18 less than a week after the Japanese attack on Pearl Harbor. He was drafted into the Army and assigned to an engineering training program. He fell into a medical training program when the engineering one was discontinued.

Dr. Kannel earned his medical degree from the University of Georgia’s School of Medicine in 1949 and soon after joined the U.S. Public Health Service, attaining the rank of captain. He also earned a master’s degree in public health from the Harvard School of Public Health in 1958.

Besides his daughter, of Middlesex, Vt., survivors include his wife of 69 years, the former Rita Lefkowitz of South Natick, Mass.; four children, Linda Isaacson of Framingham, Steven Kannel of Exeter, R.I., and Scot Kannel of Royal Palm Beach, Fla.; 12 grandchildren; and 21 great-grandchildren.

Dr. Kannel’s colleagues said that he treated the Framingham participants with respect not often shown by doctors of his generation. Two colleagues recalled his admonition to new researchers: It was not the patients who should thank the doctors for treating them. The doctors should thank the patients for participating.