Announcement

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

  • Interpreting Regression Results

    I posted a couple of months ago asking for help in regards to a study on how London Southend Airport has impacted local house prices.

    I have completed the regressions but need some help understanding my results.

    The variable of interest is the 'distance to the airport' and the model includes linear, quadratic and cubic terms;

    lnsoldprice = -0.392*distance + 0.1246*distance^2 - 0.0111distance^3 + controls...

    Can someone help me understand these results please?

    Is the marginal effect of distance found by differentiating lnsoldprice with respect to distance?

    Thank you - much appreciated!

  • #2
    Please read the FAQ advice. There you'll find how to share commannd/output/data in the forum.

    That being said, you may use - margins - followed by - marginsplot - so as to provide a friendlier view and interpret the results.
    Best regards,

    Marcos

    Comment


    • #3
      Hi Marcos - I have previously posted using the dataex function to give an example of my dataset but I couldn't work out how to post an example of my output. I understand the advantage of doing so so provide the alternative I can get STATA to produce; an example of my dataset and the regress command used.

      Comment


      • #4
        Code:
        * Example generated by -dataex-. To install: ssc install dataex
        clear
        input float lnsoldprice double distancetoairport float(distancetoairport2 distancetoairport3) byte(dum_propertytype_Detached dum_propertytype_Flat dum_propertytype_Terraced receptionrooms separatediningroom bedrooms bathrooms)
        13.171153 1.99  3.9601  7.880599 1 0 0 3 0 4 4
         12.94801 2.18  4.7524 10.360232 1 0 0 2 0 4 4
        12.666657 1.67  2.7889  4.657463 0 0 0 1 0 5 3
          12.7367  2.3    5.29    12.167 0 0 0 2 1 3 2
          12.7513  2.3    5.29    12.167 0 0 0 2 0 3 2
        12.959845  2.3    5.29    12.167 0 0 0 3 1 4 2
        12.706697 2.36  5.5696 13.144256 0 0 0 1 1 3 1
        12.560245 1.84  3.3856  6.229504 0 0 1 2 1 3 1
        12.429216  2.2    4.84    10.648 0 0 0 1 0 2 1
        12.560245 1.65  2.7225  4.492125 0 0 0 2 1 3 1
        12.332705 1.75  3.0625  5.359375 0 0 0 1 1 4 2
        12.429196 1.75  3.0625  5.359375 0 0 0 2 0 3 2
        12.706848  1.7    2.89     4.913 0 0 0 1 1 4 3
        12.409014 1.88  3.5344  6.644672 0 0 0 1 1 2 1
        12.254863 2.13  4.5369  9.663597 0 0 1 1 0 3 2
         12.15478 2.11  4.4521  9.393931 0 0 1 2 1 3 1
         11.71994 1.95  3.8025  7.414875 0 1 0 1 0 2 1
        12.206073 1.89  3.5721  6.751269 0 0 0 2 0 3 1
         12.07824 1.68  2.8224  4.741632 0 0 0 1 1 2 1
        12.341477 1.88  3.5344  6.644672 0 0 0 2 1 4 1
        12.043553 1.88  3.5344  6.644672 0 0 1 1 0 3 2
        12.551434 1.62  2.6244  4.251528 0 0 0 2 0 4 1
         12.07254 1.05  1.1025  1.157625 0 0 0 2 0 3 1
        12.133502 1.13  1.2769  1.442897 0 0 1 1 1 4 1
        12.111762  .96   .9216   .884736 0 0 0 1 0 2 1
        12.305918 1.45  2.1025  3.048625 0 0 1 1 1 3 2
        12.314927 1.45  2.1025  3.048625 0 0 0 1 0 2 1
        12.341477 1.32  1.7424  2.299968 0 0 0 1 0 2 1
        12.429216  1.5    2.25     3.375 0 0 0 1 1 3 2
        12.206073  1.5    2.25     3.375 0 0 0 1 0 3 1
        12.100712 1.34  1.7956  2.406104 0 0 1 2 0 3 1
        12.429196 2.19  4.7961  10.50346 1 0 0 1 1 2 1
         12.76569 1.84  3.3856  6.229504 1 0 0 1 1 3 2
         12.21106 1.69  2.8561  4.826809 0 0 1 1 0 2 1
        12.205823 1.62  2.6244  4.251528 1 0 0 1 0 1 2
        12.301383 1.72  2.9584  5.088448 0 0 0 1 0 3 1
         11.73607 2.17  4.7089 10.218313 0 1 0 1 0 2 1
         11.95118 2.66  7.0756 18.821096 0 0 1 1 1 3 1
        11.652687 2.84  8.0656 22.906303 0 1 0 1 0 2 1
        12.230765 2.85  8.1225 23.149124 0 0 0 2 1 3 1
         11.88449 3.05  9.3025 28.372625 0 0 1 1 0 3 1
        11.849398 2.96  8.7616 25.934336 0 0 1 1 1 2 1
         12.02575 2.96  8.7616 25.934336 0 0 1 1 1 3 1
        12.206073 2.85  8.1225 23.149124 0 0 1 1 1 4 1
        11.585246 2.85  8.1225 23.149124 0 1 0 1 0 1 1
        11.608235 2.78  7.7284 21.484953 0 1 0 1 0 1 1
         11.67844 2.93  8.5849 25.153757 0 1 0 1 0 2 1
         11.77529 3.19 10.1761 32.461758 0 1 0 1 0 1 1
        12.043553  3.1    9.61    29.791 0 1 0 1 0 3 1
         11.83501  3.1    9.61    29.791 0 1 0 1 1 2 2
        12.043553 3.15  9.9225 31.255875 0 0 0 1 0 2 2
        11.502875 3.54 12.5316  44.36186 0 1 0 1 0 1 1
        11.861044 3.34 11.1556 37.259705 0 1 0 1 0 2 1
        11.891362 3.48 12.1104  42.14419 0 1 0 1 0 2 1
        11.695247 3.48 12.1104  42.14419 0 1 0 1 0 1 1
        11.594505 3.44 11.8336  40.70758 0 1 0 1 0 1 1
         12.89295 3.63 13.1769  47.83215 1 0 0 1 1 4 2
         12.97154 3.63 13.1769  47.83215 1 0 0 2 1 4 3
        12.506177 3.63 13.1769  47.83215 0 0 1 3 1 4 2
        12.860998 3.63 13.1769  47.83215 0 0 0 3 1 4 2
        11.561716 3.71 13.7641  51.06481 0 1 0 1 0 3 1
        12.411052 3.71 13.7641  51.06481 0 0 0 1 0 3 1
        11.849398 3.59 12.8881  46.26828 0 1 0 1 0 2 1
        12.001506 3.47 12.0409  41.78192 0 0 0 1 1 3 1
        12.660328 3.59 12.8881  46.26828 0 0 0 1 1 3 1
        11.445717 3.68 13.5424  49.83603 0 1 0 1 0 1 1
          11.3679 3.81 14.5161  55.30634 0 1 0 1 0 1 1
         11.91839 3.86 14.8996  57.51245 0 1 0 1 0 1 1
         11.80746 3.09  9.5481  29.50363 0 0 0 1 0 2 1
        12.043553 3.09  9.5481  29.50363 0 1 0 1 0 3 1
        11.561716  3.4   11.56    39.304 0 1 0 1 0 1 1
        12.117242 3.41 11.6281  39.65182 0 1 0 1 0 2 1
         12.69158 3.46 11.9716  41.42174 0 0 0 3 1 5 1
        12.730802 3.38 11.4244  38.61447 0 0 0 2 0 4 2
        12.254863 3.65 13.3225  48.62712 0 1 0 1 1 3 1
        13.458836 3.09  9.5481  29.50363 1 0 0 3 1 5 2
        13.458836  3.4   11.56    39.304 0 0 0 2 1 6 3
        13.217673 3.42 11.6964  40.00169 1 0 0 3 1 4 2
        12.429196 2.72  7.3984  20.12365 0 0 1 2 1 5 2
        12.388394 2.41  5.8081  13.99752 0 0 1 2 1 4 1
         11.97351 2.47  6.1009 15.069223 0 0 1 1 1 3 1
        11.461632 2.69  7.2361  19.46511 0 1 0 1 0 2 1
         12.25074 2.75  7.5625 20.796875 0 0 1 1 1 4 1
        12.468437 2.49  6.2001  15.43825 0 0 0 1 1 4 1
        12.611538 2.75  7.5625 20.796875 0 0 0 1 0 4 1
        11.635143 2.78  7.7284 21.484953 0 1 0 1 0 2 1
         12.15478 2.17  4.7089 10.218313 0 0 1 1 0 3 3
        11.852962 2.13  4.5369  9.663597 0 1 0 1 0 1 1
        11.456355 2.52  6.3504 16.003008 0 1 0 1 0 1 1
         12.08954 2.34  5.4756 12.812904 0 0 1 1 1 4 2
         11.66993 2.64  6.9696 18.399744 0 0 1 1 0 1 1
        11.711777 2.51  6.3001  15.81325 0 1 0 1 0 1 1
        11.487608 2.31  5.3361  12.32639 0 1 0 2 0 1 1
        11.537618 2.36  5.5696 13.144256 0 0 0 1 0 1 1
        11.790557 2.47  6.1009 15.069223 0 1 0 1 0 2 1
         11.67844 2.68  7.1824  19.24883 0 1 0 1 0 2 1
         12.30136 2.69  7.2361  19.46511 0 0 1 1 1 3 1
         11.73607 2.69  7.2361  19.46511 0 1 0 1 0 2 1
          11.9117 2.35  5.5225 12.977875 0 1 0 1 0 2 1
         12.05525 2.31  5.3361  12.32639 0 1 0 1 1 3 1
        end
        Code:
        regress lnsoldprice distancetoairport distancetoairport2 distancetoairport3 dum_propertytype_Detached dum_propertytype_Flat dum_propertytype_Terraced receptionrooms separatediningroom bedrooms bathrooms
        distancetoairport2 = distancetoairport^2
        Last edited by matt jarvis; 10 May 2019, 08:18.

        Comment


        • #5
          I have attempted the -margins- command as you suggested but cannot get STATA to understand that distance2 and distance3 are related to each other and to distance. I want to understand the effect of all three distance variables at once on the sold price.

          Kind regards and sorry for not posting in line with the FAQ previously.

          Comment


          • #6
            Matt:
            the drawback you're experiencing cannot be charged on -margins- but on the way you modelled the interaction in your regression model (see -fvvarlist-).
            That said, what if you type:

            Code:
            regress lnsoldprice c.distancetoairport##c.distancetoairport##c.distancetoairport dum_propertytype_Detached dum_propertytype_Flat dum_propertytype_Terraced receptionrooms separatediningroom bedrooms bathrooms
            ?

            -fvvarlist- notation allows Stata to know that you imposed an interaction on -distance- and calculated a squared and a cubic term. Conevrsely, if you create interactions by hand, Stata considers all the categorical variables you have created as different predictors.
            As an aside, please note that -margins- was basically developed to study factor variables (anyway, take a look at -margns- entry in Stata .pdf manual).
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #7
              Hi Carlo

              I didn't quite realise -margins- was developed for factor variable study hence why I was unable to find a solution.

              Your suggestion works perfectly and produces the desired result!

              Many thanks, Matt

              Comment

              Working...
              X