I have a variable in my dataset called fbnone, representing if respondents to a survey have no fringe benefits. It is a dummy variable where if they have no fringe benefits it is equal to 1 and if they do have fringe benefits it is equal to zero. However, I also have two other variables flextime and transitbenefits which I would like to include in fbnone. Basically, I want my new variable FBNone to be 1 if (fbnone=1, flextime=0, and transitbenefits=0). How would I go about generating this variable?
Related Posts with Generating a variable using several other variables
nwcommands question: nwhierarchyI'm using nwhierarchy as part of Thomas Grund's nwcommands package. I am using something like this c…
RIF- Regression Unconditional Quantile Regression (Counterfactual Decomposition)Dear STATA Seniors and Pros, I seek your guidance in regard to a few confusions that I am currently…
Plotting Y1 and Y2 variable on a Time Series Line Plot Code: * Example generated by -dataex-. To install: ssc install dataex clear input double(prod op) …
ds vs display loopHello, Can anyone help me identify why: Code: foreach var of varlist `contvarlist' { …
Question on analyzing multiple answers questionI have a data set of 987 respondents. I asked them on there most common sources of treatment and the…
Subscribe to:
Post Comments (Atom)
0 Response to Generating a variable using several other variables
Post a Comment