People taking warfarin, a leading blood thinner to prevent clots that cause heart attacks and strokes, soon may have a better way to get the tricky dose right.

A new formula that includes gene testing proved much better at setting the ideal dose than what doctors do now: Give a standard amount and adjust it by trial and error. The formula was tested in a large international study, which found the usual approach gets it wrong about half the time.

Warfarin, also known as Coumadin, is the top-used blood thinner worldwide. In the U.S. alone, about 4 million people it. It could be used even more, but doctors have worried about the all-too-common risks to patients if they get the dose wrong. Too little means a risk of stroke and too much can mean fatal bleeding.

The new study is one of the first to show genetic testing can be used to prevent dosing problems, experts said.

A new experiment will soon test the gene study's results in a more rigorous way. Most patients will likely have to wait at least a few years before genetic testing becomes a common factor in warfarin dosing, some experts said.

Patients are generally started on 5 milligrams a day, but that's just a starting guess. The proper amount for one patient may be 10 times as much as what's best for another. Improper dosing leads to problems for thousands of patients each year and can even result in death, according to some estimates.

"You need to be just right," said Donna Arnett, a researcher of genetic testing and cardiovascular health at the University of Alabama at Birmingham, who wasn't involved in the study.

Variations in two genes can indicate how effective the drug will be, but such a test is not yet widely used.

In the new study, researchers in nine countries collected data on about 5,700 patients who — after some trial-and-error — were already on stable doses of the blood thinner. The scientists developed a dosing formula based on the gene test and other factors, including age and weight.

The formula using the gene test proved accurate in setting the dose in about 1 out of 3 warfarin users — more accurate than a method based solely on age, weight and other characteristics.

The study didn't report on serious side effects or consider how tobacco and alcohol use might figure into blood thinner dosing.

The research was funded by the National Institutes of Health and several international medical organizations. Key researchers have received consulting fees and grants from pharmaceutical companies, and companies involved in genetic testing.

Federal officials want to follow up the report by launching a large, three-year study of more than 1,200 patients beginning in April.

"People will go to their doctors and ask" about genetic tests, predicted Jeremy Berg, director of the National Institute of General Medical Sciences, one of the just-published study's funders.

But until the larger study is done, "it's unlikely that very many places will offer this," he said.

A few clinics are already using these gene tests and others to estimate warfarin dosing, but some researchers have concluded it's not cost-effective for most patients.

Dr. Janet Woodcock, who heads the Food and Drug Administration's drug evaluation center, noted that many patients have, for a long time, complained to doctors that the standard warfarin treatment didn't work for them. Now science is showing how right they were.

"The patients are beginning to be vindicated," Woodcock said.