Announcement

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

  • How to do Summations?

    Hello, I'm very new to stata and am having trouble figuring this out.
    If have have 2 variable lists, lets just say var1 and var2, how can i find the ∑ni=1 = (var1 + var2)2
    I tried googling it to no success. Would I use egen?
    Thanks for any help

  • #2
    Maybe
    Code:
    generate double sum2 = (var1 + var2)^2
    summarize sum2, meanonly
    display in smcl as text r(sum)

    Comment


    • #3
      Bump

      Comment


      • #4
        Joseph gave you excellent advice in #2. Please explain why the need to bump in #3. Wouldn't the command above fit in your needs?
        Best regards,

        Marcos

        Comment

        Working...
        X