Announcement

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

  • Moderator and Independent Variable using Dummy (Binary Variable)

    Hi Stata Experts Team,

    I would like to know whether there is a different procedure in regression if there is independent variable dummy and moderator variable dummy. The current model I used for the model is fixed effect and I have checked the normality, multicolinearity, heteroscedasticity, and also the autocolinearity. Is the any additional procedure that I should perform for the model below?

    xtreg roa relateddummy unrelateddummy efisiensidummy relateddummy*efisiensidummy unrelateddummy*efisiensidummy size growth leverage age, fe

    Thank you for your attention.

    Best Regards,

    Canthy Meilanda

  • #2
    Canthy:
    welcome to this forum.
    Some comments about your query:
    - why creating interactions and categorical variables yourself when -fvvarlist- can do it for you?
    - one of the most useful postestimation test concerns its correct specification:
    Code:
    . use "http://www.stata-press.com/data/r15/nlswork.dta"
    (National Longitudinal Survey.  Young Women 14-26 years of age in 1968)
    
    . xtreg ln_wage age grade, fe
    note: grade omitted because of collinearity
    
    Fixed-effects (within) regression               Number of obs     =     28,508
    Group variable: idcode                          Number of groups  =      4,708
    
    R-sq:                                           Obs per group:
         within  = 0.1026                                         min =          1
         between = 0.0879                                         avg =        6.1
         overall = 0.0774                                         max =         15
    
                                                    F(1,23799)        =    2720.20
    corr(u_i, Xb)  = 0.0314                         Prob > F          =     0.0000
    
    ------------------------------------------------------------------------------
         ln_wage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
             age |   .0181349   .0003477    52.16   0.000     .0174534    .0188164
           grade |          0  (omitted)
           _cons |   1.148225   .0102577   111.94   0.000      1.12812    1.168331
    -------------+----------------------------------------------------------------
         sigma_u |  .40637763
         sigma_e |  .30349389
             rho |  .64195114   (fraction of variance due to u_i)
    ------------------------------------------------------------------------------
    F test that all u_i=0: F(4707, 23799) = 8.81                 Prob > F = 0.0000
    
    . predict fitted, xb
    (26 missing values generated)
    
    . g sq_fitted=fitted^2
    (26 missing values generated)
    
    . xtreg ln_wage fitted sq_fitted , fe
    
    Fixed-effects (within) regression               Number of obs     =     28,508
    Group variable: idcode                          Number of groups  =      4,708
    
    R-sq:                                           Obs per group:
         within  = 0.1087                                         min =          1
         between = 0.1007                                         avg =        6.1
         overall = 0.0865                                         max =         15
    
                                                    F(2,23798)        =    1451.88
    corr(u_i, Xb)  = 0.0441                         Prob > F          =     0.0000
    
    ------------------------------------------------------------------------------
         ln_wage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
          fitted |   7.143482   .4789041    14.92   0.000     6.204799    8.082164
       sq_fitted |  -1.816235   .1414686   -12.84   0.000    -2.093523   -1.538948
           _cons |  -5.167839   .4038031   -12.80   0.000    -5.959319    -4.37636
    -------------+----------------------------------------------------------------
         sigma_u |  .40395152
         sigma_e |  .30245467
             rho |  .64077441   (fraction of variance due to u_i)
    ------------------------------------------------------------------------------
    F test that all u_i=0: F(4707, 23798) = 8.74                 Prob > F = 0.0000
    
    . test sq_fitted=0
    
     ( 1)  sq_fitted = 0
    
           F(  1, 23798) =  164.83
                Prob > F =    0.0000
    *As -test- reaches statistical significance there's evidence of model misspecification*
    .
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Dear Carlo,

      Thanks for your response. There are further question I would confirm about the model on previous question:
      1. Is it okay to multiply dummy with dummy?
      2. Could you provide me example that compatible with state 12.0?

      Best regards,

      Canthy Meilanda

      Comment


      • #4
        Canthy:
        1) yes, it is.
        2) -fvvarlist- is not available in Stata 12 (please note that FAQ reccommends to declare which Stata release supports your analysis just to avoid providing the poster with unhelpful advice); see -help xi- instead.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Dear Carlo,

          Thank you very much for the guidance ^^

          Best regards,

          Canthy Meilanda

          Comment

          Working...
          X