Announcement

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

  • #16
    Jose:
    as Jeff clerly pointed out, if you lag your regressand and plug it in the right-hand side of your regression equation, you're in the tricky realm of dynamic panel data regression.
    Conversely, if you want to investigate if one of your predictors shows a non-linear relationship with your regresand (I assume here that your dependent variable is continuous and you will one of the -xtreg- estimators), the usual -b/2a formula is enough.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #17
      Thank you Carlo for your repply. I am sorry if my question sound basic but How do I implement the formula -b/2a to analyse the possible quadratic effect of my explanatory variable? My dependent variable is measured in a continuous that rank between 0 and 1. The procedure I know is to introduce in the equation the squared term of my explanatory variable (x) and test if this term is significant, then I draw the graph and test for the significance of the slopes.

      Example:
      x = approp
      y= breadth

      //To evaluate cuadratic effect.
      nlcom -_b[approp]/(2*_b[c.approp_n#c.approp])

      ///For testing the slopes
      ///Minimun X
      nlcom -_b[approp]+(2*(_b[c.approp#c.approp])*0)
      ///Maximun X
      nlcom -_b[approp_n]+ (2*(_b[c.approp#c.approp])*3)

      If I try to use the two step approach of correlated random effect (Papke and Woolbridge, 2008) to analyze my model, when do I introduce the squared term of my explanatory variable "appro"? in the second step? As I want to control for possible endogeneity (I cannot ensure that my explanatory variable is stricttly exogenous), I think I need to use this approach.

      Thank you very much in advanced.

      José Luis



      Comment


      • #18
        Jose:
        you may want to consider the community-contributed module -wherext-:
        Code:
        . use "C:\Program Files\Stata17\ado\base\a\auto.dta"
        (1978 automobile data)
        
        . regress price c.mpg##c.mpg
        
              Source |       SS           df       MS      Number of obs   =        74
        -------------+----------------------------------   F(2, 71)        =     18.28
               Model |   215835615         2   107917807   Prob > F        =    0.0000
            Residual |   419229781        71  5904644.81   R-squared       =    0.3399
        -------------+----------------------------------   Adj R-squared   =    0.3213
               Total |   635065396        73  8699525.97   Root MSE        =    2429.9
        
        ------------------------------------------------------------------------------
               price | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
        -------------+----------------------------------------------------------------
                 mpg |  -1265.194   289.5443    -4.37   0.000    -1842.529   -687.8593
                     |
         c.mpg#c.mpg |   21.36069   5.938885     3.60   0.001     9.518891    33.20249
                     |
               _cons |   22716.48   3366.577     6.75   0.000     16003.71    29429.24
        ------------------------------------------------------------------------------
        
        . di - (-1265.194)/(2*21.36069 )
        29.615008
        
        . gen mpg_sq=mpg^2
        
        .  regress price mpg mpg_sq
        
              Source |       SS           df       MS      Number of obs   =        74
        -------------+----------------------------------   F(2, 71)        =     18.28
               Model |   215835615         2   107917807   Prob > F        =    0.0000
            Residual |   419229781        71  5904644.81   R-squared       =    0.3399
        -------------+----------------------------------   Adj R-squared   =    0.3213
               Total |   635065396        73  8699525.97   Root MSE        =    2429.9
        
        ------------------------------------------------------------------------------
               price | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
        -------------+----------------------------------------------------------------
                 mpg |  -1265.194   289.5443    -4.37   0.000    -1842.529   -687.8593
              mpg_sq |   21.36069   5.938885     3.60   0.001     9.518891    33.20249
               _cons |   22716.48   3366.577     6.75   0.000     16003.71    29429.24
        ------------------------------------------------------------------------------
        
        . wherext  mpg mpg_sq
        
        range of mpg                                   = [12,41]
        mpg+mpg_sq has minimum in argext               = 29.61501
        Std Error of argext (delta method)             = 1.934209
        95% confidence interval for argext             = ( 25.82403, 33.40599)
        
        .
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment

        Working...
        X