Hi all,
I'm new to Stata and am running into trouble with setting up a dataset for use.
The issue is that I have a composite categorical variable, with multiple entries per observation that are separated by commas (e.g., "A,B,C"). Each entry is a single word, but as answers were written in, there are a great many different entries. My goal is to convert this variable into a series of binary variables, each taking the name of an entry, and taking a value of 1 if the particular word was present in the original variable.
I have tried following the advice given for a similar topic here, but have been unable to successfully adapt it to my case.
Any advice would be greatly appreciated!
Best,
Ben
Related Posts with Converting Composite Categorical Variables to Binary Variables
Stata 17: How to put Confidence Intervals on either "graph bar" or "graph hbar" with Survey DataDear Statalist Users, Good morning. I have two quick questions to ask you : How can we add some co…
Problem in using simarwilson commandHello all! For a research investigation of mine, I wish to estimate two-stage DEA-bootstrap regressi…
Need help with DD analysis.Is there anyone who cam help wit DD analysis (canonical) for like 45 mins via zoom call? …
Multiplying with missing valuesI want to generate a new variable showing total hours of care per month. I generate this variable ba…
vertical line graph two wayDear all 1) I'd like to put a vertical line on the x-axis in my Stata Graph. I need this line to sh…
Subscribe to:
Post Comments (Atom)
0 Response to Converting Composite Categorical Variables to Binary Variables
Post a Comment