Announcement

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

  • Simulating multivariate normal distribution with mean of e(B) and variance/covariance e(V)

    Hi everyone,

    I am working on implementing a parametric bootstrap simulation where I have B, a vector with several parameter estimates from a regression model, and e(V), a variance/covariance matrix. The book I'm using says that "each entry in the simulated sample is a random draw from a multivariate normal distribution with mean [e(b)] and variance/covariance [e(V)]." I've subbed in stata matrix names where appropriate.

    How would I implement this type of analysis in stata? The bootstrap command seems to be inappropriate in this scenario since it is non-parametric.

  • #2
    Maybe you want to use the -drawnorm- command. See the help file for details.This will enable you to create a data set containing synthetic data with the desired distribution.

    Comment


    • #3
      And for completeness, to convert from a covariance matrix to a correlation matrix:

      Code:
      . mata
      ------------------------------------------------- mata (type end to exit) --
      :  cov = (1, 1, 8.1 \ 1, 16, 18 \ 8.1 ,18, 81)
      
      : cov
      [symmetric]
               1     2     3
          +-------------------+
        1 |    1              |
        2 |    1    16        |
        3 |  8.1    18    81  |
          +-------------------+
      
      : corr =invsym(sqrt(diag(cov)))*cov*invsym(sqrt(diag(cov)))
      
      : corr
      [symmetric]
               1     2     3
          +-------------------+
        1 |    1              |
        2 |  .25     1        |
        3 |   .9    .5     1  |
          +-------------------+
      
      : end

      Comment


      • #4
        Scott,

        That's it!! I must have been searching the wrong terms because that is a dead ringer for what I need. Thank you!

        Comment

        Working...
        X