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!
Related Posts with Generating new variables using an if function
Multilevel Modeling with Complex Survey DesignUsing sipp data, I am examining whether those at the lower end of income distribution are more likel…
Why and when is panel data preferrable to pooled cross-sectional?Not sure if non-Stata econometric questions are welcome here, but I've encountered an issue at work.…
Labels on categorical variables lost when using esttabHi Statalisters. I am trying to incorporate key results from 5 model runs into a summary table usin…
extract year from a variableDear All How can we extract year, month and day from a varibale. Please find attached the example …
Question of generationg average variable in certain rangehi, guys I have a problem relating to generate new varible( basic data structual is as follows). I w…
Subscribe to:
Post Comments (Atom)
0 Response to Generating new variables using an if function
Post a Comment