Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Resolving Data Inconsistencies in Survey Responses

    Hi,

    I am currently tabulating a string variable, and I've noticed an issue: the enumerator recorded "Don't know" in two different formats. I'm having trouble resolving this. I've attached the results for your reference.

    Code:
     . tab vwsc_functionality
    
    vwsc_functio |
          nality |      Freq.     Percent        Cum.
    -------------+-----------------------------------
      Don't Know |         54        4.21        4.21
      Don’t know |         65        5.06        9.27
              No |        280       21.81       31.07
             Yes |        885       68.93      100.00
    -------------+-----------------------------------
           Total |      1,284      100.00
    
    


    I’m not sure how to fix this. I look forward to your guidance.

    I have attached a screenshot for your reference also.

    Thank you.


    Click image for larger version

Name:	tabulation.png
Views:	3
Size:	13.6 KB
ID:	1765021
    Attached Files

  • #2
    Look closely at the apostrophe's in the two different versions of "Don't know." They are different. Then also look at the k's: one us upper case and the other is lower case.

    As for fixing the situation, it depends a bit on information not available from what is shown. The first question is whether this variable is a string variable or is a value-labeled numeric variable. If it's numeric, just run -label list XXXX- (replacing XXXX by the name of the value label attached to the variable.) Then use -recode- or -replace- to change one of the numeric values of "Don't know" to the other. You might also then want to modify the value label to whatever spell-out of "Don't know" you prefer. (My personal preference would be Don't know.)

    If it's a string variable, then just run
    Code:
    replace vwsc_functionality = "Don't know" if inlist(vwsc_functionality, "Don't Know",  "Don’t know")
    To be sure that you properly capture the different apostrophe's in this command, it is best to copy/paste them from the -tab- output rather than trying to type them.

    Comment


    • #3
      Clyde Schechter, Thank you for your response. I apologize for my delayed reply, and unfortunately, your previous suggestion didn’t help.

      However, I found the solution in your other reply to this query:

      https://www.statalist.org/forums/for...-%E2%80%99-and


      Code:
        
       replace varname = usubinstr(var1, "`=uchar(8217)'", "'", .)



      Thank you once again!

      Comment

      Working...
      X