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
Finding "new" occurrences in panel dataDear Stata Users, I am trying to identify when an observation is a "new "occurrence in within a pan…
How to standardize variables to make max value 1 and min value -1 ?Hello, I am having trouble standardizing to standardize some panel data from VDEM. The data doesn't…
xteprobit convergece failHi, I tried to estimate a probit panel data model with endogenous binary variable using xteprobit. F…
Bivariate and Multiple linear regressionHello guys, I have cross-sectional data and I intend to perform a bivariate (linear) regression and…
Intergrowth 21th neonatal birth weight standard commandHi all I am trying to calculate the proportion of newborns born small-for-gestational age for newbo…
Subscribe to:
Post Comments (Atom)
0 Response to Generating new variables using an if function
Post a Comment