Announcement

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

  • How do I treat missing values in generating new variable from the existing variables in stata.

    Hello everyone,

    I want to create a variable from existing variables, however, the existing variables have some missing values. so, my question is how do I create this new variable ignoring the missing values if one of the existing variables has some value (not missing) and keep the missing value if all of the existing variables missing.

  • #2
    Bezalem:
    welcome to this forum.
    I'm not clear with what you're after.
    Please follow the FAQ to increase your chances of getting helpful replies.
    That said, if you're interested in something similar to the following toy-example, you can see that Stata ignores missing values:
    Code:
    . sysuse auto.dta
    (1978 automobile data)
    . egen wanted=rowtotal( price- foreign )
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment

    Working...
    X