Announcement

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

  • Copying output of regression from stata to statalist

    I am sorry to come with a very basic question but I have been struggling for hours. I have read the FAQ where it states to use hash icon to paste data but I tried and does not work. Can someone please tell me the exact steps.
    I go to stata, highlight the data and go to Edit, copy command.
    then I come to this window and I click on the hash icon above and then I do paste. But my numbers are all over the place.
    I would be very grateful for some guidance. What am I doing wrong?

  • #2
    Sorry you're having difficulty, but what you describe is what you should be doing and I can't explain why it doesn't work for you.

    I ran the code below, copied the results from the Results window in Stata, clicked on # here to get a pair of CODE delimiters and then pasted the results in between. It looks untidy as I write, but it should look tidy when I post. But I don't use Edit -- I just highlight the text wanted and use Ctrl-C in Stata, Ctrl-V here within Windows. Other operating systems, other details.

    Code:
    . sysuse auto, clear
    (1978 automobile data)
    
    . regress mpg weight
    
          Source |       SS           df       MS      Number of obs   =        74
    -------------+----------------------------------   F(1, 72)        =    134.62
           Model |   1591.9902         1   1591.9902   Prob > F        =    0.0000
        Residual |  851.469256        72  11.8259619   R-squared       =    0.6515
    -------------+----------------------------------   Adj R-squared   =    0.6467
           Total |  2443.45946        73  33.4720474   Root MSE        =    3.4389
    
    ------------------------------------------------------------------------------
             mpg | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
    -------------+----------------------------------------------------------------
          weight |  -.0060087   .0005179   -11.60   0.000    -.0070411   -.0049763
           _cons |   39.44028   1.614003    24.44   0.000     36.22283    42.65774
    ------------------------------------------------------------------------------
    Last edited by Nick Cox; 28 Nov 2024, 10:49.

    Comment


    • #3
      Code:
      regress NZS ESGCom PERF REM NZBA PCAF WOMB WOME SIZE LEV ROAA
      
            Source |       SS           df       MS      Number of obs   =       176
      -------------+----------------------------------   F(10, 165)      =     11.10
             Model |    144.5664        10    14.45664   Prob > F        =    0.0000
          Residual |  214.973372       165  1.30286892   R-squared       =    0.4021
      -------------+----------------------------------   Adj R-squared   =    0.3659
             Total |  359.539773       175  2.05451299   Root MSE        =    1.1414
      
      ------------------------------------------------------------------------------
               NZS | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
      -------------+----------------------------------------------------------------
            ESGCom |  -.0012644   .2686344    -0.00   0.996    -.5316685    .5291396
              PERF |   .4104477   .3865421     1.06   0.290    -.3527586    1.173654
               REM |   1.003892   .4165813     2.41   0.017     .1813745    1.826409
              NZBA |   .8495101   .2844688     2.99   0.003      .287842    1.411178
              PCAF |   .5602583   .2246799     2.49   0.014     .1166401    1.003877
              WOMB |   .6815144   .4893493     1.39   0.166    -.2846793    1.647708
              WOME |  -1.143908   .5399985    -2.12   0.036    -2.210106   -.0777102
              SIZE |   .0770184   .0740764     1.04   0.300    -.0692415    .2232782
               LEV |   .0230312   .0256128     0.90   0.370    -.0275398    .0736022
              ROAA |   .1366201   .0774553     1.76   0.080    -.0163113    .2895514
             _cons |   .2232159   1.256102     0.18   0.859     -2.25689    2.703322
      ------------------------------------------------------------------------------
      Many thanks Nick. It is a great help! My missing link was that I did not know that data would be sorted once I post. What a coincidence you are working with environmental data! My study is on GHG emissions reporting by banks in Europe and their Net Zero Journey. Can I share my results and you tell me whether my model is a good fit,as I am weak in statistics. The above are the results of the second model on the Net Zero Journey. I will post below the results of my first model too. I cannot see the hash symbol now...
      Last edited by MARIA CHRISTOFIDOU; 28 Nov 2024, 15:31.

      Comment


      • #4
        a
        Last edited by MARIA CHRISTOFIDOU; 28 Nov 2024, 15:33.

        Comment


        • #5
          Code:
           reghdfe GERQS ESGCom PERF REM NZBA PCAF WOMB WOME SIZE LEV ROAA, absorb(CCODE) cluster(CCODE)
          (MWFE estimator converged in 1 iterations)
          
          HDFE Linear regression                            Number of obs   =        176
          Absorbing 1 HDFE group                            F(  10,     29) =      10.75
          Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                            R-squared       =     0.6799
                                                            Adj R-squared   =     0.5881
                                                            Within R-sq.    =     0.3529
          Number of clusters (CCODE)   =         30         Root MSE        =     5.7533
          
                                           (Std. err. adjusted for 30 clusters in CCODE)
          ------------------------------------------------------------------------------
                       |               Robust
                 GERQS | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
          -------------+----------------------------------------------------------------
                ESGCom |   .5936342   1.051669     0.56   0.577    -1.557271    2.744539
                  PERF |   1.664053   2.028009     0.82   0.419    -2.483691    5.811798
                   REM |   8.458434   2.455356     3.44   0.002     3.436666     13.4802
                  NZBA |    3.76366   2.441842     1.54   0.134    -1.230467    8.757788
                  PCAF |   3.509845   1.692764     2.07   0.047     .0477531    6.971937
                  WOMB |   .6919396    2.75665     0.25   0.804    -4.946042    6.329921
                  WOME |  -3.238755   2.418232    -1.34   0.191    -8.184595    1.707086
                  SIZE |   .1634796   .7393921     0.22   0.827    -1.348747    1.675706
                   LEV |  -.0783147   .2764249    -0.28   0.779    -.6436671    .4870377
                  ROAA |   .6812615    .397198     1.72   0.097    -.1310996    1.493623
                 _cons |   3.536742   12.21612     0.29   0.774    -21.44802     28.5215
          ------------------------------------------------------------------------------
          
          Absorbed degrees of freedom:
          -----------------------------------------------------+
           Absorbed FE | Categories  - Redundant  = Num. Coefs |
          -------------+---------------------------------------|
                 CCODE |        30          30           0    *|
          -----------------------------------------------------+
          * = FE nested within cluster; treated as redundant for DoF computation
          
          .

          Comment


          • #6
            MARIA CHRISTOFIDOU In #3 and #5 you give some regression results, but I am not clear what the variables are, or what questions you are asking. I doubt whether that is clear to anyone.

            I'd start a new thread if you want advice on your modelling. (The title of the thread is now quite irrelevant.)

            Some simple thoughts are that I've never seen pollution data that wasn't highly skewed and for which relationships were nonlinear and which did not work better as a generalized linear model than a plain regression.

            I have never used reghdfe (from SSC, as you are asked to explain?) and I suspect you need economists to comment there.

            Comment


            • #7
              You are in fact running a thread on your modelling concurrently at https://www.statalist.org/forums/for...nal-regression

              Comment

              Working...
              X