If you are unhappy, does starting to greet your neighbor makes your happier? Or is it the other way around, when you are happy you greet your neighbor.
This sounds like a "one little weird trick to boost your happiness: greet six neighbors."
The important factors are the other things: having a high income, living in a good neighborhood, and and being a good community member. These increase your wellbeing, then of course you'll say hi to everyone.