Announcement

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

  • Help with Randomly Drawing 500 Observations from Distribution

    Dear all,

    I am using Stata 16, on mac. I was wondering if I wanted to randomly draw 500 observations from a distribution such as poisson, gamma, beta, or binomial and create histograms of each how would I do so?

    Thank you in advance for your help

    Jason Browen

  • #2
    See -help random number functions-
    Code:
    clear
    set obs 500
    gen x1 = rpoisson(1.0)
    gen x2 = rbeta(5,3)
    gen x3 = rgamma(1,2)
    gen x4 = rbinomial(5, 0.1)
    hist x1
    hist x2
    hist x3
    hist x4

    Comment


    • #3
      oh okay! Thank you so much Mike

      Comment

      Working...
      X