I am trying to sort income based on marital Status and then generate new adjusted income based on tax brackets. There is one variable "income" and then another variable "married". The income variable just has the total income. The "married" variable has either the value 1 (which corresponds to being married) or 2 (which is a single filer).

How do I generate two new variables based on marital Status? So a married income and a single income?

I have tried using this, but it doesn't work.

gen incsing = income if married = 2

Please help!