When the amount of coronavirus found in samples of Massachusetts wastewater spiked two times last month — one peak was roughly three times the biggest peak seen in the spring — it set off alarm bells.

“WORRISOME. This is not a good #COVID19 signal in Boston area wastewater," tweeted Eric Feigl-Ding, an epidemiologist and health economist at the Federation of American Scientists, after the first peak.

The state's wastewater has been tested for coronavirus RNA since the pandemic began as a way to monitor the outbreak. The peaks last month seemed to show that Massachusetts' COVID-19 outbreak was much worse than officials had thought.

But medical experts say they were actually nothing to worry about.

“That's just not how data work, right? One day the number was 3,772, and the next day it was 708,” said Shira Doron, an epidemiologist at Tufts hospital. “That’s just … not possible. It has to be some kind of data problem, some kind of measurement problem.”

The data is imperfect, according to Kyle McElroy, a research scientist with Cambridge-based company Biobot, which has been tracking coronavirus levels in wastewater around the state for nearly a year under a contract with the Massachusetts Water Resources Authority.

“There are reasons that these data are somewhat imprecise, for a wide variety of factors,” McElroy said. “If you see a huge spike and then the next day it's back to a normal level, you would say, oh, that was weird. If it was a large enough spike, then you'd call it an outlier and probably ignore it.”

As long as the broader trends — not specific peaks — of wastewater data match up with other clinical indicators of coronavirus, it can be used as a public health tool to monitor how the state is doing, but it should be taken as a “more holistic view of what's happening out in the community” instead of analyzed by specific data peaks and valleys, McElroy said. “What we're trying to provide is an extra data set to look at that we think might better represent the community spread.”

The rate of viral coronavirus RNA is steadily declining across the state, which is consistent with a decline in cases, hospitalizations and deaths, according to data released this week from both the North and South contingents of the water authority.

What actually causes the spikes is still a bit of a mystery. McElroy said the data depends greatly on fecal samples being in the right place at the right time.

“If the equivalent of a flush from a very infected person was going by just at the right time for that to be collected, that can start to skew the results,” McElroy said.

Samples of “what’s going by right now” are called grab samples, which are different from composite samples, which detect virus levels from a much broader pool of fecal matter in the sewer, McElroy said. Grab samples are rare, but “you know, when things happen that prevent a 24 hour composite sample from being collected, rather than have no data for a time point, there are other ways to collect and generate a sample.”

Results from both composite and grab samples, which can be influenced heavily by a single bowel movement, are presented together as part of the total data set.

“You expect it to have higher variance because it's not a composite from 24 hours,” McElroy said. “It's from what's going by now, and we're just grabbing that.”

People also use the bathroom at different times and flush different volumes of fecal matter into the sewer system, which adds an additional variation to the data, McElroy said.

“The content of what's going by is going to be dependent on who has contributed to that,” he said, “just like, how many people went today or in the last hour.”

Biobot looks at samples taken every 15 minutes throughout a 24-hour period in order to introduce diversity into the testing pool. That timing also makes a huge difference, according to McElroy.

“I suspect that the engineering of how the samples are collected is really something that's going to drive a lot of the variability,” he said. “If you were able to sample more frequently, every five minutes or something like that, it would give you a more representative composite sample."

Because the process of testing wastewater is an emerging technology, the sampling process, including how the samples are collected and processed, has changed significantly since the virus began to spread last spring, according to McElroy.

“The quality of the data are better now than they were in the spring, and that goes for both the wastewater data as discussed with the lab and the analysis protocols having changes and improved over that time.”

Though the lab has gone back to re-process older data to bring it up to date, McElroy still warns against making point-by-point comparisons in time from the spring to the fall.

“The magnitude of signal single time points is probably not the safest way to look at the data,” he said. “The general trend that things got a lot higher here than they did back in in the spring is probably still a valid conclusion from the data, but how many cases there are per day depends on what's reported that day.”

As vaccines get administered across the state, the broader data trends from wastewater will be a useful indicator the severity of the pandemic.

“If the wastewater data is still trending down, that means in the community there is less overall spread. And if there's a concurrence, that's a good thing,” McElroy said. “But if you see the overall trend going in an opposite direction, one hypothesis would be that we have a bunch of people that are vaccinated, so they're not getting sick and presenting to the clinic as someone who is ill with COVID, but they're still potentially infectious and able to spread that to others.”

Wastewater is also being looked at by scientists and other academic groups as a surveillance tool to continue predicting emerging risks in the future, McElroy said. But it will take some effort to iron out all the imprecisions.

“I think with time and with more people working on it, you can end up overcoming a lot of those technical challenges,” he said, “and hopefully creating a system that you can use to proactively monitor public health.”