State-variable public goods and social comparisons