Announcement

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

  • Simple question

    I have 4 variables, v1 v2 v3 and v4.
    I want to create v5 = v1 / (v1 + v2 + v3 + v4)
    I type into the command line: gen v5 = v1 / (v1 + v2 + v3 + v4)
    and get back:

    too many variables specified
    r(103);

    What, please is wrong? Thanks for any help,

    Ric Uslaner

  • #2
    Works fine for me.

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input double(v1 v2 v3 v4)
    1 2 3 4
    end
    
    gen v5 = v1 / (v1 + v2 + v3 + v4)

    Comment


    • #3
      Bizarre error messages like that may be a sign of invisible characters that Stata can't follow in context. Goodness knows what the reason is here, but writing code in software unsuitable for writing code, e.g. MS Word, . could be one reason.

      Comment

      Working...
      X