The Pfizer-BioNTech Covid-19 vaccine is associated with an increased risk of myocarditis, an inflammation of the heart muscle, a large new study from Israel confirms. But the side effect remains rare, and Covid-19 is more likely to cause myocarditis than the vaccine is, scientists reported on Wednesday. The research, which is based on the electronic health records of about two million people who are 16 or older, provides a comprehensive look at the real-wold incidence of various adverse events after both vaccination and infection with the coronavirus. Although the study did not break down the myocarditis risks by age or by sex, the median age of people who developed the condition after vaccination was 25, and 19 of the 21 cases were in males, the researchers reported. In addition to myocarditis, the Pfizer vaccine was also associated with an increased risk of swollen lymph nodes, appendicitis and shingles, although all three side effects remained uncommon in the study. Coronavirus infection was not associated with these side effects, but it did increase the odds of several potentially serious cardiovascular problems, including heart attacks and blood clots. “Coronavirus is very dangerous, and it’s very dangerous to the human body in many ways,” said Ben Reis, a co-author of the new study and the director of the predictive medicine group at the Boston Children’s Hospital Computational Health Informatics Program. He added, “If the reason that someone so far has been hesitating to get the vaccine is fear of this very rare and usually not very serious adverse event called myocarditis, well, this study shows that that very same adverse event is actually associated with a higher risk if you’re not vaccinated and you get infected.” The data arrived in the middle of an intense discussion among federal regulators about the risks of myocarditis and pericarditis, which is inflammation of the lining around the heart, in younger recipients of both the Pfizer-BioNTech and the Moderna vaccines, concerns that very likely led the Food and Drug Administration to negotiate larger pediatric trials with the vaccine makers this summer in the hopes of adequately assessing the risks before a possible emergency authorization for younger children. The companies are studying lower dosing in children to alleviate some of the risk. In their review of the Pfizer-BioNTech vaccine, regulators paid close attention to an American health care claims database, which found that the risk of the conditions in 16- and 17-year-old vaccinated boys could be as high as 1 in 5,000. The cases in the database were unconfirmed, the F.D.A. cautioned in an analysis published this week, but they were considered a reasonable estimate of the possible risk. Even in the worst-case scenarios of post-vaccination myocarditis and pericarditis modeled by the F.D.A., the benefits of vaccination still outweighed the risks, the analysis said. The study was one reason the F.D.A. said this week that after its licensure of Pfizer-BioNTech’s vaccine, Pfizer would conduct studies of myocarditis and pericarditis risks in people who received the shot, including long-term outcomes for those who fall ill after vaccination. Israel’s vaccination campaign, which relied on the Pfizer vaccine, got off to a fast start; by May 24, nearly five million people, or roughly 55 percent of the nation’s population, had received both doses of the vaccine. The new study, which was published in the New England Journal of Medicine, is based on an analysis of the electronic health records of Clalit Health Services, the nation’s largest H.M.O. Updated Aug. 25, 2021, 6:11 p.m. ET The researchers assembled a group of roughly 880,000 people, age 16 or older, who had been vaccinated by May 24. To create a control group, they matched each of those individuals to an unvaccinated person who was medically and demographically similar. “You can think about them as pseudo twins,” said Dr. Ran Balicer, the chief innovation officer for Clalit Health Services and the lead author of the new study. Then the researchers calculated the incidence of 25 different potential adverse events in each group. In a second round of analysis, they calculated the incidence of the same potential side effects in a group of 170,000 people who had tested positive for the coronavirus and in a similar group of uninfected controls. They found that although myocarditis remained rare, it was more common in the vaccinated group than the unvaccinated one. There were an extra 2.7 cases of myocarditis for every 100,000 people in the vaccinated group, compared with the unvaccinated one, the researchers found. Understand Vaccine and Mask Mandates in the U.S. Vaccine rules. On Aug. 23, the Food and Drug Administration granted full approval to Pfizer-BioNTech’s coronavirus vaccine for people 16 and up, paving the way for an increase in mandates in both the public and private sectors. Private companies have been increasingly mandating vaccines for employees. Such mandates are legally allowed and have been upheld in court challenges. Mask rules. The Centers for Disease Control and Prevention in July recommended that all Americans, regardless of vaccination status, wear masks in indoor public places within areas experiencing outbreaks, a reversal of the guidance it offered in May. See where the C.D.C. guidance would apply, and where states have instituted their own mask policies. The battle over masks has become contentious in some states, with some local leaders defying state bans. College and universities. More than 400 colleges and universities are requiring students to be vaccinated against Covid-19. Almost all are in states that voted for President Biden. Schools. Both California and New York City have introduced vaccine mandates for education staff. A survey released in August found that many American parents of school-age children are opposed to mandated vaccines for students, but were more supportive of mask mandates for students, teachers and staff members who do not have their shots. Hospitals and medical centers. Many hospitals and major health systems are requiring employees to get a Covid-19 vaccine, citing rising caseloads fueled by the Delta variant and stubbornly low vaccination rates in their communities, even within their work force. New York City. Proof of vaccination is required of workers and customers for indoor dining, gyms, performances and other indoor situations, although enforcement does not begin until Sept. 13. Teachers and other education workers in the city’s vast school system will need to have at least one vaccine dose by Sept. 27, without the option of weekly testing. City hospital workers must also get a vaccine or be subjected to weekly testing. Similar rules are in place for New York State employees. At the federal level. The Pentagon announced that it would seek to make coronavirus vaccinations mandatory for the country’s 1.3 million active-duty troops “no later” than the middle of September. President Biden announced that all civilian federal employees would have to be vaccinated against the coronavirus or submit to regular testing, social distancing, mask requirements and restrictions on most travel. But the risks were even higher among those who had contracted the virus. There were an extra 11 cases of the condition for every 100,000 people who had been infected with the coronavirus, compared with those who had not. The study provides critical context for understanding the risks and benefits of vaccination, said Dr. Brian Feingold, an expert on heart inflammation in children at the UPMC Children’s Hospital of Pittsburgh who said he fields calls from parents who are concerned about the myocarditis risk. “And nobody’s blowing that off, but I think you just have to look at that in context,” he said. “Those risks related to Covid are higher than the risks related to the vaccine.” In addition to myocarditis, coronavirus infection was also associated with an increased risk of heart attacks, irregular heart beat, blood clots in the lungs or legs, kidney injury and bleeding inside the skull. For every 100,000 infections, there were an extra 25 heart attacks and 62 cases of blood clots in the lungs, for instance. “When you try to make your decision on whether or not you should take the vaccine, one of the things to ask is not only what are the potential adverse events associated with taking the vaccine, but also what am I risking when I think about Covid-19 as the other option,” Dr. Balicer said. Although the study is reassuring, it is important to continue collecting data on the myocarditis risks in young males in particular, scientists said. “But we’re at this red hot moment,” said Dr. Sean O’Leary, a pediatric infectious disease expert at the University of Colorado Anschutz Medical Campus. “This is what we’ve got, and the benefits still consistently appear to greatly outweigh the risks.” In one recent study, which has not yet been published in a peer reviewed journal, researchers calculated that 12- to 17-year-old boys were about six times as likely to develop myocarditis after infection with the virus than after receiving one of the mRNA vaccines.