US stocks end varied week