McGraw Hill, Inc., the giant communications conglomerate, has agreed to acquire Data Resources Inc., one of the nation's best known economic forecasting concerns for $103 million.

D.R.I., headed by Harvard economics Prof. Otto Eckstein has been troubled in recent weeks by a defection of seven of its top executives who reportedly are going to set up their own economic consulting firm.

McGraw Hill said that Eckstein and several other top D.R.I. officials have agreed to sell McGraw-Hill their 912,000 shares - 45 percent of those outstanding - for $50 a share.

McGraw Hill will make the same $50 offer to other holders of D.R.I. stock, which has been traded over the counter since D.R.I. went public in 1976.

D.R.I. stock climbed $14.25 a share after the agreement was announced Friday, closing at $47.25. McGraw Hil closed down 50 cents a share at $24.

Earlier this year, McGraw Hill spent million of dollars to ward off a takeover bid by American Express co. The merger Announced today, however, is a friendly one and received unanimous approval of D.I. directors.

D.R.I. was founded in 1968 and made its mark providing monthly economic forecasts using a computer-simulated model of the economy. Eckstein's clients, which include more than half of the biggest companies in America, pay the company more than $50,000 a year for the forecast.

The company had revenues of $31.5 million. Eckstein will continue to run the company, according to McGraw-Hill.

Over the past five years, revenues have grown at a rate of more than 40 percent. D.R.I. stock split three for two in February.

Since Eckstein and his family own about 25 percent of the 2.03 million shares of D.R.I. stock, the deal with McGraw-Hill will make them millionaries many times over.

Although D.R.I. officials have admitted they were shocked by the massive defection of executives in early July, they say that the company has not been wounded bably.

Some observers have suggested that the fast growth of the company had impaired communication among executives, prompting the departures. Five marketing executives, the manager of the west coast office and two top research economists left the firm.