title: “Untitled” output: word_document: default pdf_document: default html_document: default #5.10.2

library(effects)
library(alr4)
## Loading required package: car
## 
## Attaching package: 'car'
## The following object is masked from 'package:effects':
## 
##     Prestige
data("MinnLand")
head(MinnLand)
##   acrePrice    region improvements year acres tillable      financing
## 1       766 Northwest            0 2002    82       94 title_transfer
## 2       733 Northwest            0 2003    30       63 title_transfer
## 3       850 Northwest            4 2002   150       47 title_transfer
## 4       975 Northwest            0 2003   160       86 title_transfer
## 5       886 Northwest           62 2002    90       NA title_transfer
## 6       992 Northwest           30 2003   120       83 title_transfer
##   crpPct productivity
## 1      0           NA
## 2      0           NA
## 3      0           NA
## 4      0           NA
## 5      0           NA
## 6      0           NA
MinnLand$fyear=factor(MinnLand$year)
summary(MinnLand$year)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    2002    2004    2006    2006    2008    2011
summary(MinnLand$region)
##     Northwest  West Central       Central    South West South Central 
##          3799          3297          4198          2583          2832 
##    South East 
##          1991
m4<-lm(log(acrePrice)~fyear*region, MinnLand)
summary(m4)
## 
## Call:
## lm(formula = log(acrePrice) ~ fyear * region, data = MinnLand)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2.73006 -0.27521  0.01157  0.25561  2.64607 
## 
## Coefficients:
##                               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                    6.19911    0.06022 102.939  < 2e-16 ***
## fyear2003                      0.12445    0.06476   1.922  0.05467 .  
## fyear2004                      0.34837    0.06367   5.471 4.52e-08 ***
## fyear2005                      0.54665    0.06425   8.508  < 2e-16 ***
## fyear2006                      0.62531    0.06432   9.722  < 2e-16 ***
## fyear2007                      0.69422    0.06419  10.815  < 2e-16 ***
## fyear2008                      0.86828    0.06417  13.532  < 2e-16 ***
## fyear2009                      0.94283    0.06679  14.115  < 2e-16 ***
## fyear2010                      0.95188    0.06505  14.634  < 2e-16 ***
## fyear2011                      0.96351    0.06723  14.333  < 2e-16 ***
## regionWest Central             0.89062    0.07915  11.253  < 2e-16 ***
## regionCentral                  1.20484    0.07230  16.664  < 2e-16 ***
## regionSouth West               1.09079    0.07613  14.328  < 2e-16 ***
## regionSouth Central            1.45223    0.07896  18.392  < 2e-16 ***
## regionSouth East               1.48043    0.08250  17.945  < 2e-16 ***
## fyear2003:regionWest Central  -0.06041    0.08631  -0.700  0.48400    
## fyear2004:regionWest Central  -0.14535    0.08493  -1.711  0.08703 .  
## fyear2005:regionWest Central  -0.10822    0.08573  -1.262  0.20685    
## fyear2006:regionWest Central  -0.10811    0.08568  -1.262  0.20706    
## fyear2007:regionWest Central  -0.06810    0.08572  -0.794  0.42693    
## fyear2008:regionWest Central  -0.09024    0.08551  -1.055  0.29126    
## fyear2009:regionWest Central  -0.15673    0.08981  -1.745  0.08099 .  
## fyear2010:regionWest Central  -0.04117    0.08698  -0.473  0.63601    
## fyear2011:regionWest Central  -0.13921    0.09123  -1.526  0.12706    
## fyear2003:regionCentral        0.03938    0.07877   0.500  0.61715    
## fyear2004:regionCentral       -0.06105    0.07766  -0.786  0.43179    
## fyear2005:regionCentral       -0.01894    0.07830  -0.242  0.80887    
## fyear2006:regionCentral       -0.04535    0.07878  -0.576  0.56486    
## fyear2007:regionCentral       -0.11180    0.07888  -1.417  0.15636    
## fyear2008:regionCentral       -0.13345    0.07872  -1.695  0.09004 .  
## fyear2009:regionCentral       -0.16203    0.08284  -1.956  0.05049 .  
## fyear2010:regionCentral       -0.15092    0.08074  -1.869  0.06160 .  
## fyear2011:regionCentral       -0.12382    0.08462  -1.463  0.14342    
## fyear2003:regionSouth West    -0.02205    0.08522  -0.259  0.79580    
## fyear2004:regionSouth West    -0.06516    0.08377  -0.778  0.43671    
## fyear2005:regionSouth West    -0.11040    0.08394  -1.315  0.18842    
## fyear2006:regionSouth West    -0.11492    0.08399  -1.368  0.17127    
## fyear2007:regionSouth West    -0.02079    0.08352  -0.249  0.80339    
## fyear2008:regionSouth West     0.05438    0.08296   0.656  0.51215    
## fyear2009:regionSouth West    -0.01820    0.08741  -0.208  0.83508    
## fyear2010:regionSouth West     0.13339    0.08534   1.563  0.11805    
## fyear2011:regionSouth West     0.15965    0.09689   1.648  0.09942 .  
## fyear2003:regionSouth Central -0.06014    0.08766  -0.686  0.49271    
## fyear2004:regionSouth Central -0.11564    0.08592  -1.346  0.17838    
## fyear2005:regionSouth Central -0.13846    0.08626  -1.605  0.10848    
## fyear2006:regionSouth Central -0.26222    0.08656  -3.029  0.00246 ** 
## fyear2007:regionSouth Central -0.24577    0.08595  -2.859  0.00425 ** 
## fyear2008:regionSouth Central -0.15184    0.08513  -1.784  0.07451 .  
## fyear2009:regionSouth Central -0.24561    0.08923  -2.753  0.00592 ** 
## fyear2010:regionSouth Central -0.15730    0.08721  -1.804  0.07129 .  
## fyear2011:regionSouth Central -0.10230    0.09262  -1.105  0.26938    
## fyear2003:regionSouth East    -0.06330    0.09128  -0.693  0.48806    
## fyear2004:regionSouth East     0.01118    0.08993   0.124  0.90108    
## fyear2005:regionSouth East    -0.15057    0.09083  -1.658  0.09741 .  
## fyear2006:regionSouth East    -0.16132    0.09183  -1.757  0.07897 .  
## fyear2007:regionSouth East    -0.15648    0.09113  -1.717  0.08598 .  
## fyear2008:regionSouth East    -0.21373    0.09131  -2.341  0.01926 *  
## fyear2009:regionSouth East    -0.28636    0.09530  -3.005  0.00266 ** 
## fyear2010:regionSouth East    -0.25598    0.09252  -2.767  0.00567 ** 
## fyear2011:regionSouth East    -0.22985    0.09718  -2.365  0.01803 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.4818 on 18640 degrees of freedom
## Multiple R-squared:  0.5609, Adjusted R-squared:  0.5596 
## F-statistic: 403.6 on 59 and 18640 DF,  p-value: < 2.2e-16
plot(allEffects(m4,transformation=list(link=log,inverse=exp)),grid=TRUE, 
     multiline=TRUE,ylab="Acre Price", rug=FALSE)