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*
How to run marginal effect for multinomial probit in STATAMy dependent variable has four categories, including 1) working & studying; 2) working but not s…
Transforming VariablesHI! if i want to (using data from January 1971 to December 2020) transform the the month and year va…
How to detect sources of variations in coefficients obtained from a panel data regression?Is it possible to identify whether and how cross-sectional variation and/or time-series variation co…
HELP!! Interpreting logged dependant varaible, when its a ratio.Hi Guys, I apologise if this question is hard to read. I'm currently analysing a regression in whic…
random numbers to groups of random sizeHi Statalisters! I have the following problem. I have N individuals and I would like to assign to t…
Subscribe to:
Post Comments (Atom)
0 Response to Grouping variables to create a master variable - possible? *Bangs Head*
Post a Comment