Announcement

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

  • if statement to replace missing value by 0

    Hi,

    I have variable and and variable B. I want to say when A is not missing and B is missing replace the missing value of B with 0. How can I put this as an if statement in stata?

  • #2
    Code:
    replace B = 0 if missing(B) & !missing(A) 
    
    help missing()

    Comment

    Working...
    X