Announcement

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

  • nlcom: maximum

    Hello together,

    we're doing an inverted u-shape analysis on the impact of CSR Score on the TOA of different firms moderated by our time invariant moderator Consistency (Kurtosis of CSR Score).
    We would like to investigate if the turning point of the u-shape relationships significantly deviates with different levels of consistency. Therefore we found examples who used the nlcom code using the minimum, maximum, mean, mean +1 SD & mean - 1 SD levels of the moderating variables values.

    We ran the following:

    Code:
     xtreg roa c.csr_score##c.csr_score##c.consistency ln_firmsize ln_adi ln_rdi slack lev_w industry_growth industry
    > _concentration i.fyear, fe cluster(cusipnr)
    note: consistency omitted because of collinearity.
    
    Fixed-effects (within) regression               Number of obs     =      4,417
    Group variable: cusipnr                         Number of groups  =        606
    
    R-squared:                                      Obs per group:
         Within  = 0.0754                                         min =          3
         Between = 0.0699                                         avg =        7.3
         Overall = 0.0472                                         max =         16
    
                                                    F(26,605)         =       4.38
    corr(u_i, Xb) = -0.3052                         Prob > F          =     0.0000
    
                                                           (Std. err. adjusted for 606 clusters in cusipnr)
    -------------------------------------------------------------------------------------------------------
                                          |               Robust
                                      roa | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
    --------------------------------------+----------------------------------------------------------------
                                csr_score |   .0017239   .0005557     3.10   0.002     .0006325    .0028154
                                          |
                  c.csr_score#c.csr_score |   -.000018   5.19e-06    -3.46   0.001    -.0000282   -7.77e-06
                                          |
                              consistency |          0  (omitted)
                                          |
                c.csr_score#c.consistency |  -.0007174   .0002731    -2.63   0.009    -.0012538    -.000181
                                          |
    c.csr_score#c.csr_score#c.consistency |   7.78e-06   2.65e-06     2.94   0.003     2.58e-06     .000013
                                          |
                              ln_firmsize |  -.0031383   .0062741    -0.50   0.617    -.0154599    .0091834
                                   ln_adi |  -.0052481   .0055574    -0.94   0.345    -.0161622     .005666
                                   ln_rdi |  -.0486486    .008962    -5.43   0.000     -.066249   -.0310483
                                    slack |   -.116426   .0318931    -3.65   0.000    -.1790607   -.0537912
                                    lev_w |   .0001744   .0007524     0.23   0.817    -.0013032     .001652
                          industry_growth |   .0262122   .0120354     2.18   0.030      .002576    .0498483
                   industry_concentration |  -.0017947   .0170669    -0.11   0.916    -.0353123    .0317229
                                          |
                                    fyear |
                                    2004  |   .0264904   .0091348     2.90   0.004     .0085506    .0444301
                                    2005  |   .0261167   .0113369     2.30   0.022     .0038522    .0483813
                                    2006  |   .0290126   .0124341     2.33   0.020     .0045934    .0534318
                                    2007  |   .0214981   .0125808     1.71   0.088    -.0032092    .0462054
                                    2011  |   .0261853   .0138109     1.90   0.058     -.000938    .0533085
                                    2012  |   .0136148   .0139187     0.98   0.328      -.01372    .0409495
                                    2013  |   .0172718   .0141745     1.22   0.224    -.0105654    .0451089
                                    2014  |   .0222723   .0142534     1.56   0.119    -.0057199    .0502645
                                    2015  |   .0169446    .014851     1.14   0.254    -.0122211    .0461104
                                    2016  |   .0195737   .0148799     1.32   0.189    -.0096489    .0487963
                                    2017  |    .016874   .0156194     1.08   0.280    -.0138008    .0475488
                                    2018  |   .0337998   .0159556     2.12   0.035     .0024647    .0651348
                                    2019  |    .026212   .0169868     1.54   0.123    -.0071483    .0595723
                                    2020  |   .0236843   .0181686     1.30   0.193     -.011997    .0593655
                                    2021  |   .0459652   .0183655     2.50   0.013     .0098973     .082033
                                          |
                                    _cons |  -.1923473    .059989    -3.21   0.001    -.3101592   -.0745354
    --------------------------------------+----------------------------------------------------------------
                                  sigma_u |  .13053874
                                  sigma_e |  .08199672
                                      rho |  .71707153   (fraction of variance due to u_i)
    -------------------------------------------------------------------------------------------------------
    followed by the nlcom (-5.955 is the minimum of consistency)

    Code:
    nlcom (_b[csr_score]*_b[c.csr_score#c.csr_score#c.consistency] - _b[c.csr_score#c.csr_score]*_b[c.csr_score#c.co
    > nsistency]) / 2*(_b[c.csr_score#c.csr_score]+_b[c.csr_score#c.csr_score#c.consistency]*(-5.954534))^2
    We got the error "Maximum number of iterations exceeded." What can be the reasons for this error? Maybe because consistency got omitted in the regression? Or maybe because of our very low coefficients? How can we solve this problem?

    Thank you for every little hint

  • #2
    For the reasons that you yourself mention, the fitted model does not look good at all: consistency is omitted, and the triple interaction has a coefficient very close to 0. Apparently this causes numerical problems in -nlcom-. I guess you should fix your fitted model, and figure out why consistency is omitted. Do you really need this triple interaction? Has the previous literature estimated such triple interactions? Etc.

    Comment


    • #3
      Consistency gets omitted because of collinearity, its a time invariant variable in a fixed-effects model. We have addressed this problem but we were told that the model is still appropiate because we're investigating the moderating effect of consistency and not the effect of consistency on ROA itself.

      Do you know if there is any recommended (statistical) literature on the analysis of turning point shift in a moderated u-shaped/curvelinear relationship? The structure of the code with the interactions was used by colleagues of us and they got appropriate results.

      Comment


      • #4
        louisa linkemeyer: What value do you get when you -display- your expression rather than -nlcom-? If the value is very close to zero, it often helps to scale up the expression initially (see step 1 below, where I multiply your original expression by 1e+10 and apply -nlcom, post-) and then subsequently re-scale it back to original units (see step 2). If 1e+10 doesn't work, try to play around with alternative multiples, e.g., 1e+15, 1e+5, 1e+20 and the like.
        Code:
         nlcom (step1: 1e+10 * ((_b[csr_score]*_b[c.csr_score#c.csr_score#c.consistency] - _b[c.csr_score#c.csr_score]*_b[c.csr_score#c.co > nsistency]) / 
        2*(_b[c.csr_score#c.csr_score]+_b[c.csr_score#c.csr_score#c.consistency]*(-5.954534))^2)), post
        
        nlcom (step2: _b[step1]/1e+10)
        Similarly, if the value you get from -display- is very large in magnitude, it often helps to scale down the expression: In the context of the example above, simply replace 1e+10 with 1e-10 in each step.
        Last edited by Hong Il Yoo; 03 Jan 2023, 02:53.

        Comment


        • #5
          Originally posted by louisa linkemeyer View Post
          We got the error "Maximum number of iterations exceeded." What can be the reasons for this error? Maybe because consistency got omitted in the regression? Or maybe because of our very low coefficients?
          I'd suspect the latter, especially their standard errors.

          How can we solve this problem?

          Thank you for every little hint
          Try dividing your CSR scores by a thousand, or ten thousand or even one-hundred thousand before fitting the model.

          -nlcom- needs to use numerical derivatives and first finds the optimum step size iteratively; hence, an -iterate()- option. Your three-way interaction term (especially) and your two-way interaction term are small, and both have practically infinitesimal standard errors to begin with. My guess is that -nlcom- cannot find the optimum (unattainable precision) and runs through the iterations in futility.

          Comment


          • #6
            I hadn't seen Hong's suggestion when I posted mine. I recommend going with his.
            Code:
            version 17.0
            
            clear *
            
            // seedem
            set seed 238268142
            
            quietly set obs 250
            generate int pid = _n
            generate double pid_u = rnormal()
            generate double trt = runiform()
            
            quietly expand 10
            bysort pid: generate double tim = _n - 5.5
            
            generate double out = tim * tim * trt + pid_u + rnormal()
            
            *
            * Begin here
            *
            summarize trt, meanonly
            tempname min
            scalar define `min' = r(min)
            
            xtreg out c.tim##c.tim##c.trt, i(pid) fe
            
            capture noisily nlcom ///
                (_b[tim]*_b[tim#tim#trt] - _b[tim#tim] * _b[tim#trt]) / 2 * ///
                (_b[tim#tim] + _b[tim#tim#trt] * `min')^2
            
            display in smcl as text (_b[tim]*_b[tim#tim#trt] - _b[tim#tim] * _b[tim#trt]) / 2 * ///
                (_b[tim#tim] + _b[tim#tim#trt] * `min')^2
            
            nlcom 1e8 * ///
                (_b[tim]*_b[tim#tim#trt] - _b[tim#tim] * _b[tim#trt]) / 2 * ///
                (_b[tim#tim] + _b[tim#tim#trt] * `min')^2
            
            exit

            Comment


            • #7
              Thank you so much Joseph Coveney & Hong Il Yoo , I decided the CSR Score by 100 and its turned out that this does a really good job for both the coefficient of our regression model and the nlcom code
              I really appreciate your help.

              Comment

              Working...
              X