S&P 500 caps off its best week of the year after strong economic data