Announcement

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

  • How store and make some calculations with thre coefficients from five regressions

    Hello,

    I'd like to know if somebody could help me finding a sintax to calculate the mean of the regression's coefficients from 5 different regressions (using the same variables, but with different observations).

    I guess I have to use "estimates", but I don't know how to do this...

    Thank you all,

    Mariana


  • #2
    your request is not clear to me: do you want the mean of one regression coefficient from each of 5 different regressions or do you want the mean of several regression coefficients within one (or more) regressions? if the first; an easy way is to save the coefficient in a local from each regression and then take the mean of those; e.g.,
    Code:
    sysuse auto, clear
    regress price weight
    local r1=_b[weight]
    you would then repeat that for each of the 5 regressions (using different local names of course) and end by taking the mean of those 5 locals:
    Code:
    di (`r1' + `r1' + `r3' + `r4' + `r5')/5
    if that is not what you mean, please clarify

    Comment


    • #3
      That's it. But also with another detail: my regressions have 3 independent variables and I'll have to obtain the mean from each of the 3 coefficients (plus the constant) of 5 different regressions.
      In this case, is possible to save the 3 coefficient values in a local from each regression?

      Thank you so much !

      Comment

      Working...
      X