Hello all! My colleague and I have been banging our heads over this.
I have a dataset that I am working with that was built off of a survey about overdoses on certain drugs. I'm trying to combine variables where the data is either 1 (yes) or 0 (no) to create a master variable - imagine the variable will only return the drug mentioned if it was a 1. The variables are about 20 different types of drugs and I want to group them into drug types and have the variable return the data only when it is indicated yes. For reference I've attached an example. I want to list heroin_num-alcohol_num into a new group.
I also created a listeddrugs variable using the grouplabs command and it's come in handy but not doing what I asked. I'd like to use this new variable to run specific statistics and visuals.
Hope this makes sense!
ThanksArray
Related Posts with Grouping variables to create a master variable - possible? *Bangs Head*
Several updates and new packages on SSC (heatplot, colrspace, palettes, robstat, robbox)I made several additions and updates to packages on SSC over the last months about which I never inf…
Transforming Ordinal Variable to Continuous VariableI have an ordinal variable having the categories 0, 1, 2, 3, 4. The categories are based on an unkno…
Moderators in DID regressionHello everyone. I am writing my thesis and I am not sure if what I am doing with DID on Stata is cor…
ivreghdfe interaction term!Hello, I'm using ivreghdfe and need to interact my instrument with a categorical variable. Could so…
hausman test after heckmandear all I hope to use hausman test after heckman is there any way to test hausman after heckman? …
Subscribe to:
Post Comments (Atom)
0 Response to Grouping variables to create a master variable - possible? *Bangs Head*
Post a Comment