Announcement

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

  • on linux, the regression results using do file and run the command in a single line, get different results, wierd

    As shown, the log below shows the regression is normal with p values; however, when I run the syntax using command window, the regression resutls have no p values, shown as the screenshot, with the same coefficients. Why?
    I tried on Mac, it also indicates warning: variance matrix is nonsymmetric or highly singular.
    I am curious why run the syntax in a do file get normal results while others not?

    Code:
    > cap /* noisily */ reghdfe Evaluation c.divergent_assoc_fin_zici##c.lnwordcount $ctrl `tuple`i'' if AIorNot ==`k',vce(cluster firmID) absorb(ind )
    > if _rc==0 {
    > frame post zsignificance$num ("`k'") ("Evaluation") ("`tuple`i''") ("c.divergent_assoc_fin_zici##c.lnwordcount") (el(r(table),1,3)) (el(r(table),4,3)) //("active female")
    > (el(r(table),1,11)) (el(r(table),4,11)) (`pdiff') /* (el(r(table),1,30)) (el(r(table),4,30)) */
    > }
    >
    > } */
    . }
    16.
    . }
    (MWFE estimator converged in 1 iterations)
    
    HDFE Linear regression                            Number of obs   =      4,905
    Absorbing 1 HDFE group                            F(  18,    980) =       2.15
    Statistics robust to heteroskedasticity           Prob > F        =     0.0036
                                                      R-squared       =     0.0110
                                                      Adj R-squared   =     0.0059
                                                      Within R-sq.    =     0.0055
    Number of clusters (firmID)  =        981         Root MSE        =     9.5687
    
                                   (Std. err. adjusted for 981 clusters in firmID)
    ------------------------------------------------------------------------------
                 |               Robust
      Evaluation | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
    -------------+----------------------------------------------------------------
    divergent_~i |   19.80279   9.455932     2.09   0.036     1.246588    38.35899
     lnwordcount |   157.3122   80.21144     1.96   0.050    -.0936979    314.7182
                 |
              c. |
    divergent_~i#|
              c. |
     lnwordcount |  -1.870194   .9563166    -1.96   0.051    -3.746857    .0064702
                 |
         firmAge |   -.285815   .1006824    -2.84   0.005     -.483393    -.088237
       lnEmplNum |   .2929572   .2424283     1.21   0.227    -.1827811    .7686956
                 |
      prodPhaseA |
    Prototypi..  |  -.0004109    .436924    -0.00   0.999    -.8578252    .8570035
    Manufactu..  |  -.1722763   .4932308    -0.35   0.727    -1.140186    .7956338
                 |
       standardB |  -.1800625   .3052489    -0.59   0.555    -.7790792    .4189541
         award01 |   .7522663   .3552257     2.12   0.034     .0551758    1.449357
      lnTtlAsset |    .141961   .0938348     1.51   0.131    -.0421793    .3261012
    emplRatioA~l |  -.8827885   .9497246    -0.93   0.353    -2.746516    .9809393
     emplRatioRD |    1.58624    .838761     1.89   0.059     -.059734    3.232214
             DAR |  -.0031675   .0042393    -0.75   0.455    -.0114866    .0051516
        devFormB |   .2795039   1.012329     0.28   0.783    -1.707078    2.266085
                 |
       oprPhaseB |
    Initial o..  |   .4197171   .5235594     0.80   0.423    -.6077093    1.447144
     Mass sales  |   .9096955   .7092001     1.28   0.200    -.4820301    2.301421
                 |
     RDComplness |  -.1634139   .8766622    -0.19   0.852    -1.883765    1.556937
    RDSelfInputR |   1.602693   1.562455     1.03   0.305     -1.46345    4.668836
           _cons |  -1594.692   793.2084    -2.01   0.045    -3151.274   -38.10931
    ------------------------------------------------------------------------------
    Click image for larger version

Name:	1766994484528.jpg
Views:	1
Size:	298.3 KB
ID:	1783980

    Last edited by Fred Lee; 29 Dec 2025, 00:55.

  • #2
    on another linux server, the same syntax on Mac has the p-values, while the same syntax has no p values on Linux. The version of reghdfe is the same and all Stata is the latest version

    Comment


    • #3
      Originally posted by Fred Lee View Post
      As shown, the log below shows the regression is normal with p values; however, when I run the syntax using command window, the regression resutls have no p values, shown as the screenshot, with the same coefficients. Why?
      Well, for one, you're not using the same syntax between the two: you're using capture in front of the command in the first case and you're not in the second case.

      Is is possible that the capture prefix in the putatively successful first case is forcing the code to ignore an exception raised by a called program that checks for asymmetric or singular variance-covariance matrix and allowing things to proceed to computing the (erroneous) standard errors?

      Regardless, I suspect with a little patience you can get the answer to the question you raised by means of set trace on. In the meantime you might want to take those standard errors with a grain of salt.

      Second, it seems that the command that you're having trouble with is user-written and is not official Stata. You'll probably want to point that out in future posts.

      Comment

      Working...
      X