In the United States, we head to the polls every four years to elect a new president. So why do we have midterm elections halfway through each presidential term instead of just voting for everything at once every four years? (Craig F. Walker/The Boston Globe via Getty Images)

Health care and immigration were high on voters' minds as they cast ballots in the midterm elections, according to a wide-ranging survey of the American electorate conducted by The Associated Press.

AP VoteCast also shows a majority of voters considered President Donald Trump a factor in their votes.

Control of the Senate and the House of Representatives is at stake in the first nationwide election of Trump's presidency. Democrats are hoping to take over one or both chambers to put a check on the president. At the same time, Trump is encouraging voters to view the election as a referendum on his leadership.

The VoteCast survey debuted Tuesday, replacing the in-person exit poll as a source of detailed information about the American electorate. In all, the survey included interviews with more than 113,000 voters nationwide.

Some early takeaways from VoteCast:

TOP ISSUES: HEALTH CARE AND IMMIGRATION

Health care was at the forefront of voters' minds: 26 percent named it as the most important issue facing the country in this year's midterm elections, followed by immigration (23 percent). Smaller shares considered the economy (19 percent), gun policy (8 percent) and the environment (7 percent) to be the top issue.

IS IT ALL ABOUT TRUMP?

Nearly two-thirds of voters said Trump was a reason for their vote, while about a third said he was not.

THE ECONOMY

Voters have a positive view of the state of the national economy - 65 percent said the condition of the economy is excellent or good, compared with 34 percent who said it's not good or poor.

WRONG DIRECTION

A majority of voters overall said the country is headed in the wrong direction. About 6 in 10 voters said it is headed in the wrong direction, while around 4 in 10 said it's on the right track.

AP VoteCast is a survey of the American electorate conducted in all 50 states by NORC at the University of Chicago for The Associated Press and Fox News. The survey of 113,677 voters and 21,599 nonvoters was conducted Oct. 29 to Nov. 6, concluding as polls close on Election Day. It combines interviews in English and Spanish with a random sample of registered voters drawn from state voter files; with self-identified registered voters conducted using NORC's probability-based AmeriSpeak panel, which is designed to be representative of the U.S. population; and with self-identified registered voters selected from nonprobability online panels. Participants selected from state voter files were contacted by phone and mail and had the opportunity to take the survey by phone or online. The margin of sampling error for voters is estimated to be plus or minus 0.5 percentage points. All surveys are subject to multiple sources of error, including sampling, question wording and order, and nonresponse. Find more details about AP VoteCast's methodology at http://www.ap.org/votecast.