Gross profit was $11.8 million for the nine months ended September 30, 2022, an increase of $5.1 million, or 76%, over the nine months ended September 30, 2021. Gross margin increased to 77% for the nine months ended September 30, 2022, compared to 72% for the nine months ended September 30, 2021. Gross margin for the nine months ended September 30, 2022 was higher due to a decrease in the cost per unit and an increase in the average selling price. This was partially offset by a larger percentage of our revenue units coming from full systems versus battery replacements.
Research and development expenses
R&D expenses increased $1.2 million, or 21%, to $6.9 million for the nine months ended September 30, 2022, compared to the nine months ended September 30, 2021. This change was primarily driven by a $1.3 million increase in compensation expenses, mainly as a result of increased headcount, partially offset by a $0.1 million decrease in clinical study expenses.
Selling, general and administrative expenses
SG&A expenses increased $17.7 million, or 98%, to $35.9 million for the nine months ended September 30, 2022, compared to the nine months ended September 30, 2021. This was primarily driven by a $9.9 million increase in compensation expenses, mainly as a result of increased headcount, a $1.8 million increase in travel expenses, a $1.6 million increase in non-cash stock-based compensation expense, a $1.5 million increase in marketing and advertising expenses associated with the commercialization of Barostim in the U.S., a $1.3 million increase in public company costs, and a $1.2 million increase in consulting fees.
Interest expense
Interest expense decreased $1.8 million for the nine months ended September 30, 2022, compared to the nine months ended September 30, 2021. This decrease was driven by the repayment of the outstanding debt under the Horizon loan agreement in November 2021.
Other income (expense), net
Other income, net was $0.2 million for the nine months ended September 30, 2022, compared to other expense, net of $13.4 million for the nine months ended September 30, 2021. The expense for the nine months ended September 30, 2021 was primarily driven by the increase in fair value of the convertible preferred stock warrant liability from December 31, 2020 to July 2, 2021, which is the date the warrants converted to common stock warrants. As these preferred stock warrants converted to common stock warrants upon the IPO, there is no longer a change in fair value recorded in other income (expense), net.
Provision for income taxes
Provision for income taxes was nominal for each of the nine months ended September 30, 2022 and September 30, 2021.
Liquidity, capital resources and plan of operations
We have incurred significant operating losses and negative cash flows from operations since our inception, and we anticipate that we will incur significant losses for at least the next several years. As of September 30, 2022 and December 31, 2021, we had cash and cash equivalents of $110.0 million and $142.1 million, respectively. For the three months ended September 30, 2022 and 2021, our net losses were $9.8 million and $6.1 million, respectively. For the nine months ended September 30, 2022 and 2021, our net losses were $30.9 million and $32.5 million, respectively. Our net cash used in operating activities for the nine months ended September 30, 2022 and 2021 was $31.8 million and $20.7 million, respectively.
Prior to the IPO, our operations were financed primarily by aggregate net proceeds from the sale of our convertible preferred stock of $383.1 million, as well as debt financings. In September 2019, we entered into