A doctor who contracted the deadly Ebola virus and rode the subway system and dined out before he developed symptoms said the media and politicians could have done a better job by educating people on the science of it instead of focusing on their fears.

"When we look back on this epidemic, I hope we'll recognize that fear caused our initial hesitance to respond - and caused us to respond poorly when we finally did," Dr. Craig Spencer wrote in an article published Wednesday in The New England Journal of Medicine.

Spencer, an emergency room physician, was diagnosed with Ebola on Oct. 23, days after returning from treating patients in Guinea with Doctors Without Borders. His was the first Ebola case in the nation's largest city, spurring an effort to contain anxieties along with the virus. He was treated at a hospital, recovered and was released on Nov. 11.

News of Spencer's infection unnerved some New York residents, particularly after they learned that he rode the subway system, ate out and went bowling in the days before he developed a fever and tested positive.

Spencer said little attention was devoted to the fact the science of disease transmission and the experience of previous Ebola outbreaks suggested it was "nearly impossible for me to have transmitted the virus before I had a fever."

"Meanwhile, politicians, caught up in the election season, took advantage of the panic to try to appear presidential instead of supporting a sound, science-based public health response," he said.

After Spencer's diagnosis, New York Gov. Andrew Cuomo and New Jersey Gov. Chris Christie announced mandatory 21-day quarantines for travelers who have come in close contact with Ebola, which has infected more than 14,000 people in West Africa and has killed more than 5,000.

Cuomo and Christie called federal health guidelines inadequate when they announced their quarantine plans.

But the governors, Spencer said, did not "sufficiently consider the unintended side effects."

The threat of quarantine may cause sick people to defer seeking treatment or cause health care responders returning from affected countries to "alter their travel plans or misreport their exposure to avoid quarantine," said Spencer, whose treatment included a transfusion of blood plasma from another Ebola survivor.

"We all lose when we allow irrational fear, fueled in part by prime-time ratings and political expediency, to supersede pragmatic public health preparedness," Spencer wrote.