Dear statalist,
I am having difficulties to interpret the graph of predictions from a multilevel model and hope someone can help me clarify if I graphed what I want to graph and if so, how to interpret the output.
First my data:
My model looks like this:
The estimation results:
After the estimation, I want to graph the predictions for "Haushaltseinkommen" (net income) for my county variable (GKZ) in order to see how their total investments (invtot) are estimated to develop with rising "Haushaltseinkommen" (household income), sorted by the countries (bula) in which the counties are nested. I write:
The following graph is being drawn:

Even though its a bit chaotic due to the relatively big number of counties (GKZ), I think it gets clear that most counties have sinking total investments when net incomes (Haushaltseinkommen) rise, until a certain tipping point after which total investments rise again. (the "typical" regression line looks like a reflected nike-swoosh i guess) What's strange to me is the difference between this interpretation and how I would interpret the positive coefficient of "Haushaltseinkommen", which estimates a positive correlation and therefore I would expect total investments to rise when net income (Haushaltseinkommen) does. (Even though the interaction variable with gross income ("Bruttoeinkommen") is negative, its coefficient is so close to zero, it cannot make up for the positive coefficient of Haushaltseinkommen, right?)
Any hints of whether my graph is being drawn right and about my conclusion would be highly appreciated, especially regarding the positive coefficient of net income (Haushaltseinkommen) in the estimation results and the seemingly negative relationship between rising net income (Haushaltseinkommen) and total investments in the graph.
Thanks a lot!
I am having difficulties to interpret the graph of predictions from a multilevel model and hope someone can help me clarify if I graphed what I want to graph and if so, how to interpret the output.
First my data:
Code:
input int GKZ float invtot double(Haushaltseinkommen Bruttoverdienst Arbeitslosenquote Beschäftigtenquote Durchschnittsalter BIPproEW Steuereinnahmen) int Einwohnerdichte float syear long bula float ost 1001 3234.374 1197.5 1971.4 11.8 46.1 41 31.1 511.6 1485 2000 1 0 1001 1259.7567 1551.5 2234.6 11.1 47.9 42.6 39.3 643.3 1480 2013 1 0 1001 998.1883 1395.9 2082.7 11.5 41 41.3 36.6 572 1564 2008 1 0 1002 2977.828 1200.2 2127 11.3 46.1 41 33.7 526.5 1961 2000 1 0 1002 1542.9478 1502.5 2472.9 10.2 47.5 41.4 41.8 664.4 2036 2013 1 0 1002 1277.388 1394.7 2253.5 11.4 44 41.4 38.1 661.6 2002 2008 1 0 1003 1353.792 1544.8 2311.2 10.4 50.6 44.5 34.7 594.3 994 2013 1 0 1003 2839.329 1221.2 1951.5 12.6 46.4 42.6 26.5 436.6 996 2000 1 0 1003 1270.9838 1465.9 2077.4 12.2 45.8 43.7 30.2 546.6 985 2008 1 0 1004 1367.63 1389.2 2074.4 11 48.3 42.7 31.8 555.6 1076 2008 1 0 1004 1430.57 1481.3 2321.9 11.1 51.9 44.1 35.8 611.2 1076 2013 1 0 1004 2686.803 1260.2 2033.7 12.2 49.5 41.1 27.5 481.3 1115 2000 1 0 1051 896.8656 1673.5 2149.8 7.6 51 45 27.1 585.3 93 2013 1 0 1051 825.4948 1482.6 1993.9 9.7 45.8 43.5 25 527.3 95 2008 1 0 1051 1477.6533 1180.5 1948.5 9 45.9 41 22.4 418.9 96 2000 1 0 1053 884.5883 1665.9 1982.4 6.5 51.7 42.8 18.8 566.7 148 2008 1 0 1053 998.2321 1860.1 2209.5 6.2 55.6 44.3 21 650.8 150 2013 1 0 1053 1475.1763 1416.3 1831 7.5 49.5 40.7 18 464.1 142 2000 1 0 1054 1842.165 1233.3 1789.7 7.4 46.4 40.5 23.4 428.2 79 2000 1 0 1054 1226.3568 1623.4 1916.8 7.9 47.1 42.9 28.1 753.8 80 2008 1 0 1054 1201.9829 1864 2228.9 6.6 53.5 44.8 30.7 702.8 78 2013 1 0 1055 777.8737 1531.1 1825.9 8 47.3 45.4 19.2 504.8 147 2008 1 0 1055 1455.7244 1279.5 1664.4 9 45.9 42.7 18.4 426.9 145 2000 1 0 1055 913.3501 1767.2 2021.5 6.5 54.3 46.9 22.2 592.5 142 2013 1 0 1056 994.0176 1945.9 2450.6 5.4 58.8 44.1 26.3 810 454 2013 1 0 1056 762.2642 1720 2224.5 6 53.2 43 24.8 721.2 454 2008 1 0 1056 1487.2058 1512.7 1940.2 7.7 51 41.1 21.4 579.9 439 2000 1 0 1057 645.7213 1473.3 1772.2 7 45.2 43.9 16 532.8 125 2008 1 0 1057 805.1359 1758.3 1978.3 5.6 53.4 46 19.1 583.5 117 2013 1 0 1057 1369.3368 1252.7 1556.8 7.3 43.9 41 13.7 379.6 123 2000 1 0 1058 904.8422 1803.5 2184.8 5.7 52.7 44.5 26.5 610.8 123 2013 1 0 1058 1572.6926 1309.5 1793.4 7.7 46.3 40.3 21.7 459.3 123 2000 1 0 1058 758.3409 1581.9 1902.2 5.6 48.3 42.7 24.6 553.1 124 2008 1 0 1059 673.3964 1521 1815.6 8.5 45.1 42.7 20.5 469.6 96 2008 1 0 1059 830.4106 1700.7 2026.7 7.7 49.9 44.5 23 550.3 94 2013 1 0 1059 1576.084 1213.8 1810.3 7.3 44.8 40 18.6 378.3 96 2000 1 0 1060 995.2684 1802.1 2364.9 5.1 58.3 43.9 27.8 754 196 2013 1 0 1060 832.6856 1633.6 2198.3 5.1 55.2 42.2 26.7 695.1 192 2008 1 0 1060 1703.5753 1427.2 1981.2 6.7 53.8 39.9 23.7 573.3 186 2000 1 0 1061 745.6447 1497.7 2014 5.8 49.3 42.7 29.2 624.4 127 2008 1 0 1061 830.7108 1699.2 2236.8 6.1 54.3 44.5 30.5 694.9 123 2013 1 0 1061 1411.294 1237.5 1881.3 8.5 48.4 40.4 23.5 589.2 129 2000 1 0 1062 2163.621 1614.3 2247.8 5.8 51.5 41.4 24 716.7 284 2000 1 0 1062 831.7444 1858.5 2269.8 4.1 54 43.4 28.8 868.1 297 2008 1 0 1062 954.9894 2017.5 2456.4 4.2 57.8 44.5 29.2 898.2 306 2013 1 0 2000 . 1488.9 2503.5 8.9 47.5 41.3 45.5 890.2 2271 2000 . . 2000 . 1934.2 3106.6 7.4 55 42 58.6 1190.2 2312 2013 . . 2000 . 1757.4 2808 8.1 48.2 41.8 53.7 1135.2 2346 2008 . . 3101 1246.5654 1513.8 2363 9.2 48.6 43.1 37 736.5 1280 2008 3 0 3101 1246.5654 1625.4 2658.4 7.1 55.5 43.2 41.6 815.8 1287 2013 3 0 3101 2722.0654 1330.3 2166.4 11.2 48.8 42.4 32 599.3 1279 2000 3 0 3102 1426.0334 1385.6 2556.2 9.6 49.8 44 40 982.5 466 2008 3 0 3102 1426.0334 1581.8 3050.9 9.3 56.3 45.1 46.9 668.2 439 2013 3 0 3102 2611.9346 1229 2329.8 13 50.1 41.7 32.4 494.3 502 2000 3 0 3103 1795.996 1570.9 3272 7 56.4 44.1 92.2 1026.9 591 2008 3 0 3103 3074.45 1367.4 3071.2 10.3 52.2 42.4 80.6 978.3 597 2000 3 0 3103 1795.996 1731.4 4052.7 4.9 61.2 44.1 129.7 1532.8 600 2013 3 0 3151 546.4481 1479.3 1857.9 6.7 53.3 41.1 15.6 490.2 111 2008 3 0 3151 1273.2922 1260.8 1783.7 9.9 51.2 38.4 13.7 383.6 110 2000 3 0 3151 546.4481 1691.3 2064.9 5.2 58.3 42.8 17.6 613.7 110 2013 3 0 3153 821.5713 1441.4 2018.8 9.7 47 46 22.6 500.9 151 2008 3 0 3153 821.5713 1614.5 2232.3 8.8 51.4 47.2 25.1 549.6 143 2013 3 0 3153 1849.3165 1249.8 1831.5 12.1 47 43.8 19.3 410.5 162 2000 3 0 3154 650.0555 1722.4 2122.2 7.5 57.3 45.7 19.6 497 134 2013 3 0 3154 650.0555 1500.1 1857.9 9.1 50.7 44.2 17.5 558.6 141 2008 3 0 3154 1788.833 1313 1834.9 11.9 49.5 41.8 15.3 365.4 148 2000 3 0 3155 1825.09 1250.2 1809.6 10.6 49.8 42.1 18.6 411.8 119 2000 3 0 3155 697.0458 1463 2011.6 8.2 50.8 44.5 21.8 511.9 112 2008 3 0 3155 697.0458 1662.6 2235.4 7.3 56 46.1 25.1 600.2 106 2013 3 0 3157 688.3698 1457.4 1976.7 8 52.6 42.6 20.9 539.5 248 2008 3 0 3157 1138.0107 1277.5 1866.6 9.2 51.2 40.5 15.9 419.3 247 2000 3 0 3157 688.3698 1632.3 2152.1 6 57 44 20.2 596.6 243 2013 3 0 3158 749.7506 1653.8 2094.8 6.2 54.6 45.2 18.2 625.4 166 2013 3 0 3158 749.7506 1459.8 1816.9 6.8 50.1 43.7 16.2 544.4 171 2008 3 0 3158 1511.368 1267.5 1725.6 10.1 48.3 41.1 12.5 417.7 175 2000 3 0 3241 1042.238 1653.3 2684.1 8.2 54.6 43.5 39.8 842.1 489 2013 3 0 3241 2430.6614 1332.3 2230.1 9.7 50.2 41.5 30.4 588.8 488 2000 3 0 3241 1042.238 1509.2 2400.7 9.1 49.7 42.9 36.9 747.5 493 2008 3 0 3251 716.5629 1552.7 1867.9 5.3 52.4 42.8 24.2 668.1 108 2008 3 0 3251 1544.6233 1323.4 1777.7 6.3 49.8 40.5 20.2 487.2 106 2000 3 0 3251 716.5629 1757.4 2083.1 4.6 58 44.3 26.4 763.8 106 2013 3 0 3252 1769.7384 1289.2 2024 11.3 50.3 42.7 23.5 575.1 204 2000 3 0 3252 797.049 1472.6 2179.5 9.4 50.3 44.6 28.2 605.6 196 2008 3 0 3252 797.049 1680.4 2372.7 8.2 55.5 46.1 31.2 631.1 186 2013 3 0 3254 2009.4618 1277.2 1959.3 8.8 49.9 41.5 19.2 445.9 243 2000 3 0 3254 832.4831 1445.7 2106.8 8.1 49.9 43.5 22.3 542.1 238 2008 3 0 3254 832.4831 1628 2270.6 7.6 54.2 44.8 24.5 617.3 228 2013 3 0 3255 1448.76 1277.1 2038.7 9.7 49.6 42.4 20.1 453.3 118 2000 3 0 3255 600.8178 1465.7 2081.5 8.9 49.7 44.9 23.1 563.6 108 2008 3 0 3255 600.8178 1647.9 2363.8 8.3 52.7 46.2 27.6 591.8 104 2013 3 0 3256 665.7817 1414.8 1919.8 7.3 50.4 42.5 22.5 555 89 2008 3 0 3256 1429.0028 1219.8 1809.4 7.3 49.9 40.3 21.1 445.5 90 2000 3 0 3256 665.7817 1621.3 2171.8 6.2 56.1 44.3 26.9 615.1 86 2013 3 0 3257 670.6334 1680.4 2131.5 6.9 54 45.7 21.8 571.4 230 2013 3 0 3257 1458.3638 1303.5 1724.6 8.4 49 41.6 17.6 397.4 246 2000 3 0 3257 670.6334 1468.7 1870.3 8.5 48.9 43.9 18.8 510.8 241 2008 3 0 3351 789.2302 1415.8 2065.2 8.4 47.9 42.9 23.2 585.2 117 2008 3 0 3351 1894.2137 1221.4 1904.9 10.3 47.4 40.7 22.2 424.4 118 2000 3 0 3351 789.2302 1589 2343.5 7.5 53.6 44.4 26.4 631 114 2013 3 0 3352 2026.8308 1211.9 1675.7 8.9 46.1 41.5 14.5 362.1 100 2000 3 0 end label values bula bula label def bula 1 "Schleswig-Holstein", modify label def bula 3 "Niedersachsen", modify label values ost ostdummy label def ostdummy 0 "West", modify
Code:
mixed invtot c.Haushaltseinkommen##c.Bruttoverdienst Arbeitslosenquote Beschäftigtenquote Durchschnittsalter BIPproEW Steuereinnahmen Einwohnerdichte i.syear i.bula i.ost || bula: || GKZ: , vce(robust)
Code:
mixed invtot c.Haushaltseinkommen##c.Bruttoverdienst Arbeitslosenquote Beschäftigtenquote Durchschnittsalter BIPproEW Steuereinnahmen E > inwohnerdichte i.syear i.bula i.ost || bula: || GKZ: ,vce(robust) note: 1.ost omitted because of collinearity Performing EM optimization: Performing gradient-based optimization: Iteration 0: log pseudolikelihood = -8294.5195 Iteration 1: log pseudolikelihood = -8293.8168 Iteration 2: log pseudolikelihood = -8293.7575 Iteration 3: log pseudolikelihood = -8293.7575 Computing standard errors: Mixed-effects regression Number of obs = 1,188 ------------------------------------------------------------- | No. of Observations per Group Group Variable | Groups Minimum Average Maximum ----------------+-------------------------------------------- bula | 13 18 91.4 288 GKZ | 396 3 3.0 3 ------------------------------------------------------------- Wald chi2(11) = . Log pseudolikelihood = -8293.7575 Prob > chi2 = . (Std. Err. adjusted for 13 clusters in bula) -------------------------------------------------------------------------------------------------------- | Robust invtot | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------------------------------------+---------------------------------------------------------------- Haushaltseinkommen | 1.123442 .2449337 4.59 0.000 .6433811 1.603504 Bruttoverdienst | .5623255 .2127294 2.64 0.008 .1453835 .9792674 | c.Haushaltseinkommen#c.Bruttoverdienst | -.0004859 .0001257 -3.87 0.000 -.0007323 -.0002396 | Arbeitslosenquote | 12.84657 11.43487 1.12 0.261 -9.565359 35.25849 Beschäftigtenquote | 4.100383 3.89359 1.05 0.292 -3.530914 11.73168 Durchschnittsalter | 62.98251 14.93219 4.22 0.000 33.71595 92.24907 BIPproEW | 13.77028 2.09845 6.56 0.000 9.657398 17.88317 Steuereinnahmen | .2288332 .1309357 1.75 0.081 -.0277961 .4854625 Einwohnerdichte | .2944202 .0376504 7.82 0.000 .2206267 .3682137 | syear | 2008 | -1164.044 60.78472 -19.15 0.000 -1283.18 -1044.908 2013 | -1145.501 81.01611 -14.14 0.000 -1304.29 -986.7127 | bula | Niedersachsen | -79.03328 8.786698 -8.99 0.000 -96.25489 -61.81167 Nordrhein-Westfalen | 43.46324 24.49071 1.77 0.076 -4.537661 91.46414 Hessen | 22.54467 21.78153 1.04 0.301 -20.14636 65.23569 Rheinland-Pfalz | 101.1575 13.3085 7.60 0.000 75.07331 127.2417 Baden-Württemberg | 284.6323 27.51888 10.34 0.000 230.6963 338.5683 Bayern | 126.8192 27.82473 4.56 0.000 72.28378 181.3547 Saarland | -143.5269 23.06242 -6.22 0.000 -188.7284 -98.32534 Brandenburg | 176.8709 57.73812 3.06 0.002 63.70623 290.0355 Mecklenburg-Vorpommern | -185.2627 68.896 -2.69 0.007 -320.2963 -50.22899 Sachsen | -174.6944 56.32618 -3.10 0.002 -285.0917 -64.29712 Sachsen-Anhalt | -270.9581 68.83433 -3.94 0.000 -405.8709 -136.0453 Thüringen | -132.6153 50.96755 -2.60 0.009 -232.5099 -32.72078 | ost | Ost | 0 (omitted) _cons | -2892.482 531.5937 -5.44 0.000 -3934.387 -1850.578 -------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------ | Robust Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ bula: Identity | var(_cons) | 2.73e-09 . . . -----------------------------+------------------------------------------------ GKZ: Identity | var(_cons) | 12596.52 6887.585 4313.465 36785.33 -----------------------------+------------------------------------------------ var(Residual) | 57285.62 10154.66 40472.35 81083.56 ------------------------------------------------------------------------------
Code:
predict invtotfit, fitted sort GKZ Haushaltseinkommen twoway (line invtotfit Haushaltseinkommen, connect(ascending) lwidth(vthin) by(bula)), xlabel(,labsize(small) format(%9.0f)) ylabel(,labsize(small)) xtitle("Haushaltseinkommen") ytitle("Empirical Bayes Regressionsgeraden")
Even though its a bit chaotic due to the relatively big number of counties (GKZ), I think it gets clear that most counties have sinking total investments when net incomes (Haushaltseinkommen) rise, until a certain tipping point after which total investments rise again. (the "typical" regression line looks like a reflected nike-swoosh i guess) What's strange to me is the difference between this interpretation and how I would interpret the positive coefficient of "Haushaltseinkommen", which estimates a positive correlation and therefore I would expect total investments to rise when net income (Haushaltseinkommen) does. (Even though the interaction variable with gross income ("Bruttoeinkommen") is negative, its coefficient is so close to zero, it cannot make up for the positive coefficient of Haushaltseinkommen, right?)
Any hints of whether my graph is being drawn right and about my conclusion would be highly appreciated, especially regarding the positive coefficient of net income (Haushaltseinkommen) in the estimation results and the seemingly negative relationship between rising net income (Haushaltseinkommen) and total investments in the graph.
Thanks a lot!