Announcement

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

  • word command in stata

    What does word command do?

    Can anyone explain it with example?

  • #2
    word() is a function -- not a command -- in Stata. In Stata commands and functions are distinct.

    As such it is documented at

    Code:
    help word()
    For simple examples, play with display.

    Code:
    . display word("frog toad newt", 1)
    frog
    
    . display word("frog toad newt", 3)
    newt
    
    . display word("frog toad newt", -1)
    newt
    
    . display word("frog toad newt", 4)
    
    
    . display word("frog toad newt", 0)
    
    
    . local this = word("frog toad newt", 2)
    
    . di "`this'"
    toad





    Comment

    Working...
    X