Announcement

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

  • How can I use Stata to generate 50 consecutive strings like star1 star2 star3 star4 star5........star50?

    As the title suggested, I know how to use R to generate them. However, I don't know how to do that in Stata.
    Thank you for your help!

  • #2
    Code:
    set obs 50
    generate wanted="star"+string(_n)
    How do you do the same in R?

    Comment


    • #3
      Thank you!
      How can I generate an equation using Stata like this: max_30=star1+star2+......star50.

      Comment


      • #4
        see the rowtotal option in
        Code:
        help egen
        whoops - missed that these were string variables - see, instead, the "concat" option of the same command; why do you want this anyway?

        Comment


        • #5
          Because I don't want to write a lot in the console of Stata software. Thank you!

          Comment

          Working...
          X