Dear Stata community,
I have the following string variable r1etab that has multiple observations separated by a space as follows:
r1etab Freq. Percent Cum.
--- 31 9.87 9.87
attention_rapide 15 4.78 14.65
attention_rapide autre_a_preciser 1 0.32 14.97
autre_a_preciser 9 2.87 17.83
bon_service 11 3.50 21.34
bon_service attention_rapide 16 5.10 26.43
bon_service medicaments_facilement_di.. 4 1.27 27.71
medicaments_facilement_disponibles 6 1.91 29.62
medicaments_facilement_disponibles au.. 20 6.37 35.99
proximite 79 25.16 61.15
proximite attention_rapide 7 2.23 63.38
proximite bon_service 10 3.18 66.56
proximite bon_service attention_rapide 1 0.32 66.88
proximite bon_service medicaments_fac.. 3 0.96 67.83
proximite medicaments_facilement_disp.. 4 1.27 69.11
proximite service_abordable 11 3.50 72.61
proximite service_abordable bon_servi.. 1 0.32 72.93
proximite service_abordable bon_servi.. 2 0.64 73.57
service_abordable 7 2.23 75.80
service_abordable attention_rapide 27 8.60 84.39
service_abordable bon_service 42 13.38 97.77
service_abordable bon_service attenti.. 3 0.96 98.73
service_abordable bon_service medicam.. 1 0.32 99.04
service_abordable medicaments_facilem.. 3 0.96 100.00
When I tabsplit, the result is what I would like to have as a variable with observations
r1etab Freq. Percent Cum.
31 6.40 6.40
attention_rapide 71 14.67 21.07
autre_a_preciser 30 6.20 27.27
bon_service 94 19.42 46.69
medicaments_facilement_disponibles 43 8.88 55.58
proximite 118 24.38 79.96
service_abordable 97 20.04 100.00
Total 484 100.00
I would like to have a variable that splits these observations, not make them separate variables as I have seen in other posts about extracting string variables. Thank you!
Related Posts with Substring strvar into observations, not variables
Clarification on choice of random seeds and how often to set seedsStata's help documentation for set seed (https://www.stata.com/manuals/rsetseed.pdf) emphasizes that…
Breusch and Pagan testHi everyone, I'm doing a research for my thesis about OECD countries, I've done some regressions and…
Trouble adding province-year fixed effects to a 2SLS model using ivreg2I have compiled 5 cycles of survey data (so I have repeated cross sectional data). I want to add pro…
Making a descriptive tableHello, I have the following dataset: Code: * Example generated by -dataex-. To install: ssc inst…
How to rename x variables in a bar graph?My dichotomous independent variable is coded as 0 and 1, and remains shown as 0 and 1 in a bar graph…
Subscribe to:
Post Comments (Atom)
0 Response to Substring strvar into observations, not variables
Post a Comment