Anderson and Perot had similar base: both were very strong in New England and Rocky Mountain West, as they appealed to libertarians, moderate Republicans, and others who did not like the two parties. Anderson probably cost Carter MA, VT, ME, NY.
He definitely cost Carter Massachusetts. Reagan won the state by only 0.15%, and it was the first time since 1956 that it had voted Republican. Ted Kennedy primary supporters probably comprised a large portion of Anderson's support there, and some also went to Reagan. Carter was never that popular in Massachusetts-in 1976, he actually underperformed McGovern throughout much of the state, particularly in Boston, despite receiving a much higher nationwide percentage than McGovern did.
Busing Crisis is the reason for Carters underperformance in 1976.