Announcement

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

  • Finding critical values for a coefficient

    I need to find if a coefficient on a parameter is significantly different than zero at the level 5% .Instead of using the test command I need to go the long way and find the critical values and compare them. How would I do that? I found commands for this but I do not know how to specify the specific independent variable I want to test. Thank you so much.

  • #2
    The code for this would depend on the details of the particular analysis you are talking about and the names of the variables. Please post back showing the regression output you got from Stata. N.B. Show it exactly as you got it. Copy/paste it from the Results window or your log file into the data editor here, between code delimiters. (See Forum FAQ #12 if you are not familiar with code delimiters.)

    Comment


    • #3
      reg loghrwage EDYEARS exper exper2

      Source | SS df MS Number of obs = 47,128
      -------------+---------------------------------- F(3, 47124) = 4173.37
      Model | 5050.68468 3 1683.56156 Prob > F = 0.0000
      Residual | 19010.1078 47,124 .403406073 R-squared = 0.2099
      -------------+---------------------------------- Adj R-squared = 0.2099
      Total | 24060.7925 47,127 .510552177 Root MSE = .63514

      ------------------------------------------------------------------------------
      loghrwage | Coef. Std. Err. t P>|t| [95% Conf. Interval]
      -------------+----------------------------------------------------------------
      EDYEARS | .1225015 .0011149 109.88 0.000 .1203162 .1246867
      exper | .0266058 .0010781 24.68 0.000 .0244927 .028719
      exper2 | -.0003751 .0000223 -16.80 0.000 -.0004189 -.0003314
      _cons | .9511733 .0203228 46.80 0.000 .9113404 .9910062
      ------------------------------------------------------------------------------

      I need to do EDYEARS. I really appreciatethe help.

      Comment


      • #4
        Since this is a linear regression, the test statistic for the coefficient is a t-statistic. The degrees of freedom for the t-statistic are the same as the denominator degrees of freedom for the overall model, which can be found in e(df_m). The t-statistic itself can be calculated as _b[EDYEARS]/_se[EDYEARS]. The critical value is then calculated with the inverse-t distribution function for that many degrees of freedom, evaluated at 1-0.05/2 = 0.975. In code:

        Code:
        local tstat = _b[EDYEARS]/_se[EDYEARS]
        local df = e(df_m)
        local critical_value = invt(`df', 0.975)
        display "t-statistic = " %05.3f =`tstat' ", df = `df'"
        display "0.05 critical value = `critical_value'"
        Note: Not tested. Beware of typos.
        Last edited by Clyde Schechter; 08 Oct 2018, 21:40.

        Comment


        • #5
          Thank you so much! Very helpful!

          Comment


          • #6
            Crossed in the mail. See Clyde's answer.
            Last edited by Joseph Coveney; 08 Oct 2018, 21:54.

            Comment

            Working...
            X