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
Problems with -asdoc- commandHello all, I am having issues with the -asdoc- command after first installing it from -ssc install-…
Export mdesc table to ExcelI am wondering if there is way to export (not copy paste) and mdesc table (run on the full set of my…
Marginal effects for interaction after MlogitDear all, I'm new in this forum and also pretty new to Stata, so I don't know if my question is act…
Displaying mean values for groups on a lineHello Statalisters, I wish to display the means of a continuous variable for different values of a …
mata object already exists error when using stats() option with estimates tabesttab works fine to give me the N but estimates tab won't give me any thing with the stats option .…
Subscribe to:
Post Comments (Atom)
0 Response to Help with strtrim 2
Post a Comment