June 30, 2023 was 62.2% compared to 53.5% for the comparable 2022 period. Our GAAP loss ratio excluding loss adjustment expenses for the six months ended June 30, 2023 was 69.0% compared to 54.4% for the comparable 2022 period. Total prior year favorable development included in the pre-tax results for the three months ended June 30, 2023 was $9,988 compared to $16,861 for the comparable 2022 period. Total prior year favorable development included in the pre-tax results for the six months ended June 30, 2023 was $21,521 compared to $29,273 for the comparable 2022 period. The decrease in the prior year favorable development in 2023 is primarily related to the reversal of $6,500 legal expense reserve during the second quarter of 2022.
Underwriting, Operating and Related Expenses. Underwriting, operating and related expenses for the three months ended June 30, 2023 increased by $1,710, or 2.8%, to $62,582 from $60,872 for the comparable 2022 period. Underwriting, operating and related expenses for the six months ended June 30, 2023 increased by $149, or 0.1%, to $122,615 from $122,466 for the comparable 2022 period. The slight increase in the three months and six months ended June 30, 2022 is driven by an increase in base commissions resulting from the increase in written premiums, offset by a decrease in contingent commission expenses. Our GAAP expense ratio for the three months ended June 30, 2023 decreased to 30.9% from 32.3% for the comparable 2022 period. Our GAAP expense ratio for the six months ended June 30, 2023 decreased to 31.1% from 32.6% for the comparable 2022 period.
Interest Expense. Interest expense was $348 and $131 for the three months ended June 30, 2023 and 2022, respectively. Interest expense was $558 for the six months ended June 30, 2023 compared to $260 for the comparable 2022 period. The credit facility commitment fee included in interest expense was $37 for the six months ended June 30, 2023 and 2022. The increase in interest expense is due to higher interest rates on outstanding debt in 2023.
Income Tax Expense. Our effective tax rate was 20.8% and 20.1% for the three months ended June 30, 2023 and 2022. The effective tax rate was 24.3% and 21.3% for the six months ended June 30, 2023 and 2022. The effective rate in 2023 was higher than the statutory rate primarily due to effects of the change in unrealized gains on equity securities and the impact of stock-based compensation.
Net Income. Net income for the three months ended June 30, 2023 was $17,001 compared to net income of $7,901 for the comparable 2022 period. Net income for the six months ended June 30, 2023 was $4,664 compared to net income of $15,739 for the comparable 2022 period.
Non-GAAP Operating Income (loss). Non-GAAP operating income, as defined above, was $11,993 for the three months ended June 30, 2023 compared to $28,230 for the comparable 2022 period. Non-GAAP operating loss was $803 for the six months ended June 30, 2023 compared to Non-GAAP operating income of $43,039 for the comparable 2022 period.
Liquidity and Capital Resources
As a holding company, Safety’s assets consist primarily of the stock of our direct and indirect subsidiaries. Our principal source of funds to meet our obligations and pay dividends to shareholders, therefore, is dividends and other permitted payments from our subsidiaries, principally Safety Insurance. Safety is the borrower under our credit facility.
Safety Insurance’s sources of funds primarily include premiums received, investment income, and proceeds from sales and redemptions of investments. Safety Insurance’s principal uses of cash are the payment of claims, operating expenses and taxes, the purchase of investments, and the payment of dividends to Safety.
Net cash used for operating activities was $13,438 and $275 during the six months ended June 30, 2023 and 2022, respectively. Our operations typically generate positive cash flows from operations as most premiums are received in advance of the time when claim and benefit payments are required. Positive operating cash flows are expected in the future to meet our liquidity requirements.
Net cash provided by investing activities was $45,694 and $17,117 during the six months ended June 30, 2023 and 2022, respectively. Fixed maturities, equity securities, and other invested assets purchased were $64,290 for the six