Americans say President Carter would do the best job of the candidates in keeping this country out of war, but they judge Ronald Reagan the best able to solve the nation's economic problems, an Associated Press-NBC News poll says.

That's bad news for Carter, for those likely to vote on Nov. 4 say domestic concerns, such as the economy, outweigh foreign policy as they consider their presidential ballot.

The AP-NBC News poll taken Monday through Wednesday didn't have much good news for independent presidential candidate John B. Anderson.

Anderson's debate with Reagan last Sunday did not give Anderson the boost he hoped for, leaving him still trailing far behind the two major-party candidates.

Asked to pick the best candidate for keeping this country out of war, 41 percent of the likely voters named Carter, 16 percent Reagan and 7 percent Anderson. Twenty-nine percent saw no difference among the three and 7 percent of the 1,512 likely voters interviewed nationwide by telephone were not sure.

But Reagan was picked by 40 percent of likely voters as best able to solve the nation's economic problems, while only 18 percent named Carter. Anderson was mentioned by 10 percent. Twenty-six percent saw no difference and 6 percent were not sure.