Juanita M. Kreps, who wound up her Cabinet career yesterday as President Carter's secretary of commerce, is leaving town with the feeling that the president's economic advisers "have not served him as well as we might have."

She says she was excluded from a major role in economic-policy formulation "by the boys at the breakfast table" who managed Carter's top-level Economic Policy Group, and she deeply resents that exclusion, although she readily concedes that her participation would not likely have made much difference in results.

"I felt a keen sense of pecking order among certain of my colleagues," she said in an interview Wednesday. If she had to do it over again, she smiled, "I would be more flamboyant . . . I would have come into town clanging bells a bit."

The failure of economists in and out of government to understand the pervasive "inflationary bias" of the last several years has raised so many professional questions in her mind that Kreps is resigning her richly endowed teaching position at Duke University, to which she had the right to return. She was an economic professor and vice president there before joining the Carter team.

Now 58, Kreps said, "I've been teaching since I was 20, and to tell you the truth, I don't know what I would teach now . . . . You do lose faith in the catechism after a while."

Even Brookings economist Arthur M. Okun, creator of the famed "Okun's Law that is supposed to predict the unempolyment rate, "doesn't know why it isn't going up faster," she said.

"according to Okun's Law, which I have been teaching for the last half-decade, the unemployment rate should be much higher than we're getting. And when I ask him -- dear Art -- he's as puzzled as the rest of us, and he's been the best thinker we've had on that subject," Kreps said. ,tShe agreed with a statement made by former treasury secretary W. Michael Blumenthal to the effect that the Carter administration's basic error was in underestimating inflation, and worrying too much about unemployment instead.

In addition, she said "our common mistake was being too short-range in our attention. All of us concentrated on [things like] this week's CPI number, rather than the fundamental problems of, say, productivity declines."

Carter, she revealed, had "difficulty" in understanding why his economists couldn't find solutions. "There've been times when I sensed that he was perplexed and maybe even exasperated with the failure of the group to solve the problem."

Kreps said that Carter's record is much better outside the economic-policy area. Reluctantly, because she so admires Council of Economic Advisers Chairman Charles L. Schultze, she conceded that the forecasting record of the economic council proved to be faulty. But she doesn't think she or any other economist would have done any better.

"The problems were very different, and thus I think we weren't bright enough, we didn't get a consensus often enough, and so I am more disappointed in the economists than I am in the president," Kreps said.

Nonetheless, she leaves in high, good spirits ("It's like being let out of school"), believing that if she couldn't participate in macro-economic policy, she performed a useful role at the micro level, in areas such as trade and regional development. "I think my record is darn good," she volunteered.

Her basic reason for leaving is her husband's health problem "It would not be in the best interests of my family" to complete the four-year term, she said. She plans "to make a living" by serving on corporate boards of directors, and will maintain some academic tie.

Kreps comes away with "heightened respect" for Carter. She says she always had access to him, and "never for an instant" had the kind of communications problems with Hamilton Jordon and Jody Powell that Blumenthal has complained about. "They knew and the president knew," Kreps said, "that I was completely dedicated to what he was doing, and that once a decision was made, I would not second-guess it."

Her chagrin at being shut out of the Economic Policy Group process is undisguised.She attributes the exclulsion to the fact that she was secretary of commerce, a department that was brushed off as unimportant.

"There's some people below us, but not many," she said wryly. When assured that she was not being left out of the inner councils because of her sex, she said, "Okay, let's change the procedure. I said, 'any number can play, it doesn't cost anything.' There's been no satisfactory answer to that."

Kreps would not name individuals, but it is known she feels that Blumenthal kept too close control over the "little circle of three or four people" who ran Carter's economic policy. She says she became resigned to the reality, although "I know that the glamor, the glory in this town centers on who's at the center of power."

By being more aggressive, "which I think I could have been without jeopardizing my basically mousy nature," she concedes she might have gotten more done for herself and her department. She acknowledged that "I am plagued by this constant reference to the fact that I'm soft-spoken and gentle and don't make waves. I keep threatening to change that image by coming in some morning and screaming and throwing things."

In retrospect, she thinks that a low-key substantive approach "does not pay off in Washington. Rather, the fellow who can hold an audience, who can go with a minimum of information and a maximum of political savvy -- that's the way to get ahead in Washington," Kreps concluded.

She has a very positive and upbeat view of Carter, sharply contrasting with the negative picture of an inefficient leader drawn by former speech writer James Fallows and others.

In terms of Carter's reliance on fellow Georgians, such as Jordon and Powell, she said: "Each of us is comfortable, I think, with the people we've worked with for a long time, and there is a terrifying quality to coming to Washington for a major job."

But Kreps conceded that Carter should also have "reached out for a wider range of people with a wider range of backgrounds, some of which he has begun to do very recently." One failure of the White House staff, she said, was "not tapping the talent" readily available in various government departments.

Her own assessment of Carter is that he is "highly intelligent, analytical, willing, even eager to face some hard issues. He is eminently fair and concerned about human problems . . . I think compassion is the quality I see in the president, and I find that endearing. It's an important element in a president, and especially rare."

She is not enchanted at all by Carter rival Sen. Edward M. Kennedy (D-Mass.) observing that "it's hard to judge his economic philosophy yet, because he hasn't come forth with any." She adds that Kennedy will have a difficult time defending "the big spending that might go with a more 'liberal' economic philosophy."

Kreps predicts that Carter will be renominated and reelected, but says that he -- or any president -- will in the 1980's face very difficult issues. "We have a lot of reckoning to do, we the American people, " she said. There is "a lot of facing up, a lot of making peace with an economic era that is basically different from what it has been in the past."

The problems ahead, the limitation on resources, she said, will require Carter or any president to follow "a steady-as-you-go" policy. She said she thinks that in the past few months the American people have come to understand leadership is more than "shining rhetoric" and instead has to be based "on analysis and ability to find reasonable solutions to very difficult problems."