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
stset with multiple failure per subject dataHi everyone, I would like to ask for some advice on stset-ing my dataset with multiple failures per…
Ranking means from highest to lowest after bysort occupation: sumDear all, I would like to know how to rank means from highest to lowest after the following command…
Calculating weight for age z-scores in stataDear colleagues am trying to calculate weight for age z-score in stata but am just getting value 99 …
Creating funnel plots in meta-analyses of proportion studiesHi all, Hunter et al (https://doi.org/10.1016/j.jclinepi.2014.03.003) suggested that conventional fu…
Adding variables with partial common namesHi, I have variables such as fac_tot30_outpatient and prof_tot30_outpatient, which I want to sum by…
Subscribe to:
Post Comments (Atom)
0 Response to Substring strvar into observations, not variables
Post a Comment