Hello,
I am new to Stata and I am having the same problem as Alyssa Beavers mentioned in her post "Help with strtrim", except the suggested solution does not work in my case. I use Likert variables (imported from Excel) and some values have trailing spaces ("très bien " and "assez bien ") for the example below (the variable type is str27):
list SentBien in 1/10
+-----------------+
| SentBien |
|-----------------|
1. | très bien |
2. | légèrement bien |
3. | très bien |
4. | assez bien |
5. | assez bien |
|-----------------|
6. | assez bien |
7. | légèrement bien |
8. | neutre |
9. | assez mal |
10. | neutre |
+-----------------
I executed the command "replace SentBien = strtrim(SentBien)" without error but I received the message "(0 real changes made)".
It seems that the blank space in the value is not the regular blank space from my keyboard because if I type the command ---- count if SentBien=="très bien " --- it returns 0 but if I copy paste the "très bien " from the screen, then the command returns 108. However, in both cases, there is (what seems to be) one blank space at the end of the string.
Do you have an explanation of this? And a solution to still delete those trailing spaces?
Thank you in advance for your help!
Related Posts with Help with strtrim 2
"0 (empty)" during logistic regressionI was measuring odds ratio for systolic hypertension using bmi as a variable, but when I do so the 4…
Regarding use Matchit to fuzzy merge two different data setHello everyone, I am trying to merge two data set by their unique string variables. However, these …
Graph of Parallel Trend LinesHello, I have the data set below. This is a data set of total number of visits to the emergency room…
calculating how percentiles performed in a panel datasetDear Statalist, My panel dataset is as follows year firm size sales 2000 firm1 size1 sales1 …
Filling missing observations with successor and predecessors ID's valuesDear Stata Users, Can you please help me with the following issue: I have a company (“gvkey”) with a…
Subscribe to:
Post Comments (Atom)
0 Response to Help with strtrim 2
Post a Comment