Announcement

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

  • Difference between generating a variable

    Hi, I´m a begginer in Stata.

    What is the difference, if there is, if I create a variable this way:

    gen noactiva=(situacionact==2|situacionact==3|situacio nact==4|situacionact==5|situacionact==6)

    or this way:

    gen noactiva=(situacionact2+situacionact3+situacionact 4+situacionact5+situacionact6) , where situacionact2-situacionact6 are the dummies created with a command "tab situacionact, gen(situacionact)".

    Thanks a million,
    Anda.
    Last edited by Anda Gromova; 09 May 2023, 05:46.

  • #2
    Given (0, 1) variables the first yields a maximum (and so possible results are only 0 or 1) and the second yields a sum, so possible results vary from 0 to 5 in principle.

    Comment

    Working...
    X