Nearly 4 in 5 US companies have posted second-quarter earnings that beat Wall Street estimates