Isador Lubin, 82, the economist and statistician who had served as a special adviser to President Roosevelt and Truman in World War II, died of a heart attack Thursday at Anne Arundel General Hospital in Annapolis.

A resident of New York City for many years, he had maintained a summer home at Wild Rose Shores in Annapolis since the 1930s, when as the nation's chief statistician, he was a leading member of the New Deal "Brain Trust."

During his later years of public service, Mr. Lubin was U.S. respresentative to the Economic and Social Council of the United Nations and then New York State's industrial commissioner.

He first worked for the federal government in 1918-19, when he was a statistician in the Food Administration and served with the War Industries Board. He returned to federal service in 1933 when he was named commissioner of the Bureau of Labor Statistics in the Department of Labor, a position he held until 1964.

As this country's entry into World War II approached, Mr. Lubin was called to the White House to draw up the a daily picture of the status of America's armament program.

Each morning Mr. Lubin worked in a tiny office with two other men, interpreting volumes of figures that poured in fromgovernment statistical agencies bearing on the arms program. He spent his afternoons back at the Bureau of Labor Statistics. He was known as a tireless worker.

The story was told of how a shipyard official once told him he was crazy to work 18 hours a day for a mere $9,500 a year when he could earn $30,000 a year in a comparatively easy job at the shipyard. Why did he do it, he was asked.

At that point, Mr. Lubin's telephone rang and he answered a query quickly, then hung up and turned to the shipyard executive.

"Do you know who that was?" Mr. Lubin asked. "I'll tell you. It was the president of the United States. Mr. Roosevelt is to make a speech and he asked me if he would be correct if he made a certain statement. I told him no, and I suggested a change which he accepted."

Mr. Lubin then smiled and threw out this challenge: "I'll bet you'd give $30,000 a year for the thrill of advising the president." The shipyard official agreed that he would.

In the early part of 1964, Mr. Lubin resigned as commissioner of labor statistics but was appointed that year by President Truman to be this country's representative on the U.N. Economic and Social Council.

In 1951, Truman gave him the additional position of U.S. representative on the advisory committee to the U.N. Korean Reconstruction Agency.

Mr. Lubin resigned both posts in 1953 shortly after the Eisenhower administration began. Two years later, he was named industrial commissioner of New York state by then governor Averell Harriman, a position he held until 1959.

"The death of Isador Lubin leaves a void in my life. I've known and worked with him since the early New Deal days in the 1930s. He was a man of extraordinary understanding of the problems of the United States and had a sound vision of its future. He made major contributions to the federal government and in New York state in dealing with labor problems and furthering social programs," Harriman said yesterday.

Born in Worcester, Mass., Mr. Lubin was a graduate of Clark University there. He taught economics at the University of Missouri, where he earned a master's degree.

After his government service in World War I, Mr. Lubin taught economics at the University of Michigan. He became a member of the Brookings Institution staff in 1922, and of the teaching staff of its Robert Brookings Graduate School, which awarded him a doctorate. He remained at Brookings until 1933.

After his service with the New York State government, he was Vanderbilt professor of public affairs at Rutgers University for several years.

Mr. Lubin was an economc consultant to the Twentieth Century Fund from 1960 until two years ago. He also had been a consultant to the United Israel Appeal from 1961 until his death.

He served on the boards of Brandeis University, the New School for Social Research and the Weizmann Institute in Israel.

Mr. Lubin was the author of numerous books and monographs. He was a Fellow of the International Institute of Statistics, the American Statistical Association, of which he had been president, and the American Economics Association.

He is survived by his wife, Carol Riegelman Lubin, of the homes; two daughters, Alice L. Everitt, of Washington, and Ann L. Buttenwieser, of New York City; a sister, Marion Lubin, of Worcester, and four grandchildren.