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*
Random allocation of observationsDear Community. I have about five million observations(men, age 40s). I'd like to classify these 5…
Confusion about Confirmatory Factor Analysis with validscaleDear all, I am new to STATA and try to test the validity of my measures. I run Stata 16 for Microso…
chaning time to minutes.I have a variable where the data er described as 6D 21H 52M 0S (d= days, H= hours, M=minutes, S= sec…
Piecewise regression with panel dataDear. Statalist I am trying to do a piecewise regression with panel data but I can't find out much …
Matrix, standard deviation of each rowI have a matrix that is 12 rows by 500 columns. I would like to take the average and standard deviat…
Subscribe to:
Post Comments (Atom)
0 Response to Grouping variables to create a master variable - possible? *Bangs Head*
Post a Comment