Announcement

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

  • panel data - u-shaped correlation

    Hi everyone!

    I am currently analysing the influence of the cost ratio of insurance companies and using several independent variable to find out, if those variable have a significant positiv or negativ impact on the cost ratio. Hereby the additional informations:

    - panel data (5 years)
    - using Fixed Effect
    - dependent variable: cost ratio
    - independent variable: company size, leverage etc....
    --> xtreg costratio lnassets leverage lnage gwpgrowth risk inflation unemployment gdpgrowth, fe

    However, some independent variables might have a u-shaped / inverse u-shaped correlation to the cost ratio. With xtreg fe, I only find out if the independent variable is positiv or negative correlated to the cost ratio.

    How can I check, if some of the independent variables have a u-shaped / inverse u-shaped correlation? I have already seen in the forum the command utest. How can I download this test to me STATA and apply for my test?

    Many thanks in advance for your support.

    Bests,
    David

  • #2
    To install -utest-, run -ssc install utest-. Then read -help utest- for instructions on how to use it.

    Comment


    • #3
      Code:
      . utest var1 var2
      last estimates not found
      r(301);
      I´m getting this error (both variables are byte type)

      Comment


      • #4
        From the help file for -utest-:
        utest is used after estimation commands to test for the presence of a U-shaped or inverse U-shaped relationship between an explanatory variable and the outcome variable on a specific interval.
        You don't show the estimation command you ran before -utest-. I'm guessing you didn't run one.

        Comment


        • #5
          Ok, i didnt run any estimation command, ill try doing that tonight.
          Thanks

          Comment


          • #6
            Code:
            . regress X Y YSQUARED,beta
            
                  Source |       SS           df       MS      Number of obs   =     1,065
            -------------+----------------------------------   F(2, 1062)      =      9.47
                   Model |  67.4875327         2  33.7437664   Prob > F        =    0.0001
                Residual |  3783.54533     1,062  3.56266039   R-squared       =    0.0175
            -------------+----------------------------------   Adj R-squared   =    0.0157
                   Total |  3851.03286     1,064  3.61939179   Root MSE        =    1.8875
            
            ------------------------------------------------------------------------------
            Yl |      Coef.   Std. Err.      t    P>|t|                     Beta
            -------------+----------------------------------------------------------------
                    X|   .1371571   .0412853     3.32   0.001                 .8434685
                   XSQUARED|  -.0016685    .000459    -3.64   0.000                -.9229167
                   _cons |   .3644402   .8816696     0.41   0.679                        .
            ------------------------------------------------------------------------------
            
            . utest X XSQUARED
            
            Specification: f(x)=x^2
            Extreme point:  41.10168
            
            Test:
                 H1: Inverse U shape
             vs. H0: Monotone or U shape
            
            -------------------------------------------------
                             |   Lower bound      Upper bound
            -----------------+-------------------------------
            Interval         |          25               65
            Slope            |    .0537316        -.0797492
            t-value          |    2.872767         -4.12661
            P>|t|            |     .002075         .0000198
            -------------------------------------------------
            
            Overall test of presence of a Inverse U shape:
                 t-value =      2.87
                 P>|t|   =    .00207
            Any idea on how to interpret these results? Does this mean there is an Inverse U shape relation between Y and X ?
            Last edited by Joaquin Carrascosa; 07 Jul 2018, 20:45.

            Comment


            • #7
              Any idea on how to interpret these results? Does this mean there is an Inverse U shape relation between Y and X ?
              Yes, the null hypothesis of either a monotone or direct U-shape relationship has been rejected at p = 0.00207. So you are left with the alternate hypothesis of an inverse U-shape, according to this test. The point at which the relationship achieves its peak is estimated as when X = 41.10168

              Comment


              • #8
                Ok, thanks for the help!

                Comment


                • #9
                  Thanks Clyde Schechter for ur help.

                  In the meantime, i have installed it but I dont know how to run the utest:

                  As Joaquin did, I have to run first the panel regression:

                  xtreg costratioW lnassetsW organization lnageW lineofbusiness leverageW gwpgrowthW riskW gdpgrowth inflation unemployment, fe
                  Click image for larger version

Name:	1.JPG
Views:	1
Size:	90.2 KB
ID:	1453648



                  Because organization (stock or mutual) and line of business (life/nonlife vs. both) are omitted, i used the regression with dummy variable to get the result of all independent variables (i increased the matsize, because there are 930 companies over 5 years):

                  regress costratioW lnassetsW organization lnageW lineofbusiness leverageW gwpgrowthW riskW gdpgrowth inflation unemployment i.company
                  Click image for larger version

Name:	2.JPG
Views:	1
Size:	90.6 KB
ID:	1453649


                  With those results, I know if the independent variable has a significant positiv or negativ impact on the cost ratio, but not if there is an u-shaped or inverse u-shaped relationship.

                  The syntax of the u test is as followed (according to help utest):

                  utest x f(x)

                  X is probably the variable costratioW in my example. But how can i get the non-linear term, either quadratic or inverse (i.e. f(x) )?

                  Many thanks in advance for your support!

                  Comment


                  • #10
                    X is probably the variable costratioW in my example.
                    No. Follow your own example in #6. The "x" should be the predictor variable you are interested in exploring for a quadratic relationship to costratioW, and the f(x) should be another variable that is the square of that one, and which must also be included in the regression.

                    -utest- is, I believe, a fairly old command and as far as I know it does not support factor variable notation. So if you want to test for a quadratic relationship between lnassetsW and costratioW you would do this:
                    Code:
                    gen lnassetsWsq= lnassetsW^2
                    xtreg costratioW lnassetsW lnassetsWsq organization lnageW lineofbusiness leverageW gwpgrowthW riskW gdpgrowth inflation unemployment, fe
                    utest lnassetsW lnassetsWsq

                    Comment


                    • #11
                      Thank you so much for your support so far.

                      I used the codes, but probably the extreme point is not in the interval, so that there is no u shaped relation ship, right? How can I find out if there is an inverse u-shaped relationship?

                      Bests,
                      Rolf

                      Click image for larger version

Name:	1.JPG
Views:	1
Size:	75.0 KB
ID:	1453861

                      Click image for larger version

Name:	2.JPG
Views:	1
Size:	64.3 KB
ID:	1453862

                      Comment


                      • #12
                        Well, yes, in this case the vertex of the parabola lies far from the interval, so within the interval you do not have a U-shaped relationship. There is no separate test for inverse-U shaped relationships. It's the same test; the difference is just based on the sign of the quadratic coefficient. In your case, that sign is negative, so if we did have a quadratic relationship, it would be an inverse-U. (But, again, the vertex is far from the interval, so we do not fit a quadratic model here.)

                        Comment


                        • #13
                          I have an additional question which came up:

                          I followed your instructions:

                          1) gen lnassetsWsq= lnassetsW^2
                          2) xtreg costratioW lnassetsW lnassetsWsq organization lnageW lineofbusiness leverageW gwpgrowthW riskW gdpgrowth inflation unemployment, fe
                          3) utest lnassetsW lnassetsWsq

                          When I run the FE regression with lnassetsWsq in 2), i received the following results:
                          PIC1.JPG


                          (a)
                          My question is relating to the following variables: lnassetsW and lnassetsWsq:
                          (i) Should both be significant? (both are not significant)
                          (ii) Should lnassetsW has a negativ and lnassetsWsq a positiv value?

                          If both conditions ((i) and (ii)) are not true, i shouldnt even start an utest, right?

                          (b)
                          Can I skip the other control variables and just use the following three variables to test the u shape relationship?

                          xtreg costratioW lnassetsW lnassetsWsq

                          Many thanks in advance for your support.
                          Last edited by David Meyer; 08 Aug 2018, 03:57.

                          Comment


                          • #14
                            Originally posted by Clyde Schechter View Post
                            Well, yes, in this case the vertex of the parabola lies far from the interval, so within the interval you do not have a U-shaped relationship. There is no separate test for inverse-U shaped relationships. It's the same test; the difference is just based on the sign of the quadratic coefficient. In your case, that sign is negative, so if we did have a quadratic relationship, it would be an inverse-U. (But, again, the vertex is far from the interval, so we do not fit a quadratic model here.)
                            (c)
                            Furthermore, does it make sense to increase the interval so that the extreme point is in the interval?

                            Many thanks for your help

                            Comment


                            • #15
                              That depends on how you chose the interval.

                              If the interval already spans the data (or the important/credible part of the data), then expanding the interval means extrapolating the model, which is a really bad idea. If, however, you chose the interval highly restricted to an unrepresentative subset of the data, then expanding it to be more representative of the data wold be a good idea.

                              Comment

                              Working...
                              X