I currently have data that looks like this:
a X 0
a Y 0
a Y 1
b X 0
b Y 0
b Z 1
c X 1
c Y 1
c Z 0
Where abc is the individual, XYZ is the method, and 01 is whether that individual uses that method.
How do I reshape my data so that I have dummy variables for each method that take the value 1 if that individual uses that method?
Thank You
Related Posts with Reshape Long to Wide to create dummy variables
Cohort variableHello! I am using data about households and I am interested in analyzing homeownership and mortgage …
Mediation analysis using path models with continuous mediator and binary outcomeDear Statalisters, I am performing a mediation analysis using path models (using sem or gsem) where…
Randomly generating an ID which is same for duplicates of an observationThere are 4 states coded 1,2,3 and 4. Within each state, I have generated a unique id to identify mo…
Calling a program whose name is a localHi all, My question is quite straightforward I guess but I did not find any answer on the web. Let…
Wishlist for Stata 17In the spirit of previous threads serving the same purpose, please use this thread to add your desir…
Subscribe to:
Post Comments (Atom)
0 Response to Reshape Long to Wide to create dummy variables
Post a Comment