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*
Value ReplacementDear all, I am quite new with stata, and after a couple of days trying to fix a problem without any…
Fraction By GroupDear Stata Users; I have cross sectional data constructed by combining two waves of surveys. The edu…
Wilcoxon test for (in)equality of mediansHello everyone, For my univariate analyses I am running a number one-sample t-tests. However, I woul…
Quarterly GDP disaggregation to monthly levels - Gravity model estimationDear Forum, I am currently working on a gravity model to estimate the effects on trade of an exogen…
Stop dofile if drop did not make changeDear Statalists, for error-checking in many replace commands, I have found it useful to use the pro…
Subscribe to:
Post Comments (Atom)
0 Response to Grouping variables to create a master variable - possible? *Bangs Head*
Post a Comment