Announcement

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

  • outcome does not vary

    Hello

    I ran

    probit c01 b01 b03 b05 c07a b08 b09 b06 b07
    and I got
    outcome does not vary; remember:
    0 = negative outcome,
    all other nonmissing values = positive outcome
    However, looking into my dataset, I find that the independent variable is coded as 2 when the event did not occur and 1 if it did. replace dep_var = dep_var-1 holds ONLY when the dependent variable is coded as 2 when the event occurs and 1 when it does not. Can someone help to recode to 1 when the event occurs and 0 when it does not

  • #2
    Code:
    recode dep_var (2 = 0), gen(new_dep_var)
    Then use new_dep_var instead of dep_var in your -probit-.

    By the way, this 1 = Yes 2 = No coding is quite common in data sources, and is used by some other statistical packages as the preferred way to represent binary variables. But Stata use the more logical 1 = Yes 0 = No coding. So whenever you receive a data set, you need to look out for the 1/2 coding and convert it to 1/0 as part of your pre-analytic data management.

    Comment


    • #3
      Thanks Clyde Schechter , it works now!

      Comment

      Working...
      X