I have been asked that question repeatedly over the last several weeks, and I think that I should answer it.

First, a bit of background.

I have been a professor of economics at Harvard for more than a quarter-century. Since 2005, one of my assignments has been to run Economics 10, the yearlong introductory course. About 750 undergraduates enroll every year, often making it the largest course on campus. I give some lectures, invite a few of my colleagues to do so as guests and oversee an army of graduate-student teaching fellows who run small sections.

On Nov. 2, a group of students staged a walkout of one of my lectures. In an open letter to me, the organizers said the action was meant “to join a Boston-wide march protesting the corporatization of higher education as part of the global Occupy movement.” They said that “the biased nature of Economics 10 contributes to and symbolizes the increasing economic inequality in America.”

The university administration, which had heard about the planned protest, sent several police officers to sit in my class for the day as a precautionary measure. Luckily, they weren’t needed.

Eight minutes into the lecture, about 5 to 10 percent of the class stood up and quietly left. Some other students who had taken the class in previous years then walked into the room as a counterprotest. I have been told that at least one of the students who walked out sneaked back in later: he wanted to support the protest but didn’t want to miss the lecture. After a few minutes, I resumed the class as usual.

So how do I feel about it?

My first reaction was nostalgia. I went to college in the late 1970s, when the memory of the Vietnam War was still fresh and student activism was more common. Today’s college students tend to be more focused on polishing their résumés than on campaigning for social reform. I applaud the protesters for thinking beyond their own parochial concerns and trying to make society a better place for everyone.

But my second reaction was sadness at how poorly informed the Harvard protesters seemed to be. As with much of the Occupy movement across the country, their complaints seemed to me to be a grab bag of anti-establishment platitudes without much hard-headed analysis or clear policy prescriptions. Ironically, the topic of the lecture that the protesters chose to boycott was economic inequality, including a discussion of recent trends and their causes.

The course I teach is a broad survey of mainstream economics. It includes ideas of many greats in the field, like Adam Smith, David Ricardo, Arthur Pigou, John Maynard Keynes and Milton Friedman. The material is similar to what you’d learn at most other universities.

Many Harvard students recognize this. An editorial in the student newspaper, The Harvard Crimson, said: “The truth is that Ec 10, a requirement for economics concentrators, provides a necessary academic grounding for the study of economics as a social science. Professor Mankiw’s curriculum sticks to the basics of economic theory without straying into partisan debate.”

Perhaps the protesters were motivated by an inchoate feeling that standard economic theory is inherently slanted toward a conservative world view. If so, they would be following a long tradition.

As a student, I took my first economics course using Paul Samuelson’s famous textbook. For the second half of the 20th century, it was a leading text for introductory economics. It offered many millions of students around the world their first and often only look at the subject.

Professor Samuelson’s own politics were decidedly left of center, but that did not prevent him from being attacked by those even further left. A two-volume critique of his book, called “Anti-Samuelson,” was published in 1977. (It was condensed from the original four-volume German edition.) Written by Marc Linder, now a professor of labor law at the University of Iowa, it aimed to provide a Marxian counterpoint to the standard economics of the day. Professor Linder focused on the Samuelson book not because he thought it was particularly egregious but because it was a prominent representation of mainstream economic thought.

I don’t claim to be an economist of Paul Samuelson’s stature. (Probably no one alive can.) But like him, I have written a textbook that has introduced millions of students to the mainstream economics of today. If my profession is slanted toward any particular world view, I am as guilty as anyone for perpetuating the problem.

Yet, like most economists, I don’t view the study of economics as laden with ideology. Most of us agree with Keynes, who said: “The theory of economics does not furnish a body of settled conclusions immediately applicable to policy. It is a method rather than a doctrine, an apparatus of the mind, a technique for thinking, which helps the possessor to draw correct conclusions.”

That is not to say that economists understand everything. The recent financial crisis, economic downturn and meager recovery are vivid reminders that we still have much to learn. Widening economic inequality is a real and troubling phenomenon, albeit one without an obvious explanation or easy solution. A prerequisite for being a good economist is an ample dose of humility.

My fervent hope is that any students who are still protesting the class will return — and that, while recognizing our limitations, they will learn from us what they can. A few might choose to become economic researchers themselves. Their contributions will surely be welcome. They might even improve the next generation of textbooks.

N. Gregory Mankiw is a professor of economics at Harvard. He is advising Mitt Romney, the former governor of Massachusetts, in the campaign for the Republican presidential nomination.