The Globe reviewed the most recent publicly available salary data in all 50 states in a bid to compare the pay of Massachusetts’ top officials to their counterparts nationally. How states determine their elected officials’ pay varies drastically: Some entrust a separate committee to recommend whether elected officials deserve a raise; others leave it to the political will of the current Legislature. The 2017 Massachusetts law specifically barred many officials from actively earning outside income, while creating a specific measure to automatically adjust their pay: Raises, or decreases, happen every two years based upon quarterly changes in statewide salaries and wages, as determined by data from the Bureau of Economic Analysis.