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
Forming new variable using several existing variablesHi, I am trying to create a variable "IN" that takes value from existing variables "IN_1 IN_2 IN_3 I…
logit regression with categorical variables: obtain p-value of the difference to the basecategoryHi, I am trying to estimate a logit model using survey data. I have a categorical variable (age gro…
how to keep month end data from daily data (with various month-ending dates)Dear All, I have a daily data set with different month-ending date (sometime on 27 or 28 or 29 or 30…
Different results between Heckman model and separate probit + OLSDear Statalist I'm running a Heckman model and I wanted to compare the results of the Heckman model…
If else inside for each loopI am trying to run the following code and it does not seem to be working. I want to change the refer…
Subscribe to:
Post Comments (Atom)
0 Response to Reshape Long to Wide to create dummy variables
Post a Comment