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
Numbers instead of variable namesI downloaded a .dta file. All of the variable names are numbers. Is there anything I can do to fix t…
Individual level data, Clustering Standard Error at city level, IV regression need syntax helpSay your data is at individual level, instrument and independent variable at city level, data on 2 y…
MICE for single imputationHello, I am wondering if you can use multiple imputation for chained equation (MICE) to just perfor…
Stata code wighted census data for PCAHello all, I am new to the Stata Community and working on the 2016 Canadian census of population mi…
Plot interaction effect after stcox with tvc?Since proportional hazards assumption is violated, I use tvc option to estimate my model, which surp…
Subscribe to:
Post Comments (Atom)
0 Response to Reshape Long to Wide to create dummy variables
Post a Comment