Announcement

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

  • Testing the null B1=B2

    I need to use a t-statistic to test is the coefficients on education and experience are equal. I need to rewrite the equation. My equation is:
    log of hourly wage=B0+B1EDYEARS+B2EXPER+B3EXPER^2+u
    Would these commands be correct?
    generate EDYEARSexper2= (EDYEARS-exper+exper) (this wold be my new B1)
    and then:
    generate EDYEARSexper3= (EDYEARS+EXPER) (this would be my new B2)
    and then: reg lofhrwage EDYEARSexper2 EDYEARSexper 3 exper^2
    I really appreciate any feedback

  • #2
    Julianna, if this is a homework question, please see this part of the FAQ.

    I would advise you to see the help for testing a linear combination of coefficients:

    Code:
    help lincom
    I prefer not to respond in more detail if this is homework for the reasons outlined in the FAQ.
    Be aware that it can be very hard to answer a question without sample data. You can use the dataex command for this. Type help dataex at the command line.

    When presenting code or results, please use the code delimiters format them. Use the # button on the formatting toolbar, between the " (double quote) and <> buttons.

    Comment


    • #3
      This is not a homework question I am not in school. This is what I got when I ran the regression.

      reg loghrwage EDYEARSexper22 EDYEARSexper2

      Source | SS df MS Number of obs = 47,128
      -------------+---------------------------------- F(2, 47125) = 6082.63
      Model | 4936.82712 2 2468.41356 Prob > F = 0.0000
      Residual | 19123.9653 47,125 .405813588 R-squared = 0.2052
      -------------+---------------------------------- Adj R-squared = 0.2051
      Total | 24060.7925 47,127 .510552177 Root MSE = .63703

      --------------------------------------------------------------------------------
      loghrwage | Coef. Std. Err. t P>|t| [90% Conf. Interval]
      ---------------+----------------------------------------------------------------
      EDYEARSexper22 | .1321829 .0012152 108.78 0.000 .1301841 .1341817
      EDYEARSexper2 | -.0090508 .0002662 -34.00 0.000 -.0094886 -.008613
      _cons | 1.098445 .0183896 59.73 0.000 1.068196 1.128694
      --------------------------------------------------------------------------------

      Comment


      • #4
        Originally posted by Julianna Grato View Post
        I need to use a t-statistic to test is the coefficients on education and experience are equal.
        I'm not sure what you're trying to do with your created variables, for example,
        Code:
        generate EDYEARSexper2 = (EDYEARS - exper + exper)
        doesn't make a whole lot of sense to me.

        But, building on Weiwen's advice:

        .ÿversionÿ15.1

        .ÿ
        .ÿquietlyÿsysuseÿauto,ÿclear

        .ÿ
        .ÿgenerateÿdoubleÿlog_wageÿ=ÿlog10(price)

        .ÿegenÿbyteÿeducationÿ=ÿcut(weight),ÿgroup(`=22-16')

        .ÿquietlyÿreplaceÿeducationÿ=ÿeducationÿ+ÿ16

        .ÿegenÿbyteÿexperienceÿ=ÿcut(length),ÿgroup(10)

        .ÿ
        .ÿ*
        .ÿ*ÿBeginÿhere
        .ÿ*
        .ÿregressÿlog_wageÿc.(educationÿexperience)

        ÿÿÿÿÿÿSourceÿ|ÿÿÿÿÿÿÿSSÿÿÿÿÿÿÿÿÿÿÿdfÿÿÿÿÿÿÿMSÿÿÿÿÿÿNumberÿofÿobsÿÿÿ=ÿÿÿÿÿÿÿÿ74
        -------------+----------------------------------ÿÿÿF(2,ÿ71)ÿÿÿÿÿÿÿÿ=ÿÿÿÿÿ13.16
        ÿÿÿÿÿÿÿModelÿ|ÿÿ.572425397ÿÿÿÿÿÿÿÿÿ2ÿÿ.286212699ÿÿÿProbÿ>ÿFÿÿÿÿÿÿÿÿ=ÿÿÿÿ0.0000
        ÿÿÿÿResidualÿ|ÿÿ1.54446445ÿÿÿÿÿÿÿÿ71ÿÿÿ.02175302ÿÿÿR-squaredÿÿÿÿÿÿÿ=ÿÿÿÿ0.2704
        -------------+----------------------------------ÿÿÿAdjÿR-squaredÿÿÿ=ÿÿÿÿ0.2499
        ÿÿÿÿÿÿÿTotalÿ|ÿÿ2.11688985ÿÿÿÿÿÿÿÿ73ÿÿ.028998491ÿÿÿRootÿMSEÿÿÿÿÿÿÿÿ=ÿÿÿÿ.14749

        ------------------------------------------------------------------------------
        ÿÿÿÿlog_wageÿ|ÿÿÿÿÿÿCoef.ÿÿÿStd.ÿErr.ÿÿÿÿÿÿtÿÿÿÿP>|t|ÿÿÿÿÿ[95%ÿConf.ÿInterval]
        -------------+----------------------------------------------------------------
        ÿÿÿeducationÿ|ÿÿÿ.0735464ÿÿÿ.0261009ÿÿÿÿÿ2.82ÿÿÿ0.006ÿÿÿÿÿ.0215026ÿÿÿÿ.1255902
        ÿÿexperienceÿ|ÿÿ-.0148003ÿÿÿ.0154942ÿÿÿÿ-0.96ÿÿÿ0.343ÿÿÿÿ-.0456949ÿÿÿÿ.0160944
        ÿÿÿÿÿÿÿ_consÿ|ÿÿÿ2.459185ÿÿÿ.4179635ÿÿÿÿÿ5.88ÿÿÿ0.000ÿÿÿÿÿ1.625789ÿÿÿÿÿ3.29258
        ------------------------------------------------------------------------------

        .ÿtestÿeducationÿ=ÿexperience

        ÿ(ÿ1)ÿÿeducationÿ-ÿexperienceÿ=ÿ0

        ÿÿÿÿÿÿÿF(ÿÿ1,ÿÿÿÿ71)ÿ=ÿÿÿÿ4.68
        ÿÿÿÿÿÿÿÿÿÿÿÿProbÿ>ÿFÿ=ÿÿÿÿ0.0339

        .ÿ
        .ÿexit

        endÿofÿdo-file


        .




        Comment


        • #5
          Thank you Joseph.

          Comment


          • #6
            I was creating a new variable instead of doing SE(B1-B2)

            Comment

            Working...
            X