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
xtpmg error message when running on logged variablesDear Statalist users, I am running xtpmg on stata 16.0. Running it on my level variables doesn't po…
R (109) error codeHello all, apologies if this is a silly Q but I am a very newbie in Stata and just learning it! I …
Ado fastcd: "command fastcd is unrecognized"Hello, I installed the fastcd ado (via search 'fastcd' and then install 'fastcd from http://fmwww.bc…
How to create new variables from date variables?Hi, I am working with a medicinal tests dataset. Three tests can be prescribed. The doctor can pres…
Rolling yearly earningsHi all, I am working on a dataset consisting of quarterly company data with multiple companies over…
Subscribe to:
Post Comments (Atom)
0 Response to Generating new variables using an if function
Post a Comment