Announcement

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

  • How to 'replace' categorical data with entries that have multiple options?

    Hi everyone, does anyone know how I can replace "CurrentPast" and "PastCurrent"?
    Click image for larger version

Name:	Screen Shot 2021-12-14 at 8.34.15 am.png
Views:	1
Size:	25.0 KB
ID:	1640815

  • #2
    there appears to be an extra space for each of those; if it is really a space (rather than some strange character), you can use the trim function to get rid of it:
    Code:
    replace p1s7_q2_constipation=trim(p1s7_q2_constipation
    note that since you pasted a picture, I was unable to copy-and-paste from #1 and there might be typos - please read the FAQ on how to show results

    if it is some strange character, you can either discover what it is or you can use the substr function to eliminate it; see
    Code:
    help strtrim()
    help substr()

    Comment

    Working...
    X