Announcement

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

  • Data Management: Changing case from UPPER to lower in observations

    I would like to change the case of observations within a variable from "UPPER" case to "Proper" case. For example, change "123 SPRING DRIVE" TO "123 Spring Drive."
    MS Excel has functions for this but I cannot find similar functionality in Stata. I appreciate any tips.

  • #2
    Code:
    . display proper("123 SPRING DRIVE")
    123 Spring Drive
    
    . help string functions

    Comment


    • #3
      To be more explicit:

      Code:
      . sysuse auto, clear
      (1978 Automobile Data)
      
      . list make in 1/3
      
           +-------------+
           | make        |
           |-------------|
        1. | AMC Concord |
        2. | AMC Pacer   |
        3. | AMC Spirit  |
           +-------------+
      
      . replace make = proper(make)
      (11 real changes made)
      
      . list make in 1/3
      
           +-------------+
           | make        |
           |-------------|
        1. | Amc Concord |
        2. | Amc Pacer   |
        3. | Amc Spirit  |
           +-------------+
      David Radwin
      Senior Researcher, California Competes
      californiacompetes.org
      Pronouns: He/Him

      Comment

      Working...
      X