Stocks end higher after upbeat economic data