Announcement

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

  • Capture p-values from regression results

    Hi,

    Im running Carhart 4 factor model and Im trying to create new variables contain coefficients for the factors, standard errors and p values for the factors from regression results, so far I was able to capture the slope coefficients and standard error by -_b[factor1]- and -_se[factor1]-, However, I couldn't find a command that can capture the p-values.

    Any help is appreciated
    Cheers,
    Tom

  • #2
    There are no stored results for p-values after regress command. You can obtain p-values using something like
    Code:
    local t = _b[_cons]/_se[_cons]
    local p =2*ttail(e(df_r),abs(`t'))
    You can replace _b[cons] with _b[variable_name] which you actually use in your regression.
    Regards
    --------------------------------------------------
    Attaullah Shah, PhD.
    Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
    FinTechProfessor.com
    https://asdocx.com
    Check out my asdoc program, which sends outputs to MS Word.
    For more flexibility, consider using asdocx which can send Stata outputs to MS Word, Excel, LaTeX, or HTML.

    Comment


    • #3
      Thanks Attaullah

      Comment


      • #4
        actually, here Attaullah is not correct; look at "r(table)" (part of "return list") after estimating your regression and you will see the p-values as part of the matrix of results

        Comment


        • #5
          What i actually meant that in standard regression, the p-values cannot be seperaterly obtained through return list, yes it is in matrix, but you have to do additional tricks to seperate it from the matrix table.
          Regards
          --------------------------------------------------
          Attaullah Shah, PhD.
          Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
          FinTechProfessor.com
          https://asdocx.com
          Check out my asdoc program, which sends outputs to MS Word.
          For more flexibility, consider using asdocx which can send Stata outputs to MS Word, Excel, LaTeX, or HTML.

          Comment


          • #6
            Dear Statalists,
            Capture p-values from zero inflated regression results

            I would like to capture p values from zero inflated model. However, the results of the zinb model are displayed in two componets; the count and the inflated components. Each of these results has its own p value. Therefore, the following commands seem did not get through (when display p-values, they are all missing). Please give your advice on how to capture p-value for each component? Thank you.


            // fitting zero inflated model

            zinb fiveyoddmfs SES4, inflate(SES4) level(97.5)

            // Calculation of t-value and p-value
            local t = _b[SES4] / _se[SES4]
            local p = 2 * ttail(e(df_r), abs(`t'))

            // Displaying the p-value
            display "P-value for SES4: " %8.4f `p'


            CODE
            clear
            input byte fiveyoddmfs float SES4
            . -5.300604
            . 4.120511
            0 .3542542
            0 4.7029696
            0 -3.051065
            . -.6050887
            . 1.3122363
            . -3.945837
            0 5.222175
            . -3.770617
            . .
            . -2.95614
            . -2.1549318
            . -1.8057196
            6 3.7224984
            . -1.3404984
            . -2.700492
            . 3.407414
            . .
            . .
            . 1.185773
            . -5.068585
            1 2.89098
            . .
            . 1.494044
            0 1.8064017
            . 1.6100533
            . 1.9896634
            2 3.118999
            0 .
            0 -2.3078828
            . .
            . 3.743583
            . .
            . -2.8125024
            . .
            0 2.664365
            0 2.1556137
            1 -3.484615
            0 .
            . .
            . -.8042078
            0 .
            . .
            . -8.238112
            0 2.557625
            . 3.182209
            0 .7825772
            . 1.440104
            . 1.826258
            end
            [/CODE]

            Comment

            Working...
            X