A few weeks ago, I drove to my local city hall and changed my voter registration from Republican to independent. That was a momentous change for me, a lifelong Republican.

My allegiance to the G.O.P. was initially familial. My father had grown up in the 1920s and 1930s in Bayonne, N.J., a city that he said was run by a corrupt Democratic machine. He became a Republican to support the rule of law rather than party bosses. When I was a child, he had me deliver Republican campaign fliers door to door, long before I had any idea what politics was all about.

My real political views started forming when I studied economics in college during the 1970s and read the works of Milton Friedman, the defender of free markets and limited government. His book “Capitalism and Freedom” remains one of my favorites. Friedman associated himself with the Republican Party, making me comfortable there as well.

Early in my career, my own work was academic and far from politics. Most people assumed I was an independent or a Democrat, like most Harvard professors. In 1992, shortly after Bill Clinton became president and started tapping some of my colleagues for jobs, a college dean said: “Greg, I asked someone whether you might be joining the new administration. But he told me that you are a Republican. Could that possibly be true?” He was incredulous.