Hi, I have observations of building tenants which has a string variable recording the floors they occupy delimited by commas (e.g. ‘GRND,1st,MEZZ,4-6’), and for each of these observations I would like to convert this into separate dummy variables for each floor occupied (i.e. in the case above, create dummy variables coded ‘1’ for GRND, 1, MEZZ, 4, 5, and 6). Does anyone know how I might code this?
Cheers
Related Posts with Convert composite string variable delimited by commas into separate dummy variables
Dropping duplicates based on another variableI have a large dataset with patient encounters, of which some patients may have had multiple encount…
svmachinesI am trying to run svmachines command and this syntax, when I run this in CV and Test predictions I …
Create a duplicates drop logic working for missing valueHi Statalisters, I am working on my data cleaning and have such a problem. When I use duplicat…
Random and fixed effects logistic regressionHello everyone, I am working with a database that have information on a survey asking for mosquito …
Testing for Non-linearity in Fixed EffectsHello, I am running individual FE models where my dep variable (DV) is treated as continuous but it…
Subscribe to:
Post Comments (Atom)
0 Response to Convert composite string variable delimited by commas into separate dummy variables
Post a Comment