I dreamed up these two sentences. I did some research. It seems that they are both correct. I understand that,in Sentence 1, the implied subject of "accounting" is the subject of the first clause — food. What I don't understand is why Sentence 2 is correct. In Sentence 2, the implied subject of the second clause is not the same as the subject of the first clause.
My grammar book says that we can omit the subject of the second clause and change the verb to the "ing" form when the subject same is the same as the subject of the first clause. It doesn't say that we can do this when the subjects are not the same. In Sentence 2, the subject of the first clause is "families". But what "accounting" needs is "food".
- Food was the biggest expenditure for families, accounting for 35% of their weekly income.
- Families spent most on food, accounting for 35% of their weekly income.