US stocks rise but close lower for the week as investors mull mixed bag of corporate earnings