Announcement

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

  • Squared Terms

    Dear Statalist members,

    I have a panel dataset where my dependent variable is a dummy = 1 if the client switches to using self-directed investing, 0 otherwise. My independent variables are performance ratio and the cumulative percentage of using automation.

    Code:
    g PercentAutoBid_2= PercentAutoBid*PercentAutoBid
    
            eststo: reghdfe Auto2Man l.performance_ratio l.PercentAutoBid l.PercentAutoBid_2 ///
                ,a(`fe') cluster(interaction)
    I want to check whether to include squared term in my regression so I run nlcom

    Code:
            nlcom -_b[l.PercentAutoBid]/(2*_b[l.PercentAutoBid_2])
    
    ------------------------------------------------------------------------------
        Auto2Man | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
           _nl_1 |   .4370262   .0009158   477.22   0.000     .4352314    .4388211
    ------------------------------------------------------------------------------
    The results show me that the coefficient (0.43) lies between the range of PercentAuto. Percent auto is from 0 to 1. which means that I have an inverted U shape right?

    then I run the margins command

    Code:
            margins, at(l.PercentAutoBid = (0(0.2)1))
            marginsplot
    And I get this result
    Click image for larger version

Name:	plot2.png
Views:	1
Size:	144.9 KB
ID:	1640715


    Can someone help me whether I should include a squared term or not?

    Thanks


  • #2
    1. the -nl- command you used tells you where the vertex (local min or max) is but does not tell you whether you should include a squared term

    2. since you formed the squared term yourself, rather than using factor variable notation, margins will not help here; see
    Code:
    help fvvarlist
    help margins
    3. otherwise you have not given enough info (note that contextual knowledge here is very important - is there any reason to expect a non-linearity and, in particular, is there reason to expect a parabola?)

    Comment


    • #3
      Jake:
      1) why not using -fvvarlist- notation (supported by the community-contributed module -reghdfe-) to create squared terms (assuming that a squared term makes sense given your predictors)?
      Code:
      reghdfe Auto2Man i.performance_ratio c.PercentAutoBid##c.PercentAutoBid_2  ,a(`fe') cluster(interaction)
      2) in addition, if you create another variable with the squared term outside the -fvvarlist- notation framework, -margns- and -marginspot- cannot track down the link between linear and squared terms variables, that they consider as uncorrelated.
      Kind regards,
      Carlo
      (StataNow 18.5)

      Comment

      Working...
      X