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
what does this mean?Number of obs = 20 F(3, 16) = 31.78 Prob > F = 0.0000 R-squared = 0.8438 Root MSE = 4.8689 -----…
Problem with a program that will open a dataset with a user defined list of variablesHi all, I'm creating a STATA program that will: 1. open a dataset, 2. keep a user defined list of v…
matching variablesDear Statalist masters, I have a problem that I don't know how to code properly. I have investors (…
When I enter "logit" or "logistic", error message "unrecognized command: _vce_parserun" shows up.Dear members of statalist, I'm having trouble with using logistic regression. Depvar consists of 0,…
Graphs with mi estimatesDear all, I am currently working with a multiple imputed survey and want to create graphs out of th…
Subscribe to:
Post Comments (Atom)
0 Response to Help with strtrim 2
Post a Comment