Announcement

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

  • Too large R Squared

    I regressed the loan rate on firm variables and loan characteristics and yield a way too high r squared compared to related studies.
    I have a Panel dataset and ran time and bank fixed effects model as well as random effects and also ran an OLS Regression and they all yield an R squared above 70%. The dataset:

    input double(Loanspread Duration) byte Housebank double Profitability float Corporationdummy int Age double Leverage long Loansize byte Maturity
    .0545 0 0 .0625 1 8 .95 475000 10
    .0025 0 0 .0625 1 8 .95 475000 10
    -.0023750000000000004 0 0 .0625 1 8 .95 150000 10
    .0252 5.75 1 .0875 1 6 .5 150000 10
    .09140000000000001 5.75 1 .0875 1 6 .5 30000 1
    .0907 6 1 .0875 1 6 .5 20000 1
    .0872 10 1 .0343558282208589 0 23 .72 80000 1
    .0867 11 1 .05060240963855422 0 24 .77 80000 1
    .0855 12 1 .03529411764705882 0 25 .9 120000 1
    .0502 1 0 .05060240963855422 0 24 .77 60000 6
    .09419999999999999 4.666666666666667 0 .03428571428571429 1 15 .2 100000 1
    .0407 0 0 .03428571428571429 1 15 .2 620000 20
    .0931 5 0 .03428571428571429 1 15 .2 230000 3
    .017599999999999998 4.75 1 .23333333333333334 0 7 .4 50000 10
    .007099999999999999 0 1 0 0 1 0 20000 10
    .09159999999999999 3 0 .23333333333333334 0 7 .4 15000 3
    .0326 10.083333333333334 0 .08125 1 20 .26 50000 10
    .0433 8 0 .0819277108433735 1 18 .32 125000 5
    .0517 0 0 .07549668874172186 1 19 .3 100000 5
    .0815 10 0 .08125 1 20 .26 15000 1
    .08259999999999999 9 0 .07549668874172186 1 19 .3 15000 1
    .07999999999999999 8 0 .0819277108433735 1 18 .32 15000 1
    .0884 10 0 .07549668874172186 1 19 .3 120000 1
    .0897 9 0 .0819277108433735 1 18 .32 120000 1
    .0867 10.583333333333334 0 .08125 1 20 .26 10000 1
    .039 7 0 .08 1 15 .55 70000 6
    .0409 5.166666666666667 0 .08 1 15 .55 100000 5
    .033299999999999996 5.083333333333333 1 .09375 1 10 .6 150000 4
    .0279 12 1 .11388888888888889 1 18 .45 350000 3
    .0245 14 1 .105 1 20 .45 300000 6
    .0455 0 0 .11 1 3 .44 30000 4
    .0491 1.33 0 .08333333333333333 1 4 .5 50000 5
    .1005 0 0 .11 1 3 .44 8000 1
    .1002 1 0 .08333333333333333 1 4 .5 8000 1
    .1003 1.083 0 .08333333333333333 1 4 .5 10000 3
    .0984 0 0 .022857142857142857 1 2 .45 100000 1
    .0943 .5833333333333334 0 .027105263157894736 1 3 .5 200000 3
    .0962 1 0 .027105263157894736 1 3 .5 100000 1
    .0526 0 0 .022857142857142857 1 2 .45 250000 5
    .051199999999999996 1.4166666666666667 0 .025 1 4 .5 200000 5
    .0816 5 1 .18795180722891566 1 7 .25 15000 1
    .0811 6 1 .18620689655172415 1 8 .25 25000 1
    .0804 7 1 .18604651162790697 1 9 .3 15000 1
    .025800000000000003 15 1 .07931034482758621 0 45 .6 350000 7
    .0227 20 1 .06666666666666667 0 50 .7 300000 10
    .0823 15 1 .07931034482758621 0 45 .6 150000 1
    .08070000000000001 16.5 1 .06785714285714285 0 46 .7 150000 1
    .0805 17.75 1 .06779661016949153 0 47 .7 150000 1
    .08779999999999999 7 1 .125 0 7 .5 20000 1
    .0339 7 1 .125 0 7 .5 15000 5
    .029 15 1 .18181818181818182 1 25 .8 150000 10
    .026000000000000002 15 1 .18181818181818182 1 25 .8 400000 15
    .0852 15 1 .18181818181818182 1 25 .8 50000 1
    .020999999999999998 20 1 .15 0 40 .2 150000 10
    .0812 20 1 .15 0 40 .2 50000 1
    .0257 15 1 .06666666666666667 1 35 .3 25000 5
    .0312 3 1 .1368421052631579 0 4 .25 300000 5
    .0254 6 1 .123 0 7 .2 250000 7
    .08760000000000001 3 1 .1368421052631579 0 4 .25 50000 1
    .0882 4.333333333333333 1 .14358974358974358 0 5 .2 80000 1
    .0887 5.333333333333333 1 .13368983957219252 0 6 .2 80000 1
    .0866 6 1 .123 0 7 .2 80000 1
    .0285 23 1 .14285714285714285 0 102 .42 80000 5
    .09240000000000001 8 0 .14285714285714285 0 102 .42 30000 1
    .0917 8.75 0 .13953488372093023 0 103 .45 45000 1
    .016 0 0 .14285714285714285 0 102 .42 80000 5
    .0191 14 1 .05495652173913043 1 17 .38 500000 10
    .0376 4 0 .05 1 22 .4 400000 7
    .0936 5 0 .05 1 22 .4 60000 2
    .0968 .16666666666666666 0 .05 1 22 .4 50000 2
    .0461 5 0 .06538461538461539 1 18 .5 150000 3
    .0465 4 0 .06538461538461539 1 18 .5 130000 4
    .094 4 0 .06538461538461539 1 18 .5 50000 2
    .0209 22 1 .09 1 26 .21 300000 5
    .0215 23 1 .09278350515463918 1 27 .28 250000 7
    .019799999999999998 25.25 1 .0875 1 29 .25 50000 9
    .0175 26.333333333333332 1 .08297872340425531 1 30 .25 80000 10
    .078 23.166666666666668 1 .09278350515463918 1 27 .28 80000 1
    .0274 16 1 .0893939393939394 1 17 .26 325000 10
    .027 18.333333333333332 1 .08941176470588236 1 19 .31 150000 8
    .0255 19.166666666666668 1 .08857142857142856 1 20 .33 220000 5
    .0815 18.166666666666668 1 .08941176470588236 1 19 .31 80000 1
    end
    [/CODE]
    ------------------ copy up to and including the previous line ------------------

    Listed 82 out of 82 observations

    Code:
     regress Loanspread Age Numberofemployees Corporationdummy Grossprofit Profitability Leverage Loansize Maturity g1 g2 Duration Housebank if Loantype!="Crédit"
    Does anybody have an idea what issue there could be?

  • #2
    Marcel:
    - if you do not share what you typed and what Stata gave you back (as per FAQ), interested listers cannot reply positively other than basing their answer on an educated-guess (in your case, overfitting might be a reason for seemingly sky-rocketing R-sq);
    - it is not clear why you performed (-xtreg-?) with -fe-, -re- and then OLS: they are different beasts, with different pros and cons;
    - sharing data excerpt/example that are inconsistent with the code you typed means wasting your time (because you will not receive helpful replies) and interested listers' time, too as they get frustrated with:
    Code:
    .  regress Loanspread Age Numberofemployees Corporationdummy Grossprofit Profitability Leverage Loansize Maturity g1 g2 Duration Housebank if Loantype!="Crédit"
    Loantype not found
    r(111);
    
    .  regress Loanspread Age Numberofemployees Corporationdummy Grossprofit Profitability Leverage Loansize Maturity g1 g2 Duration Housebank
    variable Numberofemployees not found
    in trying to replicate your code.

    Please, help others help yourself (as per FAQ again). Thanks.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Hi Carlo, I accidentally omitted the Information in the shared data. I try it again:

      input double Loanspread int Age byte Numberofemployees float Corporationdummy long Grossprofit double(Profitability Leverage) long Loansize byte(Maturity g2 g3) double Duration byte Housebank str6 Loantype
      .0545 8 28 1 1600000 .0625 .95 475000 10 1 0 0 0 "Credit"
      .0025 8 28 1 1600000 .0625 .95 475000 10 1 0 0 0 "Credit"
      -.0023750000000000004 8 28 1 1600000 .0625 .95 150000 10 1 0 0 0 "Credit"
      .0252 6 15 1 800000 .0875 .5 150000 10 1 0 5.75 1 "Credit"
      .09140000000000001 6 15 1 800000 .0875 .5 30000 1 1 0 5.75 1 "LC"
      .0907 6 15 1 800000 .0875 .5 20000 1 1 0 6 1 "LC"
      .0872 23 10 0 815000 .0343558282208589 .72 80000 1 0 0 10 1 "LC"
      .0867 24 10 0 830000 .05060240963855422 .77 80000 1 0 0 11 1 "LC"
      .0855 25 10 0 850000 .03529411764705882 .9 120000 1 0 0 12 1 "LC"
      .0502 24 10 0 830000 .05060240963855422 .77 60000 6 0 0 1 0 "Credit"
      .09419999999999999 15 25 1 3500000 .03428571428571429 .2 100000 1 0 1 4.666666666666667 0 "LC"
      .0407 15 25 1 3500000 .03428571428571429 .2 620000 20 0 1 0 0 "Credit"
      .0931 15 25 1 3500000 .03428571428571429 .2 230000 3 0 1 5 0 "LC"
      .017599999999999998 7 8 0 300000 .23333333333333334 .4 50000 10 1 0 4.75 1 "Credit"
      .007099999999999999 1 3 0 135000 0 0 20000 10 1 0 0 1 "Credit"
      .09159999999999999 7 8 0 300000 .23333333333333334 .4 15000 3 1 0 3 0 "LC"
      .0326 20 12 1 800000 .08125 .26 50000 10 0 0 10.083333333333334 0 "Credit"
      .0433 18 12 1 830000 .0819277108433735 .32 125000 5 0 0 8 0 "Credit"
      .0517 19 12 1 755000 .07549668874172186 .3 100000 5 0 0 0 0 "Credit"
      .0815 20 12 1 800000 .08125 .26 15000 1 0 0 10 0 "LC"
      .08259999999999999 19 12 1 755000 .07549668874172186 .3 15000 1 0 0 9 0 "LC"
      .07999999999999999 18 12 1 830000 .0819277108433735 .32 15000 1 0 0 8 0 "LC"
      .0884 19 12 1 755000 .07549668874172186 .3 120000 1 0 0 10 0 "LC"
      .0897 18 12 1 830000 .0819277108433735 .32 120000 1 0 0 9 0 "LC"
      .0867 20 12 1 800000 .08125 .26 10000 1 0 0 10.583333333333334 0 "LC"
      .039 15 10 1 1000000 .08 .55 70000 6 0 1 7 0 "Credit"
      .0409 15 10 1 1000000 .08 .55 100000 5 0 1 5.166666666666667 0 "Credit"
      .033299999999999996 10 12 1 800000 .09375 .6 150000 4 0 1 5.083333333333333 1 "Credit"
      .0279 18 25 1 1800000 .11388888888888889 .45 350000 3 0 1 12 1 "Credit"
      .0245 20 25 1 2000000 .105 .45 300000 6 0 1 14 1 "Credit"
      .0455 3 3 1 500000 .11 .44 30000 4 0 0 0 0 "Credit"
      .0491 4 3 1 600000 .08333333333333333 .5 50000 5 0 0 1.33 0 "Credit"
      .1005 3 3 1 500000 .11 .44 8000 1 0 0 0 0 "LC"
      .1002 4 3 1 600000 .08333333333333333 .5 8000 1 0 0 1 0 "LC"
      .1003 4 3 1 600000 .08333333333333333 .5 10000 3 0 0 1.083 0 "LC"
      .0984 2 25 1 1750000 .022857142857142857 .45 100000 1 0 0 0 0 "LC"
      .0943 3 29 1 1900000 .027105263157894736 .5 200000 3 0 0 .5833333333333334 0 "LC"
      .0962 3 29 1 1900000 .027105263157894736 .5 100000 1 0 0 1 0 "LC"
      .0526 2 25 1 1750000 .022857142857142857 .45 250000 5 0 0 0 0 "Credit"
      .051199999999999996 4 29 1 2000000 .025 .5 200000 5 0 0 1.4166666666666667 0 "Credit"
      .0816 7 9 1 415000 .18795180722891566 .25 15000 1 0 0 5 1 "LC"
      .0811 8 9 1 435000 .18620689655172415 .25 25000 1 0 0 6 1 "LC"
      .0804 9 9 1 430000 .18604651162790697 .3 15000 1 0 0 7 1 "LC"
      .025800000000000003 45 14 0 1450000 .07931034482758621 .6 350000 7 1 0 15 1 "Credit"
      .0227 50 15 0 1500000 .06666666666666667 .7 300000 10 1 0 20 1 "Credit"
      .0823 45 14 0 1450000 .07931034482758621 .6 150000 1 1 0 15 1 "LC"
      .08070000000000001 46 15 0 1400000 .06785714285714285 .7 150000 1 1 0 16.5 1 "LC"
      .0805 47 15 0 1475000 .06779661016949153 .7 150000 1 1 0 17.75 1 "LC"
      .08779999999999999 7 3 0 400000 .125 .5 20000 1 0 0 7 1 "LC"
      .0339 7 3 0 400000 .125 .5 15000 5 0 0 7 1 "Credit"
      .029 25 25 1 1100000 .18181818181818182 .8 150000 10 0 0 15 1 "Credit"
      .026000000000000002 25 25 1 1100000 .18181818181818182 .8 400000 15 0 0 15 1 "Credit"
      .0852 25 25 1 1100000 .18181818181818182 .8 50000 1 0 0 15 1 "LC"
      .020999999999999998 40 25 0 2000000 .15 .2 150000 10 0 0 20 1 "Credit"
      .0812 40 25 0 2000000 .15 .2 50000 1 0 0 20 1 "LC"
      .0257 35 12 1 1500000 .06666666666666667 .3 25000 5 0 0 15 1 "Credit"
      .0312 4 7 0 950000 .1368421052631579 .25 300000 5 0 0 3 1 "Credit"
      .0254 7 9 0 1000000 .123 .2 250000 7 0 0 6 1 "Credit"
      .08760000000000001 4 7 0 950000 .1368421052631579 .25 50000 1 0 0 3 1 "LC"
      .0882 5 8 0 975000 .14358974358974358 .2 80000 1 0 0 4.333333333333333 1 "LC"
      .0887 6 9 0 935000 .13368983957219252 .2 80000 1 0 0 5.333333333333333 1 "LC"
      .0866 7 9 0 1000000 .123 .2 80000 1 0 0 6 1 "LC"
      .0285 102 6 0 427000 .14285714285714285 .42 80000 5 0 0 23 1 "Credit"
      .09240000000000001 102 6 0 427000 .14285714285714285 .42 30000 1 0 0 8 0 "LC"
      .0917 103 6 0 430000 .13953488372093023 .45 45000 1 0 0 8.75 0 "LC"
      .016 102 6 0 427000 .14285714285714285 .42 80000 5 0 0 0 0 "Credit"
      .0191 17 28 1 2875000 .05495652173913043 .38 500000 10 0 1 14 1 "Credit"
      .0376 22 30 1 3000000 .05 .4 400000 7 0 1 4 0 "Credit"
      .0936 22 30 1 3000000 .05 .4 60000 2 0 1 5 0 "LC"
      .0968 22 30 1 3000000 .05 .4 50000 2 0 1 .16666666666666666 0 "LC"
      .0461 18 15 1 2600000 .06538461538461539 .5 150000 3 0 1 5 0 "Credit"
      .0465 18 15 1 2600000 .06538461538461539 .5 130000 4 0 1 4 0 "Credit"
      .094 18 15 1 2600000 .06538461538461539 .5 50000 2 0 1 4 0 "LC"
      .0209 26 35 1 2300000 .09 .21 300000 5 1 0 22 1 "Credit"
      .0215 27 35 1 2425000 .09278350515463918 .28 250000 7 1 0 23 1 "Credit"
      .019799999999999998 29 33 1 2400000 .0875 .25 50000 9 1 0 25.25 1 "Credit"
      .0175 30 33 1 2350000 .08297872340425531 .25 80000 10 1 0 26.333333333333332 1 "Credit"
      .078 27 34 1 2425000 .09278350515463918 .28 80000 1 1 0 23.166666666666668 1 "LC"
      .0274 17 26 1 1650000 .0893939393939394 .26 325000 10 0 0 16 1 "Credit"
      .027 19 26 1 1700000 .08941176470588236 .31 150000 8 0 0 18.333333333333332 1 "Credit"
      .0255 20 26 1 1750000 .08857142857142856 .33 220000 5 0 0 19.166666666666668 1 "Credit"
      .0815 19 26 1 1700000 .08941176470588236 .31 80000 1 0 0 18.166666666666668 1 "LC"
      end
      [CODE]
      generate Corporationdummy = (Legalform=="Corporation")
      tabulate Industry, generate (g)
      regress Loanspread Age Numberofemployees Corporationdummy Grossprofit Profitability Leverage Loansize Maturity g2 g3 Duration Housebank if Loantype!="Crédit"
      [CODE]
      I hope now you will be able to run the command. I used OLS and xtreg just to compare the explanatory power of those models. Also my observations size amounts to 82 observations and dividing it to lines of credits shortens them to 42, which might lead to unbiased results if time Dummies or firm or bank fixed effects are involved.

      Comment


      • #4
        In my view, with 82 (42, respectively) observations and 12 predictors, you are pushing towards the limits. Even without any knowledge of the theoretical underpinnings, if those data were not synthetically designed to be uncorrelated, I would not be surprised to find high values for R-square. I would not be surprised to find that the same model fits new data much worse, either.

        Best
        Daniel

        Comment


        • #5
          Marcel:
          thanks for providing a revised data excerpt.
          Unfortunately, -g1- is still unreported.
          Moreover, you do not say how your data were -xtset- before running -xtreg-: hence, I cannot replicate your panel data regression.
          As far as OLS is concerned (please note that is possible but rare that pooled OLS outperforms -xtreg-), running your code without -g1- gives back the following outcome, that suffers from both misspecificatio (as per -estat ovtest- p-value) and heteroskedasticity (as per -estat hettest- p-value):
          Code:
          . regress Loanspread Age Numberofemployees Corporationdummy Grossprofit Profitability Leverage Loansize Maturity g2 Dura
          > tion Housebank if Loantype!="Crédit"
          
                Source |       SS           df       MS      Number of obs   =        82
          -------------+----------------------------------   F(11, 70)       =     14.35
                 Model |  .054103236        11  .004918476   Prob > F        =    0.0000
              Residual |  .023995562        70  .000342794   R-squared       =    0.6928
          -------------+----------------------------------   Adj R-squared   =    0.6445
                 Total |  .078098798        81  .000964183   Root MSE        =    .01851
          
          -----------------------------------------------------------------------------------
                 Loanspread |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
          ------------------+----------------------------------------------------------------
                        Age |  -.0001971   .0001393    -1.41   0.162     -.000475    .0000808
          Numberofemployees |  -5.97e-06    .000467    -0.01   0.990    -.0009373    .0009254
           Corporationdummy |  -.0076343   .0067214    -1.14   0.260    -.0210396    .0057711
                Grossprofit |   5.79e-09   4.86e-09     1.19   0.238    -3.91e-09    1.55e-08
              Profitability |    .052252   .0541436     0.97   0.338     -.055734    .1602379
                   Leverage |   .0062586   .0114924     0.54   0.588    -.0166624    .0291795
                   Loansize |  -8.74e-09   2.47e-08    -0.35   0.724    -5.79e-08    4.04e-08
                   Maturity |  -.0060905    .000712    -8.55   0.000    -.0075105   -.0046705
                         g2 |  -.0024306   .0056588    -0.43   0.669    -.0137168    .0088555
                   Duration |   -.000138   .0005341    -0.26   0.797    -.0012032    .0009271
                  Housebank |  -.0124855   .0073188    -1.71   0.092    -.0270823    .0021113
                      _cons |   .0893163   .0110216     8.10   0.000     .0673343    .1112982
          -----------------------------------------------------------------------------------
          
          . estat ovtest
          
          Ramsey RESET test using powers of the fitted values of Loanspread
                 Ho:  model has no omitted variables
                            F(3, 67) =     36.93
                            Prob > F =      0.0000
          
          . estat hettest
          
          Breusch-Pagan / Cook-Weisberg test for heteroskedasticity
                   Ho: Constant variance
                   Variables: fitted values of Loanspread
          
                   chi2(1)      =    25.60
                   Prob > chi2  =   0.0000
          Hence, sky-rocketing R-sq seems to be the sign of a regression model that should be improved and, in the light of the scant sample size, made more parsimonious.

          PS: crossed in the cyberspace with Daniel's helpful reply.
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment


          • #6
            Included g1:

            input double Loanspread int Age byte Numberofemployees float Corporationdummy long Grossprofit double(Profitability Leverage) long Loansize byte Maturity str14 U byte(g1 g2 g3) double Duration byte Housebank str6 Loantype
            .0545 8 28 1 1600000 .0625 .95 475000 10 "Volksbank A" 0 1 0 0 0 "Credit"
            .0025 8 28 1 1600000 .0625 .95 475000 10 "Förderbank A" 0 1 0 0 0 "Credit"
            -.0023750000000000004 8 28 1 1600000 .0625 .95 150000 10 "Förderbank B" 0 1 0 0 0 "Credit"
            .0252 6 15 1 800000 .0875 .5 150000 10 "Volksbank B" 0 1 0 5.75 1 "Credit"
            .09140000000000001 6 15 1 800000 .0875 .5 30000 1 "Volksbank B" 0 1 0 5.75 1 "LC"
            .0907 6 15 1 800000 .0875 .5 20000 1 "Volksbank B" 0 1 0 6 1 "LC"
            .0872 23 10 0 815000 .0343558282208589 .72 80000 1 "Volksbank B" 1 0 0 10 1 "LC"
            .0867 24 10 0 830000 .05060240963855422 .77 80000 1 "Volksbank B" 1 0 0 11 1 "LC"
            .0855 25 10 0 850000 .03529411764705882 .9 120000 1 "Volksbank B" 1 0 0 12 1 "LC"
            .0502 24 10 0 830000 .05060240963855422 .77 60000 6 "Volksbank A" 1 0 0 1 0 "Credit"
            .09419999999999999 15 25 1 3500000 .03428571428571429 .2 100000 1 "Private bank A" 0 0 1 4.666666666666667 0 "LC"
            .0407 15 25 1 3500000 .03428571428571429 .2 620000 20 "Sparkasse B" 0 0 1 0 0 "Credit"
            .0931 15 25 1 3500000 .03428571428571429 .2 230000 3 "Sparkasse A" 0 0 1 5 0 "LC"
            .017599999999999998 7 8 0 300000 .23333333333333334 .4 50000 10 "Förderbank A" 0 1 0 4.75 1 "Credit"
            .007099999999999999 1 3 0 135000 0 0 20000 10 "Förderbank A" 0 1 0 0 1 "Credit"
            .09159999999999999 7 8 0 300000 .23333333333333334 .4 15000 3 "Private bank A" 0 1 0 3 0 "LC"
            .0326 20 12 1 800000 .08125 .26 50000 10 "Volksbank B" 1 0 0 10.083333333333334 0 "Credit"
            .0433 18 12 1 830000 .0819277108433735 .32 125000 5 "Volksbank B" 1 0 0 8 0 "Credit"
            .0517 19 12 1 755000 .07549668874172186 .3 100000 5 "Private bank B" 1 0 0 0 0 "Credit"
            .0815 20 12 1 800000 .08125 .26 15000 1 "Volksbank B" 1 0 0 10 0 "LC"
            .08259999999999999 19 12 1 755000 .07549668874172186 .3 15000 1 "Volksbank B" 1 0 0 9 0 "LC"
            .07999999999999999 18 12 1 830000 .0819277108433735 .32 15000 1 "Volksbank B" 1 0 0 8 0 "LC"
            .0884 19 12 1 755000 .07549668874172186 .3 120000 1 "Sparkasse A" 1 0 0 10 0 "LC"
            .0897 18 12 1 830000 .0819277108433735 .32 120000 1 "Sparkasse A" 1 0 0 9 0 "LC"
            .0867 20 12 1 800000 .08125 .26 10000 1 "Sparkasse A" 1 0 0 10.583333333333334 0 "LC"
            .039 15 10 1 1000000 .08 .55 70000 6 "Sparkasse A" 0 0 1 7 0 "Credit"
            .0409 15 10 1 1000000 .08 .55 100000 5 "Private bank B" 0 0 1 5.166666666666667 0 "Credit"
            .033299999999999996 10 12 1 800000 .09375 .6 150000 4 "Sparkasse A" 0 0 1 5.083333333333333 1 "Credit"
            .0279 18 25 1 1800000 .11388888888888889 .45 350000 3 "Sparkasse A" 0 0 1 12 1 "Credit"
            .0245 20 25 1 2000000 .105 .45 300000 6 "Sparkasse A" 0 0 1 14 1 "Credit"
            .0455 3 3 1 500000 .11 .44 30000 4 "Private bank A" 1 0 0 0 0 "Credit"
            .0491 4 3 1 600000 .08333333333333333 .5 50000 5 "Private bank B" 1 0 0 1.33 0 "Credit"
            .1005 3 3 1 500000 .11 .44 8000 1 "Volksbank A" 1 0 0 0 0 "LC"
            .1002 4 3 1 600000 .08333333333333333 .5 8000 1 "Volksbank A" 1 0 0 1 0 "LC"
            .1003 4 3 1 600000 .08333333333333333 .5 10000 3 "Volksbank C" 1 0 0 1.083 0 "LC"
            .0984 2 25 1 1750000 .022857142857142857 .45 100000 1 "Volksbank A" 1 0 0 0 0 "LC"
            .0943 3 29 1 1900000 .027105263157894736 .5 200000 3 "Volksbank A" 1 0 0 .5833333333333334 0 "LC"
            .0962 3 29 1 1900000 .027105263157894736 .5 100000 1 "Volksbank A" 1 0 0 1 0 "LC"
            .0526 2 25 1 1750000 .022857142857142857 .45 250000 5 "Private bank B" 1 0 0 0 0 "Credit"
            .051199999999999996 4 29 1 2000000 .025 .5 200000 5 "Private bank B" 1 0 0 1.4166666666666667 0 "Credit"
            .0816 7 9 1 415000 .18795180722891566 .25 15000 1 "Volksbank A" 1 0 0 5 1 "LC"
            .0811 8 9 1 435000 .18620689655172415 .25 25000 1 "Volksbank A" 1 0 0 6 1 "LC"
            .0804 9 9 1 430000 .18604651162790697 .3 15000 1 "Volksbank A" 1 0 0 7 1 "LC"
            .025800000000000003 45 14 0 1450000 .07931034482758621 .6 350000 7 "Volksbank A" 0 1 0 15 1 "Credit"
            .0227 50 15 0 1500000 .06666666666666667 .7 300000 10 "Volksbank A" 0 1 0 20 1 "Credit"
            .0823 45 14 0 1450000 .07931034482758621 .6 150000 1 "Volksbank A" 0 1 0 15 1 "LC"
            .08070000000000001 46 15 0 1400000 .06785714285714285 .7 150000 1 "Volksbank A" 0 1 0 16.5 1 "LC"
            .0805 47 15 0 1475000 .06779661016949153 .7 150000 1 "Volksbank A" 0 1 0 17.75 1 "LC"
            .08779999999999999 7 3 0 400000 .125 .5 20000 1 "Sparkasse B" 1 0 0 7 1 "LC"
            .0339 7 3 0 400000 .125 .5 15000 5 "Sparkasse B" 1 0 0 7 1 "Credit"
            .029 25 25 1 1100000 .18181818181818182 .8 150000 10 "Sparkasse A" 1 0 0 15 1 "Credit"
            .026000000000000002 25 25 1 1100000 .18181818181818182 .8 400000 15 "Sparkasse A" 1 0 0 15 1 "Credit"
            .0852 25 25 1 1100000 .18181818181818182 .8 50000 1 "Sparkasse A" 1 0 0 15 1 "LC"
            .020999999999999998 40 25 0 2000000 .15 .2 150000 10 "Sparkasse A" 1 0 0 20 1 "Credit"
            .0812 40 25 0 2000000 .15 .2 50000 1 "Sparkasse A" 1 0 0 20 1 "LC"
            .0257 35 12 1 1500000 .06666666666666667 .3 25000 5 "Sparkasse A" 1 0 0 15 1 "Credit"
            .0312 4 7 0 950000 .1368421052631579 .25 300000 5 "Volksbank A" 1 0 0 3 1 "Credit"
            .0254 7 9 0 1000000 .123 .2 250000 7 "Volksbank A" 1 0 0 6 1 "Credit"
            .08760000000000001 4 7 0 950000 .1368421052631579 .25 50000 1 "Volksbank A" 1 0 0 3 1 "LC"
            .0882 5 8 0 975000 .14358974358974358 .2 80000 1 "Volksbank A" 1 0 0 4.333333333333333 1 "LC"
            .0887 6 9 0 935000 .13368983957219252 .2 80000 1 "Volksbank A" 1 0 0 5.333333333333333 1 "LC"
            .0866 7 9 0 1000000 .123 .2 80000 1 "Volksbank A" 1 0 0 6 1 "LC"
            .0285 102 6 0 427000 .14285714285714285 .42 80000 5 "Sparkasse A" 1 0 0 23 1 "Credit"
            .09240000000000001 102 6 0 427000 .14285714285714285 .42 30000 1 "Sparkasse B" 1 0 0 8 0 "LC"
            .0917 103 6 0 430000 .13953488372093023 .45 45000 1 "Sparkasse B" 1 0 0 8.75 0 "LC"
            .016 102 6 0 427000 .14285714285714285 .42 80000 5 "Förderbank B" 1 0 0 0 0 "Credit"
            .0191 17 28 1 2875000 .05495652173913043 .38 500000 10 "Sparkasse A" 0 0 1 14 1 "Credit"
            .0376 22 30 1 3000000 .05 .4 400000 7 "Private bank A" 0 0 1 4 0 "Credit"
            .0936 22 30 1 3000000 .05 .4 60000 2 "Private bank B" 0 0 1 5 0 "LC"
            .0968 22 30 1 3000000 .05 .4 50000 2 "Private bank B" 0 0 1 .16666666666666666 0 "LC"
            .0461 18 15 1 2600000 .06538461538461539 .5 150000 3 "Private bank A" 0 0 1 5 0 "Credit"
            .0465 18 15 1 2600000 .06538461538461539 .5 130000 4 "Private bank B" 0 0 1 4 0 "Credit"
            .094 18 15 1 2600000 .06538461538461539 .5 50000 2 "Private bank B" 0 0 1 4 0 "LC"
            .0209 26 35 1 2300000 .09 .21 300000 5 "Volksbank A" 0 1 0 22 1 "Credit"
            .0215 27 35 1 2425000 .09278350515463918 .28 250000 7 "Volksbank A" 0 1 0 23 1 "Credit"
            .019799999999999998 29 33 1 2400000 .0875 .25 50000 9 "Volksbank A" 0 1 0 25.25 1 "Credit"
            .0175 30 33 1 2350000 .08297872340425531 .25 80000 10 "Volksbank A" 0 1 0 26.333333333333332 1 "Credit"
            .078 27 34 1 2425000 .09278350515463918 .28 80000 1 "Volksbank A" 0 1 0 23.166666666666668 1 "LC"
            .0274 17 26 1 1650000 .0893939393939394 .26 325000 10 "Volksbank A" 1 0 0 16 1 "Credit"
            .027 19 26 1 1700000 .08941176470588236 .31 150000 8 "Volksbank A" 1 0 0 18.333333333333332 1 "Credit"
            .0255 20 26 1 1750000 .08857142857142856 .33 220000 5 "Volksbank A" 1 0 0 19.166666666666668 1 "Credit"
            .0815 19 26 1 1700000 .08941176470588236 .31 80000 1 "Volksbank A" 1 0 0 18.166666666666668 1 "LC"
            end


            Code:
            egen Banks=group(U)
            xtset Banks

            Comment


            • #7
              Marcel:
              both your panel data models seem misspecified:
              Code:
              . encode U, g(U_n)
              
              . xtset U_n
                     panel variable:  U_n (unbalanced)
              
                
              . quietly xtreg Loanspread Age Numberofemployees Corporationdummy Grossprofit Profitability Leverage Loansize Maturity g1 g2 Duration Housebank if Loantype!="Crédit", fe
              
              . predict u_fe, xb
              
              . g sq_u_fe= u_fe^2
              
              . xtreg Loanspread u_fe sq_u_fe if Loantype!="Crédit", fe
              
              Fixed-effects (within) regression               Number of obs     =         82
              Group variable: U_n                             Number of groups  =          9
              
              R-sq:                                           Obs per group:
                   within  = 0.8463                                         min =          1
                   between = 0.2385                                         avg =        9.1
                   overall = 0.6534                                         max =         30
              
                                                              F(2,71)           =     195.47
              corr(u_i, Xb)  = -0.2064                        Prob > F          =     0.0000
              
              ------------------------------------------------------------------------------
                Loanspread |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
              -------------+----------------------------------------------------------------
                      u_fe |   .2093862   .1695137     1.24   0.221    -.1286144    .5473869
                   sq_u_fe |   7.945538    1.62078     4.90   0.000     4.713794    11.17728
                     _cons |   .0132895   .0042817     3.10   0.003      .004752    .0218269
              -------------+----------------------------------------------------------------
                   sigma_u |  .02628659
                   sigma_e |  .01133318
                       rho |  .84325481   (fraction of variance due to u_i)
              ------------------------------------------------------------------------------
              F test that all u_i=0: F(8, 71) = 17.46                      Prob > F = 0.0000
              
              . test sq_u_fe
              
               ( 1)  sq_u_fe = 0
              
                     F(  1,    71) =   24.03
                          Prob > F =    0.0000
              
              . quietly xtreg Loanspread Age Numberofemployees Corporationdummy Grossprofit Profitability Leverage Loansize Maturity g1 g2 Duration Housebank if Loantype!="Crédit", re
              
              . predict u_re, xb
              
              . g sq_u_re= u_re^2
              . xtreg Loanspread u_re sq_u_re if Loantype!="Crédit", re
              
              Random-effects GLS regression                   Number of obs     =         82
              Group variable: U_n                             Number of groups  =          9
              
              R-sq:                                           Obs per group:
                   within  = 0.8600                                         min =          1
                   between = 0.8662                                         avg =        9.1
                   overall = 0.8366                                         max =         30
              
                                                              Wald chi2(2)      =     454.93
              corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000
              
              ------------------------------------------------------------------------------
                Loanspread |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
              -------------+----------------------------------------------------------------
                      u_re |   -.337287   .1704485    -1.98   0.048      -.67136    -.003214
                   sq_u_re |   13.91134   1.704509     8.16   0.000     10.57056    17.25212
                     _cons |    .019049   .0051719     3.68   0.000     .0089123    .0291857
              -------------+----------------------------------------------------------------
                   sigma_u |  .00889619
                   sigma_e |  .01081424
                       rho |  .40360106   (fraction of variance due to u_i)
              ------------------------------------------------------------------------------
              
              . test sq_u_re
              
               ( 1)  sq_u_re = 0
              
                         chi2(  1) =   66.61
                       Prob > chi2 =    0.0000
              
              .
              Last edited by Carlo Lazzaro; 26 Feb 2019, 05:35.
              Kind regards,
              Carlo
              (Stata 19.0)

              Comment


              • #8
                Thanks for posting the data. R-squared being too large is less often a complaint than the opposite. In your regression table it seems clear that Maturity is easily the best predictor, so I looked at that.
                Click image for larger version

Name:	loanspread.png
Views:	1
Size:	26.8 KB
ID:	1485509



                I don't work with this kind of data, but various questions arise in my mind:

                1. Loan spread can be negative. Correct?

                2. A linear functional form does not seem obviously best.

                3. Is this surprising financially?

                Adding a panel flavour is no doubt key too.
                Last edited by Nick Cox; 26 Feb 2019, 05:50.

                Comment


                • #9
                  Thx for your replies and your help. Anyhow the if clause didnt work and your xtreg was conducted on all types of loans. However overdraft rates are exorbitantly higher (and always are of maturities between 1 and 3 years) than for credit loans so we need to distinguish them. Carlo, could you please explain me the Intuition behind the chi square statistic that you performed. Nick, the negative loanspread is possible, since the loan got granted by a promotional bank.

                  Comment


                  • #10
                    "didn't work" doesn't inform precisely. I note that in #3 there is no accent within "Credit" but in #7 Carlo is testing for inequality with "Crédit", which excludes no observations, presumably.

                    Comment


                    • #11
                      Thank you for the clarification Nick. I dont see any other mistyping. Related to your suggestion of having a suboptimal functional form, do you regard this for the variable maturity only or for other variables or even the whole model?

                      Comment


                      • #12
                        I haven't looked at anything beyond what is reported in #8.

                        Comment


                        • #13
                          Marcel:
                          I would be really happy if what reported in my previous reply was due to my intuition!
                          Sadly for me, it's Pregibon's, not mine (see -linktest- entry in Stata .pdf manual).
                          Kind regards,
                          Carlo
                          (Stata 19.0)

                          Comment


                          • #14
                            The Problem could be endogeneity of the loan contract variables maturity and loansize. If i am correct, then I could Control for endogenity by finding an instrumental variable that affects the endogenous variable loansize and at least one other for maturity but that does not affect my dependent variable. I ran correlation Analysis:
                            Code:
                             pwcorr Loanspread Age Numberofemployees Corporationdummy Grossprofit Profitability Leverage Loansize Maturity g2 g3 Duration Housebank, sig star(.05)
                            and found Grossprofit to be significantly correlated to loansize but not to Loanspread. Am I doing it Right to exclude grossprofit from my Regression so that it can serve as Instrument for loansize? Also, is it possible to do:
                            Code:
                             Regress
                            Loansize A
                            ge Numberofemployees Corporationdummy GrossProfit Profitability Leverage Loansize Maturity g2 g3 Duration Housebank
                            predict Loansize_hat
                            Regress
                            Maturity A
                            ge Numberofemployees Corporationdummy GrossProfit Profitability Leverage Loansize Maturity g2 g3 Duration Housebank
                            predict Maturity_hat ivregress 2sls
                            Loansize_hat A
                            ge Numberofemployees Corporationdummy GrossProfit Profitability Leverage Maturity_hat g2 g3 Duration Housebank
                            and use all explanatory variables in the first stage Regression? Intuition is that Theory predicts Banks to either Control for firm Risk and changes in relationship intensity by changing loansize, maturity or interest rate and by running the first stage regressions for maturity and loansize, I believe to control for the Variation in the other loan contract Terms due to changes in firm Risk or my relationship measures.

                            Comment


                            • #15
                              Could anybody help me finding the Right Approach to Control for endogeneity of the loan contract Terms. My suggestions: identifying among my exogenous variables one that correlates with one contract term but not with the other like "Grossprofit" and use it as Instrument, or
                              use all explanatory variables in the first stage Regression for predicting each of the contract Terms and continue with the predicted values in the second stage including all contract Terms as well as Instruments i used in the first stage Regression.

                              Comment

                              Working...
                              X