Class 221Interaction termsDifferent slopes for different folksClass 222Are there different slopes?Let’s say that you believed that more space (sqft) increases rent differently in the two Areas. Perhaps, space is more valuable in Area B (Brookline) where there are more families and richer people.Alternatively, perhaps space is more valuable in Area A (Allston) because more space means you can put in more separate students (who each pay rent).Class 223Interaction termsIf you believed that more space (sqft) increases rent differently in the two Areas, What equation could you use to model this using multiple regression?Make a new variable by multiplying the two variables together!!! Area A * sqft. (This is called an “interaction term”)Add this new variable to the regression: Rent= b0+ b1Area A + b2sqft + b3(sqft*Area A) + …..This allows a different impact of sqft in Area A and in Area B. To see this, take the derivative of rent with respect to sqft:dRent/dsqft = b2+ b3(Area A)dRent/dsqft = b2+ b3(1) in Area A = b2+ b3dRent/dsqft = b2+ b3(0) in Area B = b2Class 224Best equation from case (Eqn #8) PLUS an interaction termRegression StatisticsMultiple R0.919489074R Square0.845460156Adjusted R Square0.83190403Standard Error143.5804349Observations63ANOVAdfSSMSFSignificance FRegression56428624.532128572562.367387.39E-22Residual571175074.45320615.34Total627603698.984CoefficientsStandard Errort StatP-valueLower 95%Upper 95%Intercept-266.928366.819-0.7280.470-1001.471467.616BEDROOMS75.25733.2022.2670.0278.770141.743AREA A764.052353.2132.1630.03556.7551471.349SQFT0.9780.2014.8610.0000.5751.381DISTANCE TO T-541.398198.848-2.7230.009-939.584-143.213SQFT*AREA A-0.7250.197-3.6910.001-1.119-0.332In which Area does rent increase more with size (sqft)?Class 225The equation was:Rent = -266 + 764 AreaA +.978 Sqft -.725 Sqft*AreaA+……In which which Area does rent increase more with size (sqft)?In Area BHow much does one more sqft add to rent in A?.978 -.725(1) = .254 There are ways to get the standard error on this… can’t do with Excel.How much does one more sqft add to rent in B?.978 -.725(0) = .978 Of course, this is controlling for the number of bedrooms.Class 226The coefficient on the interaction terms sqft*Area A also tells us that the rent discount from being in Area A is Iowerfor larger apartments:dRent/dAreaA = 764 -.725 SqftWhat’s the rent difference for being in Area A for a small apartment (1000 sqft)?764 -725 = 39There is no sig. difce...(a test would show the |t|<1 on 49) What’s the rent discount for being in Area A for a large apartment (2000 sqft)?764 –1450 = -686Of course, this is controlling for the number of bedrooms.The equation was:Rent=-266+764 AreaA +.978Sqft -.725 Sqft*AreaA… Class 227You can make interactions terms with any two variablesFor instance, let’s say that you believed that the farther from the T, the less the effect of space (sqft).Make a new variable: distance from T * sqftClass 228The farther from the T, the less the rent increase from a bigger apartment.Or, the bigger the apartment, the less the penalty from being farther from the TRegression StatisticsMultiple R0.9255631R Square0.856667Adjusted R Square0.8413099Standard Error139.50557Observations63ANOVAdfSSMSFSignificance FRegression66513837.904108564055.783097.706E-22Residual561089861.08119461.81Total627603698.984CoefficientsStandard Errort StatP-valueLower 95%Upper 95%Intercept-625.5281395.4705-1.58170.1193-1417.7507166.6945BEDROOMS72.440432.28812.24360.02887.7596137.1212AREA A836.3692344.92442.42480.0186145.40251527.3358SQFT1.27750.24235.27230.00000.79211.7629DISTANCE TO T402.2902490.63160.81990.4157-580.56311385.1435DISTANCE T*SQFT-0.77470.3702-2.09250.0409-1.5164-0.0330SQFT*AREA A-0.79950.1942-4.11670.0001-1.1886-0.4105Distance to T now has |t| <1 so we drop it…..Class 229Best equation with 2 interaction termsRegression StatisticsMultiple R0.924633R Square0.854946Adjusted R Square0.842222Standard Error139.104Observations63ANOVAdfSSMSFSignificance FRegression56500754130015167.191531.235E-22Residual57110294519349.92Total627603699CoefficientsStandard Errort StatP-valueLower 95%Upper 95%Intercept-457.1428336.9965-1.35650.1803-1131.9666217.6811BEDROOMS71.926932.18912.23450.02947.4693136.3844AREA A795.3098340.28772.33720.0230113.89551476.7242SQFT1.16380.19815.87440.00000.76711.5605DISTANCE T*SQFT-0.49570.1454-3.40960.0012-0.7868-0.2046SQFT*AREA A-0.77140.1906-4.04700.0002-1.1532-0.3897How much would a 1000 sqft apartment, 2 bed, .2 from T apartment in Area A rent for? Calculate:-457 + 71.9*2 + 795 +1.16(1000) -.496(.2)(1000) -.7714(1000)Class 2210Best equation with 2 interaction terms Regression Statistics Multiple R 0.924633 R Square 0.854946 Adjusted R Square 0.842222 Standard Error 139.104 Observations 63 ANOVA df SS MS F Significance F Regression 5 6500754 1300151 67.19153 1.235E-22 Residual 57 1102945 19349.92 Total 62 7603699 Coefficients Standard Error t Stat P-value Lower 95% Upper 95% Intercept -457.1428 336.9965 -1.3565 0.1803 -1131.9666 217.6811 BEDROOMS 71.9269 32.1891 2.2345 0.0294 7.4693 136.3844 AREA A 795.3098 340.2877 2.3372 0.0230 113.8955 1476.7242 SQFT 1.1638 0.1981 5.8744 0.0000 0.7671 1.5605 DISTANCE T*SQFT -0.4957 0.1454 -3.4096 0.0012 -0.7868 -0.2046 SQFT*AREA A -0.7714 0.1906 -4.0470 0.0002 -1.1532 -0.3897What would be the difference in rent between apartments, one .2 mile from the T and one 1 mile from the T if both apartments have 1000 sqft, 2 bedrooms and are in the same area? Calculate:-.4957*1000*.8 (where .8=1 -.2)Class 2211Consider the following regression of weekly salary (made with a different program)Class 2212Consider the following regression of ln(weekly salary) made with a different statistical program than Excel Source | SS df MS Number of obs = 417671 -------------+------------------------------F( 17,417653) =16411.33 Model | 58346.2502 17 3432.13236 Prob > F = 0.0000 Residual | 87344.5361417653 .20913183 R-squared = 0.4005 -------------+------------------------------Adj R-squared = 0.4005 Total | 145690.786417670 .348817934 Root MSE = .45731 ------------------------------------------------------------------------------lernwknew | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+----------------------------------------------------------------female | -.1948711 .0023311 -83.60 0.000 -.1994399 -.1903022 married | .1653266 .0022124 74.73 0.000 .1609904 .1696629 child | .1143864 .0023224 49.25 0.000 .1098346 .1189382 femmar | -.1169898 .0030461 -38.41 0.000 -.12296 -.1110195 femchild | -.0535653 .0033522 -15.98 0.000 -.0601355 -.046995 college | .806833 .0026525 304.18 0.000 .8016342 .8120319 somecol | .4140823 .0026627 155.51 0.000 .4088635 .4193012 highscl | .2431951 .0026121 93.10 0.000 .2380755 .2483147 immlt10 | -.092209 .0042314 -21.79 0.000 -.1005024 -.0839156 citizen | .1957262 .0035897 54.52 0.000 .1886905 .202762 metro | .1722747 .0018965 90.84 0.000 .1685577 .1759918 age | .0087756 .0000654 134.17 0.000 .0086474 .0089038 urstate | 1.424405 .0761908 18.70 0.000 1.275073 1.573737 region1 | .0190731 .0023639 8.07 0.000 .01444 .0237062 region2 | -.126374 .0024517 -51.55 0.000 -.1311792 -.1215688 region3 | -.0173895 .0024254 -7.17 0.000 -.0221431 -.0126359 region4 | -.1166501 .0024923 -46.80 0.000 -.121535 -.1117652 intercept | 5.260758 .0064456 816.18 0.000 5.248125 5.273391 Class 2213The regression on the previous page starts with:ln (weekly salary) = -.195 female +.165 married + .114 child -.117 female*married -.0535653 female*child Where female, married and child are all dummies, and the last two terms are interaction terms.What’s the difference in weekly salaries between:a single man and a married man?a single woman and a married woman?a married man and a married woman? a married man with children and a married woman with children? To answer these, only pick up coefficients whose values are different between the two groups compared.Class 2214Answersln (weekly salary) = -.195 female +.165 married + .114 child -.117 female*married -.0536 female*child Where female, married and child are all dummies, and the last two terms are interaction terms.To answer the questions, only pick up coefficients whose values are different between the two groups compared.What’s the difference in weekly salaries between:a single man and a married man?The married man earns .165 morea single woman and a married woman?The married woman earns .165 -.117 more a married man and a married woman? The married woman earns -.195 -.117 lessa married man with children & a married woman with children? The married woman earns -.195 -.117 -.0536 less