Announcement

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

  • gregress results: mata to stata

    Good morning,

    I am running a regression including a lot of absorbed trend and I am using gregress by Correia (gtools package from SSC).

    After running the command, as an example,


    Code:
    sysuse auto
    qui tab foreign, gen(ff)
    
    gregress price mpg rep78, absorb(ff1 ff2) cluster(foregin)

    I get the following

    Code:
    . gregress price mpg rep78, absorb(ff1 ff2) cluster(foreign)
    warning gregress is beta software; use with caution
    Results in GtoolsRegress; see mata GtoolsRegress.desc()
    
    . mata GtoolsRegress.desc()
    
        GtoolsRegress is a class object with gregress results
    
            | object      |            value | description                                                   |
            | ----------- | ---------------- | ------------------------------------------------------------- |
            | kx          |                2 | number of (non-absorbed) covariates                           |
            | cons        |                0 | whether a constant was added automagically                    |
            | b           |     1 x 2 matrix | regression coefficients                                       |
            | se          |     1 x 2 matrix | corresponding standard errors                                 |
            | setype      |          cluster | type of SE computed (homoskedastic, robust, or cluster)       |
            | absorbvars  | 1 x 2 row vector | variables absorbed as fixed effects                           |
            | njabsorb    | 1 x 2 row vector | number of FE each absorb variable had for each grouping level |
            | clustervars | 1 x 1 row vector | cluster variables                                             |
            | njcluster   | 1 x 1 row vector | number of clusters per grouping level                         |
    I have no idea on how to basically see and save in Stata the results of the estimation. Could you help, please? Thanks a lot!

  • #2
    Hey! Btw you might be confused about gtools. The package by Correia that computes a regression with high-dimensional fixed effects is called "reghdfe" and I would recommend that you use that. As the note says, "gregress" is in beta; clearly I think it will eventually be a good function, but if you don't know mata you very probably want to avoid gregress while it's in beta. As for your question,

    Code:
    mata GtoolsRegress.b
    mata st_matrix("b", GtoolsRegress.b)
    matrix list b
    Again, though, I recommend that you use "reghdfe" instead.

    Comment


    • #3
      Hi, thanks very much for your answer. Indeed I was trying to use reghdfe but was too slow, as I was trying to add state-specific trends. Also I see that there is not a collinearity check in gtools.

      Anyway, thanks for the clarification!

      Comment

      Working...
      X