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
Identifying common observations between two groupsDear Statalist, I have a dataset with firms and owners. This is a minimum working example: Code: *…
Standard errors and 95% Confidence Intervals for Proportions - Differences between different Stata versionsDear community: I am having doubts about how Stata calculates standard errors and 95% confidence in…
sqom subcost matrix problem?Hi, I am trying to run the latest version of sqom on Stata16 using subcost(meanprobdistance) and am…
Commands for sleep and retry if a file being accessed at the momentI have multiple instances of Stata accessing the same excel file to record some information. Every o…
Histogram with lpattern(non-solid line) adds a weird slant lineHi all, I have just found that, when I specify 'lpattern(dash)' or 'dot' or, anything other than the…
Subscribe to:
Post Comments (Atom)
0 Response to Convert composite string variable delimited by commas into separate dummy variables
Post a Comment