U.S. stock indexes closed mostly higher Friday as gains for energy, phone and industrial companies made up for losses elsewhere.

Real estate and utilities companies were among the biggest decliners. Some health insurers bounced back as support dwindled for the Senate Republicans’ latest effort to roll back the Affordable Care Act. A slide in bond yields weighed on bank shares.

On Friday:

The Standard & Poor’s 500 index rose 1.62 points, or 0.1 percent, to 2,502.22.

The Dow Jones industrial average shed 9.64 points, or 0.04 percent, to 22,349.59.

The Nasdaq composite added 4.23 points, or 0.1 percent, to 6,426.92.

The Russell 2000 index of smaller-company stocks gained 6.60 points, or 0.5 percent, to 1,450.78, a record.

For the week:

The S&P 500 is up 1.99 points, or 0.1 percent.

The Dow is up 81.25 points, or 0.4 percent.

The Nasdaq is down 21.55 points, or 0.3 percent.

The Russell 2000 is up 19.07 points, or 1.3 percent.

For the year:

The S&P 500 is up 263.39 points, or 11.8 percent.

The Dow is up 2,586.99 points, or 13.1 percent.

The Nasdaq is up 1,043.80 points, or 19.4 percent.

The Russell 2000 is up 93.65 points, or 6.9 percent.