Final Project - Panel Data Results

Initializing packages

require(mosaic)
## Loading required package: mosaic
## Loading required package: grid
## Loading required package: lattice
## Loading required package: car
## 
## Attaching package: 'mosaic'
## 
## The following object is masked from 'package:car':
## 
##     logit
## 
## The following objects are masked from 'package:stats':
## 
##     binom.test, cor, cov, D, fivenum, IQR, median, prop.test, sd,
##     t.test, var
## 
## The following objects are masked from 'package:base':
## 
##     max, mean, min, print, prod, range, sample, sum
require(repmis)
## Loading required package: repmis
require(plm)
## Loading required package: plm
## Loading required package: Formula
## 
## Attaching package: 'plm'
## 
## The following object is masked from 'package:mosaic':
## 
##     r.squared
options(digits = 3)
trellis.par.set(theme = col.mosaic())

Loading data

All <- repmis::source_DropboxData("CombinedStatesTEMP2.csv", "t7zov3jawubw9nq", 
    sep = ",", header = TRUE)
## Downloading data from: https://dl.dropboxusercontent.com/s/t7zov3jawubw9nq/CombinedStatesTEMP2.csv 
## 
## SHA-1 hash of the downloaded data file is:
## 3fc38a056c176aac4620cb396ca89a892c06535c
All$t = as.numeric(All$t)
All$t2 = (All$t)^2

Function for testing for serial correlation in residuals

SCtest = function(model, periods) {
    res = model$res
    n = length(res)
    summary(lm(res[-n] ~ res[-1]))
}

Function for getting fitted values from plm

fitted <- function(object, ...) object$model[[1]] - object$residuals

Summary Stats and Charts

# TotalSTD SDs not 1 (means not 0) for some because standardized by county
# with complete data set TMEAN and PRECIP centered by county*month, not
# standardized with SD (used full data set)
favstats(All$TotalSTD ~ All$County.Area)
##                  .group    min      Q1  median    Q3  max      mean    sd
## 1            Bar Harbor -0.981 -0.8296 -0.4821 0.812 2.07 -1.17e-02 0.979
## 2                Camden -2.744 -0.6976 -0.0207 0.485 3.80  4.17e-11 1.000
## 3              Carteret -1.677 -0.7362 -0.2120 0.654 2.62 -2.08e-11 1.000
## 4                Durham -1.607 -0.7178 -0.0614 0.526 2.77  2.34e-18 1.000
## 5  Duval (Jacksonville) -1.433 -0.3330  0.2604 0.933 3.20  3.74e-01 0.927
## 6    Leon (Tallahassee) -1.060 -0.2942  0.2886 0.860 3.29  3.89e-01 0.912
## 7              Lewiston -2.134 -0.5514 -0.0373 0.642 2.52  1.99e-02 1.019
## 8           LewistonSub -1.784 -0.8161 -0.1301 0.727 2.37 -1.16e-02 0.979
## 9            Miami-Dade -1.143 -0.1295  0.4393 0.930 2.77  4.86e-01 0.783
## 10     Orange (Orlando) -1.036 -0.0171  0.4191 0.945 2.50  4.98e-01 0.718
## 11     Pinellas (Tampa) -1.547 -0.6282  0.3220 0.741 3.31  2.38e-01 1.099
## 12             Portland -2.047 -0.7480 -0.0718 0.668 2.93 -7.60e-03 1.022
## 13          PortlandSub -1.823 -0.8575  0.0491 0.688 1.87 -2.62e-02 0.966
## 14            St. Lucie -1.046 -0.2563  0.3166 1.044 2.69  4.67e-01 0.855
## 15               Stanly -1.382 -0.6362 -0.2262 0.218 3.33 -3.79e-18 1.000
##     n missing
## 1  96       0
## 2  96       0
## 3  96       0
## 4  96       0
## 5  96       0
## 6  96       0
## 7  96       0
## 8  96       0
## 9  96       0
## 10 96       0
## 11 96       0
## 12 96       0
## 13 96       0
## 14 96       0
## 15 96       0
favstats(All$PRECIPcm ~ All$County.Area)
##                  .group   min    Q1 median    Q3   max      mean   sd  n
## 1            Bar Harbor -4.59 -1.69 -0.212 1.206  8.07  1.42e-01 2.51 96
## 2                Camden -4.37 -1.55 -0.439 1.280 10.26  1.13e-17 2.58 96
## 3              Carteret -4.18 -1.62 -0.338 1.268  7.86  1.66e-17 2.47 96
## 4                Durham -3.23 -1.23 -0.182 1.176  5.58 -1.14e-17 1.84 96
## 5  Duval (Jacksonville) -4.07 -1.23 -0.587 1.472  5.40  2.76e-02 2.15 96
## 6    Leon (Tallahassee) -6.89 -1.93 -0.310 1.150  7.61 -8.42e-02 2.65 96
## 7              Lewiston -4.04 -1.37 -0.283 0.922  7.32  9.14e-02 2.11 96
## 8           LewistonSub -4.04 -1.37 -0.283 0.922  7.32  9.14e-02 2.11 96
## 9            Miami-Dade -8.17 -1.66 -0.295 1.273  9.90 -7.41e-02 2.79 96
## 10     Orange (Orlando) -6.67 -1.47 -0.409 1.790 11.94  1.30e-02 3.00 96
## 11     Pinellas (Tampa) -8.65 -1.63 -0.491 1.117 13.00  6.78e-02 3.27 96
## 12             Portland -4.14 -1.45 -0.348 0.777  8.06  3.81e-02 2.36 96
## 13          PortlandSub -4.14 -1.45 -0.348 0.777  8.06  3.81e-02 2.36 96
## 14            St. Lucie -4.27 -1.78 -0.492 1.162 11.33 -1.71e-02 3.05 96
## 15               Stanly -3.57 -1.37 -0.207 1.023  7.21 -9.74e-19 1.91 96
##    missing
## 1        0
## 2        0
## 3        0
## 4        0
## 5        0
## 6        0
## 7        0
## 8        0
## 9        0
## 10       0
## 11       0
## 12       0
## 13       0
## 14       0
## 15       0
favstats(All$TMEANcm ~ All$County.Area)
##                  .group    min     Q1   median    Q3  max      mean   sd
## 1            Bar Harbor  -7.17 -1.425  0.02778 1.497 7.56  6.91e-02 2.67
## 2                Camden -10.51 -1.819  0.15625 1.625 7.26  1.64e-17 2.91
## 3              Carteret -10.54 -1.503 -0.00625 1.519 6.79 -1.19e-17 2.59
## 4                Durham  -8.74 -2.203 -0.32500 2.341 7.42 -3.32e-18 2.86
## 5  Duval (Jacksonville)  -9.01 -1.083  0.19231 1.825 5.46  1.93e-01 2.51
## 6    Leon (Tallahassee)  -8.58 -1.225  0.06538 2.254 7.46  2.15e-01 2.76
## 7              Lewiston  -6.96 -1.483  0.01667 1.703 7.10  6.23e-02 2.67
## 8           LewistonSub  -6.96 -1.483  0.01667 1.703 7.10  6.23e-02 2.67
## 9            Miami-Dade  -8.96 -0.760  0.12692 0.969 5.56 -8.01e-04 2.10
## 10     Orange (Orlando) -11.08 -0.887  0.01538 1.694 5.28  9.07e-02 2.59
## 11     Pinellas (Tampa) -12.10 -1.179  0.16154 1.538 5.03 -1.32e-01 3.00
## 12             Portland  -6.78 -1.553 -0.22222 1.683 7.30  4.46e-02 2.60
## 13          PortlandSub  -6.78 -1.553 -0.22222 1.683 7.30  4.46e-02 2.60
## 14            St. Lucie -10.81 -0.960  0.12692 1.415 5.68  8.00e-02 2.54
## 15               Stanly  -9.96 -2.047 -0.20625 2.013 9.36  1.14e-17 2.88
##     n missing
## 1  96       0
## 2  96       0
## 3  96       0
## 4  96       0
## 5  96       0
## 6  96       0
## 7  96       0
## 8  96       0
## 9  96       0
## 10 96       0
## 11 96       0
## 12 96       0
## 13 96       0
## 14 96       0
## 15 96       0
densityplot(~TotalSTD, data = All)

plot of chunk unnamed-chunk-5

densityplot(~PRECIPcm, data = All)

plot of chunk unnamed-chunk-5

densityplot(~TMEANcm, data = All)

plot of chunk unnamed-chunk-5

MLR OLS Regressions

## assuming same intercepts, no time effects

m1 = lm(TotalSTD ~ TMEANcm, data = All)
summary(m1)  # nonsig
## 
## Call:
## lm(formula = TotalSTD ~ TMEANcm, data = All)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -2.910 -0.719 -0.086  0.612  3.642 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  0.16058    0.02567    6.26  5.2e-10 ***
## TMEANcm      0.00863    0.00965    0.89     0.37    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.974 on 1438 degrees of freedom
## Multiple R-squared:  0.000555,   Adjusted R-squared:  -0.00014 
## F-statistic: 0.798 on 1 and 1438 DF,  p-value: 0.372
m2 = lm(TotalSTD ~ PRECIPcm, data = All)
summary(m2)  # nonsig
## 
## Call:
## lm(formula = TotalSTD ~ PRECIPcm, data = All)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -2.919 -0.723 -0.082  0.607  3.622 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   0.1613     0.0257    6.28  4.3e-10 ***
## PRECIPcm     -0.0114     0.0103   -1.11     0.27    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.974 on 1438 degrees of freedom
## Multiple R-squared:  0.000852,   Adjusted R-squared:  0.000157 
## F-statistic: 1.23 on 1 and 1438 DF,  p-value: 0.268
m3 = lm(TotalSTD ~ PRECIPcm + TMEANcm, data = All)
summary(m3)  # nonsig
## 
## Call:
## lm(formula = TotalSTD ~ PRECIPcm + TMEANcm, data = All)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -2.922 -0.722 -0.082  0.602  3.629 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  0.16086    0.02567    6.27  4.8e-10 ***
## PRECIPcm    -0.01063    0.01032   -1.03     0.30    
## TMEANcm      0.00772    0.00969    0.80     0.43    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.974 on 1437 degrees of freedom
## Multiple R-squared:  0.00129,    Adjusted R-squared:  -9.74e-05 
## F-statistic: 0.93 on 2 and 1437 DF,  p-value: 0.395

## with quadratic time trends & county effects

m1a = lm(TotalSTD ~ TMEANcm + t + t2 + County.Area, data = All)
summary(m1a)  # sig at 0.1 level
## 
## Call:
## lm(formula = TotalSTD ~ TMEANcm + t + t2 + County.Area, data = All)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -2.539 -0.663 -0.079  0.537  3.285 
## 
## Coefficients:
##                                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                      7.72e-01   1.26e-01    6.11  1.3e-09 ***
## TMEANcm                          1.56e-02   9.31e-03    1.68  0.09350 .  
## t                               -2.82e-02   3.83e-03   -7.36  3.0e-13 ***
## t2                               1.97e-04   3.56e-05    5.54  3.6e-08 ***
## County.AreaCamden                1.27e-02   1.33e-01    0.10  0.92391    
## County.AreaCarteret              1.27e-02   1.33e-01    0.10  0.92391    
## County.AreaDurham                1.27e-02   1.33e-01    0.10  0.92391    
## County.AreaDuval (Jacksonville)  3.84e-01   1.33e-01    2.88  0.00404 ** 
## County.AreaLeon (Tallahassee)    3.99e-01   1.33e-01    2.99  0.00282 ** 
## County.AreaLewiston              3.17e-02   1.33e-01    0.24  0.81204    
## County.AreaLewistonSub           1.20e-04   1.33e-01    0.00  0.99928    
## County.AreaMiami-Dade            4.99e-01   1.33e-01    3.74  0.00019 ***
## County.AreaOrange (Orlando)      5.09e-01   1.33e-01    3.82  0.00014 ***
## County.AreaPinellas (Tampa)      2.53e-01   1.33e-01    1.90  0.05793 .  
## County.AreaPortland              4.44e-03   1.33e-01    0.03  0.97344    
## County.AreaPortlandSub          -1.41e-02   1.33e-01   -0.11  0.91561    
## County.AreaSt. Lucie             4.78e-01   1.33e-01    3.59  0.00035 ***
## County.AreaStanly                1.27e-02   1.33e-01    0.10  0.92391    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.923 on 1422 degrees of freedom
## Multiple R-squared:  0.111,  Adjusted R-squared:  0.101 
## F-statistic: 10.5 on 17 and 1422 DF,  p-value: <2e-16
plot(m1a, which = 1)

plot of chunk unnamed-chunk-6

plot(m1a, which = 2)

plot of chunk unnamed-chunk-6

plot(m1a$residuals[which(All$County.Area == "Miami-Dade")] ~ All$t[which(All$County.Area == 
    "Miami-Dade")])

plot of chunk unnamed-chunk-6

SCtest(m1a)  # highly serially correlated
## 
## Call:
## lm(formula = res[-n] ~ res[-1])
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -2.841 -0.552 -0.116  0.474  3.338 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 5.05e-05   2.24e-02     0.0        1    
## res[-1]     3.83e-01   2.44e-02    15.7   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.849 on 1437 degrees of freedom
## Multiple R-squared:  0.146,  Adjusted R-squared:  0.146 
## F-statistic:  246 on 1 and 1437 DF,  p-value: <2e-16

m2a = lm(TotalSTD ~ PRECIPcm + t + t2 + County.Area, data = All)
summary(m2a)  # not sig
## 
## Call:
## lm(formula = TotalSTD ~ PRECIPcm + t + t2 + County.Area, data = All)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -2.548 -0.666 -0.075  0.526  3.264 
## 
## Coefficients:
##                                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                      7.74e-01   1.26e-01    6.12  1.2e-09 ***
## PRECIPcm                        -1.17e-02   9.76e-03   -1.20  0.22979    
## t                               -2.85e-02   3.82e-03   -7.45  1.6e-13 ***
## t2                               2.02e-04   3.54e-05    5.70  1.4e-08 ***
## County.AreaCamden                9.99e-03   1.33e-01    0.07  0.94031    
## County.AreaCarteret              9.99e-03   1.33e-01    0.07  0.94031    
## County.AreaDurham                9.99e-03   1.33e-01    0.07  0.94031    
## County.AreaDuval (Jacksonville)  3.84e-01   1.33e-01    2.88  0.00400 ** 
## County.AreaLeon (Tallahassee)    3.98e-01   1.33e-01    2.99  0.00286 ** 
## County.AreaLewiston              3.10e-02   1.33e-01    0.23  0.81620    
## County.AreaLewistonSub          -5.80e-04   1.33e-01    0.00  0.99653    
## County.AreaMiami-Dade            4.95e-01   1.33e-01    3.71  0.00021 ***
## County.AreaOrange (Orlando)      5.08e-01   1.33e-01    3.81  0.00014 ***
## County.AreaPinellas (Tampa)      2.49e-01   1.33e-01    1.87  0.06211 .  
## County.AreaPortland              2.84e-03   1.33e-01    0.02  0.98303    
## County.AreaPortlandSub          -1.57e-02   1.33e-01   -0.12  0.90613    
## County.AreaSt. Lucie             4.76e-01   1.33e-01    3.57  0.00037 ***
## County.AreaStanly                9.99e-03   1.33e-01    0.07  0.94031    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.924 on 1422 degrees of freedom
## Multiple R-squared:  0.111,  Adjusted R-squared:  0.0999 
## F-statistic: 10.4 on 17 and 1422 DF,  p-value: <2e-16

m3a = lm(TotalSTD ~ PRECIPcm + TMEANcm + t + t2 + County.Area, data = All)
summary(m3a)  # not sig
## 
## Call:
## lm(formula = TotalSTD ~ PRECIPcm + TMEANcm + t + t2 + County.Area, 
##     data = All)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -2.551 -0.665 -0.085  0.531  3.272 
## 
## Coefficients:
##                                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                      7.74e-01   1.26e-01    6.13  1.2e-09 ***
## PRECIPcm                        -1.04e-02   9.79e-03   -1.06  0.28996    
## TMEANcm                          1.48e-02   9.35e-03    1.58  0.11459    
## t                               -2.82e-02   3.83e-03   -7.37  2.9e-13 ***
## t2                               1.97e-04   3.56e-05    5.54  3.5e-08 ***
## County.AreaCamden                1.12e-02   1.33e-01    0.08  0.93305    
## County.AreaCarteret              1.12e-02   1.33e-01    0.08  0.93305    
## County.AreaDurham                1.12e-02   1.33e-01    0.08  0.93305    
## County.AreaDuval (Jacksonville)  3.83e-01   1.33e-01    2.87  0.00414 ** 
## County.AreaLeon (Tallahassee)    3.97e-01   1.33e-01    2.98  0.00298 ** 
## County.AreaLewiston              3.12e-02   1.33e-01    0.23  0.81512    
## County.AreaLewistonSub          -4.10e-04   1.33e-01    0.00  0.99755    
## County.AreaMiami-Dade            4.96e-01   1.33e-01    3.72  0.00020 ***
## County.AreaOrange (Orlando)      5.08e-01   1.33e-01    3.81  0.00014 ***
## County.AreaPinellas (Tampa)      2.52e-01   1.33e-01    1.89  0.05886 .  
## County.AreaPortland              3.34e-03   1.33e-01    0.03  0.98001    
## County.AreaPortlandSub          -1.52e-02   1.33e-01   -0.11  0.90907    
## County.AreaSt. Lucie             4.76e-01   1.33e-01    3.57  0.00036 ***
## County.AreaStanly                1.12e-02   1.33e-01    0.08  0.93305    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.923 on 1421 degrees of freedom
## Multiple R-squared:  0.112,  Adjusted R-squared:  0.101 
## F-statistic: 9.97 on 18 and 1421 DF,  p-value: <2e-16
SCtest(m3a)  # highly serially correlated
## 
## Call:
## lm(formula = res[-n] ~ res[-1])
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -2.893 -0.551 -0.109  0.475  3.333 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 7.42e-05   2.24e-02     0.0        1    
## res[-1]     3.82e-01   2.44e-02    15.7   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.849 on 1437 degrees of freedom
## Multiple R-squared:  0.146,  Adjusted R-squared:  0.145 
## F-statistic:  245 on 1 and 1437 DF,  p-value: <2e-16

## with month*year & county FE

m1b = lm(TotalSTD ~ TMEANcm + factor(t) + County.Area, data = All)
summary(m1b)  # nonsig
## 
## Call:
## lm(formula = TotalSTD ~ TMEANcm + factor(t) + County.Area, data = All)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -2.499 -0.521 -0.030  0.488  3.525 
## 
## Coefficients:
##                                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                      5.55e-01   2.19e-01    2.53  0.01143 *  
## TMEANcm                         -5.58e-03   1.14e-02   -0.49  0.62401    
## factor(t)6                      -2.31e-01   2.89e-01   -0.80  0.42493    
## factor(t)7                      -3.61e-01   2.89e-01   -1.25  0.21189    
## factor(t)8                      -5.75e-01   2.89e-01   -1.99  0.04695 *  
## factor(t)9                      -3.62e-01   2.89e-01   -1.25  0.21152    
## factor(t)10                     -2.98e-01   2.89e-01   -1.03  0.30346    
## factor(t)11                      7.75e-01   2.89e-01    2.68  0.00754 ** 
## factor(t)12                     -9.40e-01   2.89e-01   -3.25  0.00118 ** 
## factor(t)13                     -7.79e-01   2.90e-01   -2.69  0.00725 ** 
## factor(t)14                      4.39e-01   2.90e-01    1.51  0.13053    
## factor(t)15                     -3.72e-02   2.89e-01   -0.13  0.89772    
## factor(t)16                      1.23e-01   2.90e-01    0.43  0.67044    
## factor(t)17                      1.54e-01   2.90e-01    0.53  0.59620    
## factor(t)18                     -3.24e-01   2.89e-01   -1.12  0.26237    
## factor(t)19                     -2.58e-01   2.90e-01   -0.89  0.37332    
## factor(t)20                     -3.80e-01   2.90e-01   -1.31  0.19021    
## factor(t)21                     -8.11e-01   2.90e-01   -2.80  0.00526 ** 
## factor(t)22                     -7.67e-01   2.89e-01   -2.65  0.00812 ** 
## factor(t)23                      1.20e+00   2.91e-01    4.14  3.7e-05 ***
## factor(t)24                     -9.52e-01   2.90e-01   -3.28  0.00106 ** 
## factor(t)25                     -1.03e+00   2.89e-01   -3.55  0.00039 ***
## factor(t)26                     -4.03e-02   2.90e-01   -0.14  0.88938    
## factor(t)27                     -4.56e-01   2.89e-01   -1.58  0.11459    
## factor(t)28                     -4.63e-01   2.89e-01   -1.60  0.10925    
## factor(t)29                      3.67e-01   2.89e-01    1.27  0.20439    
## factor(t)30                     -8.69e-02   2.90e-01   -0.30  0.76440    
## factor(t)31                     -7.03e-02   2.89e-01   -0.24  0.80796    
## factor(t)32                     -3.60e-01   2.89e-01   -1.24  0.21336    
## factor(t)33                     -4.41e-01   2.89e-01   -1.53  0.12727    
## factor(t)34                     -7.35e-01   2.94e-01   -2.50  0.01256 *  
## factor(t)35                      7.00e-01   2.95e-01    2.38  0.01766 *  
## factor(t)36                     -7.93e-01   2.89e-01   -2.74  0.00614 ** 
## factor(t)37                     -1.05e+00   2.89e-01   -3.62  0.00030 ***
## factor(t)38                     -1.55e-01   2.89e-01   -0.53  0.59339    
## factor(t)39                     -6.06e-01   2.89e-01   -2.09  0.03650 *  
## factor(t)40                     -3.78e-01   2.89e-01   -1.31  0.19082    
## factor(t)41                      1.51e-01   2.89e-01    0.52  0.60112    
## factor(t)42                     -3.43e-01   2.89e-01   -1.18  0.23627    
## factor(t)43                     -3.71e-02   2.89e-01   -0.13  0.89803    
## factor(t)44                     -5.42e-01   2.92e-01   -1.86  0.06347 .  
## factor(t)45                     -6.17e-01   2.89e-01   -2.13  0.03314 *  
## factor(t)46                     -6.92e-01   2.91e-01   -2.38  0.01737 *  
## factor(t)47                      4.02e-01   2.89e-01    1.39  0.16497    
## factor(t)48                     -9.96e-01   2.93e-01   -3.40  0.00068 ***
## factor(t)49                     -1.28e+00   2.89e-01   -4.43  1.0e-05 ***
## factor(t)50                     -4.86e-01   2.89e-01   -1.68  0.09337 .  
## factor(t)51                     -6.81e-01   2.89e-01   -2.35  0.01868 *  
## factor(t)52                     -5.62e-01   2.89e-01   -1.94  0.05248 .  
## factor(t)53                     -1.43e-02   2.89e-01   -0.05  0.96064    
## factor(t)54                     -4.40e-01   2.89e-01   -1.52  0.12846    
## factor(t)55                     -4.68e-01   2.89e-01   -1.62  0.10556    
## factor(t)56                     -7.39e-01   2.89e-01   -2.56  0.01069 *  
## factor(t)57                     -1.12e+00   2.90e-01   -3.85  0.00012 ***
## factor(t)58                     -1.48e+00   2.90e-01   -5.12  3.5e-07 ***
## factor(t)59                     -3.43e-02   2.89e-01   -0.12  0.90567    
## factor(t)60                     -1.72e+00   2.90e-01   -5.93  3.9e-09 ***
## factor(t)61                     -1.73e+00   2.89e-01   -5.99  2.7e-09 ***
## factor(t)62                     -1.20e+00   2.89e-01   -4.15  3.6e-05 ***
## factor(t)63                     -1.36e+00   2.89e-01   -4.69  3.1e-06 ***
## factor(t)64                     -1.24e+00   2.89e-01   -4.30  1.9e-05 ***
## factor(t)65                     -7.55e-01   2.89e-01   -2.61  0.00918 ** 
## factor(t)66                     -8.38e-01   2.89e-01   -2.90  0.00381 ** 
## factor(t)67                     -6.43e-01   2.89e-01   -2.22  0.02637 *  
## factor(t)68                     -8.78e-01   2.89e-01   -3.04  0.00243 ** 
## factor(t)69                     -1.22e+00   2.89e-01   -4.21  2.7e-05 ***
## factor(t)70                     -1.38e+00   2.90e-01   -4.76  2.1e-06 ***
## factor(t)71                     -2.03e-01   2.91e-01   -0.70  0.48496    
## factor(t)72                     -1.82e+00   2.91e-01   -6.24  5.7e-10 ***
## factor(t)73                     -1.63e+00   2.89e-01   -5.63  2.2e-08 ***
## factor(t)74                     -7.86e-01   2.91e-01   -2.70  0.00693 ** 
## factor(t)75                     -1.03e+00   2.92e-01   -3.54  0.00042 ***
## factor(t)76                     -1.03e+00   2.93e-01   -3.51  0.00047 ***
## factor(t)77                     -4.59e-01   2.90e-01   -1.58  0.11383    
## factor(t)78                     -8.07e-01   2.90e-01   -2.78  0.00548 ** 
## factor(t)79                     -6.57e-01   2.90e-01   -2.27  0.02362 *  
## factor(t)80                     -8.37e-01   2.89e-01   -2.89  0.00391 ** 
## factor(t)81                     -1.05e+00   2.89e-01   -3.62  0.00031 ***
## factor(t)82                     -1.20e+00   2.97e-01   -4.05  5.5e-05 ***
## factor(t)83                      4.26e-01   2.90e-01    1.47  0.14207    
## factor(t)84                     -1.50e+00   2.90e-01   -5.18  2.6e-07 ***
## factor(t)85                     -1.34e+00   2.89e-01   -4.65  3.7e-06 ***
## factor(t)86                     -4.02e-01   2.90e-01   -1.39  0.16580    
## factor(t)87                     -7.96e-01   2.89e-01   -2.75  0.00596 ** 
## factor(t)88                     -8.12e-01   2.90e-01   -2.81  0.00510 ** 
## factor(t)89                     -1.37e-01   2.89e-01   -0.47  0.63548    
## factor(t)90                     -4.16e-01   2.90e-01   -1.43  0.15200    
## factor(t)91                     -3.97e-01   2.89e-01   -1.37  0.17011    
## factor(t)92                     -4.12e-01   2.89e-01   -1.43  0.15397    
## factor(t)93                     -7.71e-01   2.90e-01   -2.66  0.00794 ** 
## factor(t)94                     -6.81e-01   2.93e-01   -2.32  0.02024 *  
## factor(t)95                      5.47e-01   2.92e-01    1.88  0.06082 .  
## factor(t)96                     -1.25e+00   2.93e-01   -4.27  2.1e-05 ***
## factor(t)97                     -8.31e-01   2.97e-01   -2.80  0.00517 ** 
## factor(t)98                     -8.43e-02   2.91e-01   -0.29  0.77201    
## factor(t)99                     -5.64e-01   2.90e-01   -1.94  0.05207 .  
## factor(t)100                    -4.67e-01   2.89e-01   -1.61  0.10672    
## County.AreaCamden                1.13e-02   1.14e-01    0.10  0.92148    
## County.AreaCarteret              1.13e-02   1.14e-01    0.10  0.92148    
## County.AreaDurham                1.13e-02   1.14e-01    0.10  0.92148    
## County.AreaDuval (Jacksonville)  3.86e-01   1.14e-01    3.38  0.00074 ***
## County.AreaLeon (Tallahassee)    4.02e-01   1.14e-01    3.52  0.00045 ***
## County.AreaLewiston              3.16e-02   1.14e-01    0.28  0.78247    
## County.AreaLewistonSub          -2.45e-05   1.14e-01    0.00  0.99983    
## County.AreaMiami-Dade            4.97e-01   1.14e-01    4.35  1.5e-05 ***
## County.AreaOrange (Orlando)      5.10e-01   1.14e-01    4.46  8.8e-06 ***
## County.AreaPinellas (Tampa)      2.49e-01   1.14e-01    2.18  0.02972 *  
## County.AreaPortland              3.92e-03   1.14e-01    0.03  0.97265    
## County.AreaPortlandSub          -1.46e-02   1.14e-01   -0.13  0.89803    
## County.AreaSt. Lucie             4.78e-01   1.14e-01    4.19  3.0e-05 ***
## County.AreaStanly                1.13e-02   1.14e-01    0.10  0.92148    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.792 on 1329 degrees of freedom
## Multiple R-squared:  0.39,   Adjusted R-squared:  0.339 
## F-statistic: 7.71 on 110 and 1329 DF,  p-value: <2e-16

m2b = lm(TotalSTD ~ PRECIPcm + factor(t) + County.Area, data = All)
summary(m2b)  # nonsig
## 
## Call:
## lm(formula = TotalSTD ~ PRECIPcm + factor(t) + County.Area, data = All)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -2.502 -0.514 -0.036  0.482  3.517 
## 
## Coefficients:
##                                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                      0.551267   0.218981    2.52  0.01194 *  
## PRECIPcm                        -0.006976   0.009694   -0.72  0.47185    
## factor(t)6                      -0.209355   0.289693   -0.72  0.47000    
## factor(t)7                      -0.340436   0.290416   -1.17  0.24131    
## factor(t)8                      -0.574177   0.289024   -1.99  0.04717 *  
## factor(t)9                      -0.370057   0.289051   -1.28  0.20068    
## factor(t)10                     -0.290424   0.289023   -1.00  0.31515    
## factor(t)11                      0.770314   0.289057    2.66  0.00779 ** 
## factor(t)12                     -0.930014   0.289184   -3.22  0.00133 ** 
## factor(t)13                     -0.756502   0.289646   -2.61  0.00911 ** 
## factor(t)14                      0.464527   0.289594    1.60  0.10894    
## factor(t)15                     -0.015292   0.289889   -0.05  0.95794    
## factor(t)16                      0.160383   0.291323    0.55  0.58205    
## factor(t)17                      0.148467   0.289174    0.51  0.60774    
## factor(t)18                     -0.325155   0.289127   -1.12  0.26096    
## factor(t)19                     -0.278386   0.289209   -0.96  0.33593    
## factor(t)20                     -0.376274   0.289812   -1.30  0.19440    
## factor(t)21                     -0.796713   0.291292   -2.74  0.00632 ** 
## factor(t)22                     -0.745503   0.289857   -2.57  0.01022 *  
## factor(t)23                      1.194913   0.289148    4.13  3.8e-05 ***
## factor(t)24                     -0.951624   0.289569   -3.29  0.00104 ** 
## factor(t)25                     -1.031496   0.289116   -3.57  0.00037 ***
## factor(t)26                     -0.051081   0.289022   -0.18  0.85974    
## factor(t)27                     -0.456434   0.289024   -1.58  0.11452    
## factor(t)28                     -0.441410   0.290570   -1.52  0.12897    
## factor(t)29                      0.380640   0.290276    1.31  0.18998    
## factor(t)30                     -0.092696   0.289076   -0.32  0.74852    
## factor(t)31                     -0.060954   0.289070   -0.21  0.83303    
## factor(t)32                     -0.353764   0.289048   -1.22  0.22121    
## factor(t)33                     -0.421005   0.290220   -1.45  0.14712    
## factor(t)34                     -0.748639   0.289560   -2.59  0.00983 ** 
## factor(t)35                      0.678380   0.289161    2.35  0.01912 *  
## factor(t)36                     -0.786456   0.289129   -2.72  0.00661 ** 
## factor(t)37                     -1.047506   0.289060   -3.62  0.00030 ***
## factor(t)38                     -0.140976   0.289218   -0.49  0.62603    
## factor(t)39                     -0.586755   0.289462   -2.03  0.04286 *  
## factor(t)40                     -0.373360   0.289150   -1.29  0.19685    
## factor(t)41                      0.146930   0.289030    0.51  0.61129    
## factor(t)42                     -0.359594   0.289305   -1.24  0.21410    
## factor(t)43                     -0.042956   0.289021   -0.15  0.88187    
## factor(t)44                     -0.546042   0.289933   -1.88  0.05987 .  
## factor(t)45                     -0.626147   0.289028   -2.17  0.03046 *  
## factor(t)46                     -0.697697   0.289313   -2.41  0.01602 *  
## factor(t)47                      0.409373   0.289121    1.42  0.15703    
## factor(t)48                     -1.003898   0.289781   -3.46  0.00055 ***
## factor(t)49                     -1.265900   0.290366   -4.36  1.4e-05 ***
## factor(t)50                     -0.459816   0.290584   -1.58  0.11380    
## factor(t)51                     -0.679803   0.289037   -2.35  0.01882 *  
## factor(t)52                     -0.575724   0.289242   -1.99  0.04675 *  
## factor(t)53                     -0.004649   0.289438   -0.02  0.98719    
## factor(t)54                     -0.419746   0.290571   -1.44  0.14882    
## factor(t)55                     -0.459232   0.289277   -1.59  0.11263    
## factor(t)56                     -0.712068   0.290680   -2.45  0.01443 *  
## factor(t)57                     -1.102425   0.289050   -3.81  0.00014 ***
## factor(t)58                     -1.490591   0.289112   -5.16  2.9e-07 ***
## factor(t)59                     -0.026249   0.289114   -0.09  0.92767    
## factor(t)60                     -1.707202   0.289021   -5.91  4.4e-09 ***
## factor(t)61                     -1.722122   0.289193   -5.95  3.3e-09 ***
## factor(t)62                     -1.191795   0.289153   -4.12  4.0e-05 ***
## factor(t)63                     -1.342300   0.290662   -4.62  4.2e-06 ***
## factor(t)64                     -1.248210   0.289038   -4.32  1.7e-05 ***
## factor(t)65                     -0.728921   0.290508   -2.51  0.01222 *  
## factor(t)66                     -0.824090   0.289401   -2.85  0.00447 ** 
## factor(t)67                     -0.645883   0.289059   -2.23  0.02562 *  
## factor(t)68                     -0.886871   0.289121   -3.07  0.00220 ** 
## factor(t)69                     -1.209969   0.289435   -4.18  3.1e-05 ***
## factor(t)70                     -1.361651   0.291557   -4.67  3.3e-06 ***
## factor(t)71                     -0.170566   0.290022   -0.59  0.55656    
## factor(t)72                     -1.784850   0.289800   -6.16  9.7e-10 ***
## factor(t)73                     -1.603498   0.290497   -5.52  4.1e-08 ***
## factor(t)74                     -0.785328   0.289977   -2.71  0.00685 ** 
## factor(t)75                     -1.052261   0.289024   -3.64  0.00028 ***
## factor(t)76                     -1.056232   0.289208   -3.65  0.00027 ***
## factor(t)77                     -0.472331   0.289036   -1.63  0.10246    
## factor(t)78                     -0.811887   0.289214   -2.81  0.00507 ** 
## factor(t)79                     -0.661212   0.289196   -2.29  0.02239 *  
## factor(t)80                     -0.848656   0.289106   -2.94  0.00339 ** 
## factor(t)81                     -1.041650   0.289104   -3.60  0.00033 ***
## factor(t)82                     -1.166131   0.289048   -4.03  5.8e-05 ***
## factor(t)83                      0.450128   0.289793    1.55  0.12060    
## factor(t)84                     -1.508661   0.289032   -5.22  2.1e-07 ***
## factor(t)85                     -1.332588   0.289405   -4.60  4.5e-06 ***
## factor(t)86                     -0.407160   0.289212   -1.41  0.15942    
## factor(t)87                     -0.798511   0.289026   -2.76  0.00581 ** 
## factor(t)88                     -0.823650   0.289049   -2.85  0.00445 ** 
## factor(t)89                     -0.145785   0.289026   -0.50  0.61406    
## factor(t)90                     -0.416826   0.289391   -1.44  0.15000    
## factor(t)91                     -0.388358   0.289455   -1.34  0.17993    
## factor(t)92                     -0.392977   0.290095   -1.35  0.17576    
## factor(t)93                     -0.778251   0.289103   -2.69  0.00719 ** 
## factor(t)94                     -0.706456   0.289025   -2.44  0.01464 *  
## factor(t)95                      0.529791   0.289028    1.83  0.06702 .  
## factor(t)96                     -1.265658   0.289290   -4.38  1.3e-05 ***
## factor(t)97                     -0.862635   0.289033   -2.98  0.00289 ** 
## factor(t)98                     -0.097971   0.289052   -0.34  0.73471    
## factor(t)99                     -0.556736   0.290450   -1.92  0.05548 .  
## factor(t)100                    -0.448049   0.290284   -1.54  0.12295    
## County.AreaCamden                0.010660   0.114254    0.09  0.92568    
## County.AreaCarteret              0.010660   0.114254    0.09  0.92568    
## County.AreaDurham                0.010660   0.114254    0.09  0.92568    
## County.AreaDuval (Jacksonville)  0.384924   0.114251    3.37  0.00078 ***
## County.AreaLeon (Tallahassee)    0.399493   0.114267    3.50  0.00049 ***
## County.AreaLewiston              0.031238   0.114247    0.27  0.78457    
## County.AreaLewistonSub          -0.000339   0.114247    0.00  0.99763    
## County.AreaMiami-Dade            0.496020   0.114265    4.34  1.5e-05 ***
## County.AreaOrange (Orlando)      0.508756   0.114252    4.45  9.2e-06 ***
## County.AreaPinellas (Tampa)      0.249287   0.114248    2.18  0.02929 *  
## County.AreaPortland              0.003330   0.114250    0.03  0.97675    
## County.AreaPortlandSub          -0.015233   0.114250   -0.13  0.89395    
## County.AreaSt. Lucie             0.477151   0.114256    4.18  3.2e-05 ***
## County.AreaStanly                0.010660   0.114254    0.09  0.92568    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.792 on 1329 degrees of freedom
## Multiple R-squared:  0.39,   Adjusted R-squared:  0.339 
## F-statistic: 7.71 on 110 and 1329 DF,  p-value: <2e-16

m3b = lm(TotalSTD ~ PRECIPcm + TMEANcm + factor(t) + County.Area, data = All)
summary(m3b)  # nonsig
## 
## Call:
## lm(formula = TotalSTD ~ PRECIPcm + TMEANcm + factor(t) + County.Area, 
##     data = All)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -2.507 -0.512 -0.034  0.482  3.524 
## 
## Coefficients:
##                                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                      0.547010   0.219192    2.50  0.01270 *  
## PRECIPcm                        -0.007202   0.009706   -0.74  0.45821    
## TMEANcm                         -0.005958   0.011398   -0.52  0.60125    
## factor(t)6                      -0.216876   0.290129   -0.75  0.45488    
## factor(t)7                      -0.339899   0.290498   -1.17  0.24219    
## factor(t)8                      -0.573832   0.289103   -1.98  0.04736 *  
## factor(t)9                      -0.364303   0.289339   -1.26  0.20822    
## factor(t)10                     -0.297432   0.289413   -1.03  0.30427    
## factor(t)11                      0.778455   0.289555    2.69  0.00727 ** 
## factor(t)12                     -0.933215   0.289328   -3.23  0.00129 ** 
## factor(t)13                     -0.765203   0.290203   -2.64  0.00847 ** 
## factor(t)14                      0.451687   0.290713    1.55  0.12049    
## factor(t)15                     -0.020929   0.290168   -0.07  0.94251    
## factor(t)16                      0.149819   0.292103    0.51  0.60811    
## factor(t)17                      0.161555   0.290335    0.56  0.57800    
## factor(t)18                     -0.318178   0.289514   -1.10  0.27197    
## factor(t)19                     -0.265329   0.290365   -0.91  0.36100    
## factor(t)20                     -0.363426   0.290931   -1.25  0.21182    
## factor(t)21                     -0.783066   0.292539   -2.68  0.00752 ** 
## factor(t)22                     -0.750914   0.290121   -2.59  0.00975 ** 
## factor(t)23                      1.212085   0.291087    4.16  3.3e-05 ***
## factor(t)24                     -0.937836   0.290847   -3.22  0.00129 ** 
## factor(t)25                     -1.033108   0.289212   -3.57  0.00037 ***
## factor(t)26                     -0.038905   0.290038   -0.13  0.89331    
## factor(t)27                     -0.457502   0.289110   -1.58  0.11379    
## factor(t)28                     -0.441005   0.290651   -1.52  0.12943    
## factor(t)29                      0.387822   0.290681    1.33  0.18237    
## factor(t)30                     -0.081996   0.289879   -0.28  0.77733    
## factor(t)31                     -0.066713   0.289359   -0.23  0.81770    
## factor(t)32                     -0.357249   0.289204   -1.24  0.21694    
## factor(t)33                     -0.421571   0.290302   -1.45  0.14669    
## factor(t)34                     -0.719994   0.294778   -2.44  0.01472 *  
## factor(t)35                      0.708987   0.295107    2.40  0.01642 *  
## factor(t)36                     -0.787595   0.289216   -2.72  0.00655 ** 
## factor(t)37                     -1.051557   0.289243   -3.64  0.00029 ***
## factor(t)38                     -0.146962   0.289524   -0.51  0.61182    
## factor(t)39                     -0.594647   0.289935   -2.05  0.04047 *  
## factor(t)40                     -0.371823   0.289244   -1.29  0.19884    
## factor(t)41                      0.149658   0.289156    0.52  0.60485    
## factor(t)42                     -0.351985   0.289750   -1.21  0.22466    
## factor(t)43                     -0.037177   0.289312   -0.13  0.89777    
## factor(t)44                     -0.523902   0.293089   -1.79  0.07408 .  
## factor(t)45                     -0.618278   0.289499   -2.14  0.03289 *  
## factor(t)46                     -0.681552   0.291036   -2.34  0.01934 *  
## factor(t)47                      0.407140   0.289232    1.41  0.15947    
## factor(t)48                     -0.979232   0.293676   -3.33  0.00088 ***
## factor(t)49                     -1.260254   0.290646   -4.34  1.6e-05 ***
## factor(t)50                     -0.463443   0.290747   -1.59  0.11118    
## factor(t)51                     -0.678264   0.289131   -2.35  0.01913 *  
## factor(t)52                     -0.569528   0.289564   -1.97  0.04941 *  
## factor(t)53                     -0.002619   0.289543   -0.01  0.99278    
## factor(t)54                     -0.417337   0.290687   -1.44  0.15133    
## factor(t)55                     -0.459113   0.289356   -1.59  0.11283    
## factor(t)56                     -0.716671   0.290893   -2.46  0.01388 *  
## factor(t)57                     -1.116139   0.290317   -3.84  0.00013 ***
## factor(t)58                     -1.478314   0.290143   -5.10  4.0e-07 ***
## factor(t)59                     -0.029006   0.289241   -0.10  0.92014    
## factor(t)60                     -1.719961   0.290128   -5.93  3.9e-09 ***
## factor(t)61                     -1.724440   0.289307   -5.96  3.2e-09 ***
## factor(t)62                     -1.191669   0.289232   -4.12  4.0e-05 ***
## factor(t)63                     -1.333403   0.291239   -4.58  5.1e-06 ***
## factor(t)64                     -1.240725   0.289471   -4.29  1.9e-05 ***
## factor(t)65                     -0.733003   0.290693   -2.52  0.01180 *  
## factor(t)66                     -0.827356   0.289547   -2.86  0.00434 ** 
## factor(t)67                     -0.639305   0.289412   -2.21  0.02735 *  
## factor(t)68                     -0.883833   0.289258   -3.06  0.00229 ** 
## factor(t)69                     -1.206220   0.289603   -4.17  3.3e-05 ***
## factor(t)70                     -1.350992   0.292349   -4.62  4.2e-06 ***
## factor(t)71                     -0.186199   0.291639   -0.64  0.52329    
## factor(t)72                     -1.801248   0.291572   -6.18  8.6e-10 ***
## factor(t)73                     -1.607711   0.290688   -5.53  3.8e-08 ***
## factor(t)74                     -0.767938   0.291958   -2.63  0.00863 ** 
## factor(t)75                     -1.031363   0.291854   -3.53  0.00042 ***
## factor(t)76                     -1.032657   0.292782   -3.53  0.00043 ***
## factor(t)77                     -0.460287   0.290032   -1.59  0.11275    
## factor(t)78                     -0.798411   0.290440   -2.75  0.00606 ** 
## factor(t)79                     -0.648828   0.290243   -2.24  0.02555 *  
## factor(t)80                     -0.841315   0.289526   -2.91  0.00372 ** 
## factor(t)81                     -1.040921   0.289186   -3.60  0.00033 ***
## factor(t)82                     -1.202309   0.297295   -4.04  5.6e-05 ***
## factor(t)83                      0.440623   0.290443    1.52  0.12949    
## factor(t)84                     -1.498049   0.289822   -5.17  2.7e-07 ***
## factor(t)85                     -1.332806   0.289485   -4.60  4.5e-06 ***
## factor(t)86                     -0.393687   0.290437   -1.36  0.17549    
## factor(t)87                     -0.794818   0.289191   -2.75  0.00607 ** 
## factor(t)88                     -0.814823   0.289621   -2.81  0.00497 ** 
## factor(t)89                     -0.138041   0.289485   -0.48  0.63355    
## factor(t)90                     -0.404050   0.290500   -1.39  0.16450    
## factor(t)91                     -0.384856   0.289612   -1.33  0.18412    
## factor(t)92                     -0.393909   0.290180   -1.36  0.17486    
## factor(t)93                     -0.765329   0.290236   -2.64  0.00846 ** 
## factor(t)94                     -0.680999   0.293177   -2.32  0.02034 *  
## factor(t)95                      0.549868   0.291647    1.89  0.05960 .  
## factor(t)96                     -1.240237   0.293428   -4.23  2.5e-05 ***
## factor(t)97                     -0.827233   0.296939   -2.79  0.00541 ** 
## factor(t)98                     -0.080076   0.291150   -0.28  0.78333    
## factor(t)99                     -0.542127   0.291871   -1.86  0.06347 .  
## factor(t)100                    -0.446441   0.290380   -1.54  0.12442    
## County.AreaCamden                0.010217   0.114288    0.09  0.92878    
## County.AreaCarteret              0.010217   0.114288    0.09  0.92878    
## County.AreaDurham                0.010217   0.114288    0.09  0.92878    
## County.AreaDuval (Jacksonville)  0.385635   0.114290    3.37  0.00076 ***
## County.AreaLeon (Tallahassee)    0.400311   0.114309    3.50  0.00048 ***
## County.AreaLewiston              0.031186   0.114278    0.27  0.78498    
## County.AreaLewistonSub          -0.000392   0.114278    0.00  0.99727    
## County.AreaMiami-Dade            0.495554   0.114299    4.34  1.6e-05 ***
## County.AreaOrange (Orlando)      0.508856   0.114284    4.45  9.2e-06 ***
## County.AreaPinellas (Tampa)      0.248074   0.114303    2.17  0.03016 *  
## County.AreaPortland              0.003160   0.114282    0.03  0.97794    
## County.AreaPortlandSub          -0.015403   0.114282   -0.13  0.89281    
## County.AreaSt. Lucie             0.477180   0.114287    4.18  3.2e-05 ***
## County.AreaStanly                0.010217   0.114288    0.09  0.92878    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.792 on 1328 degrees of freedom
## Multiple R-squared:  0.39,   Adjusted R-squared:  0.339 
## F-statistic: 7.64 on 111 and 1328 DF,  p-value: <2e-16

## 1st differences model with quadratic time trends and County FE

m1c = lm(dTotalSTD ~ TMEANcm + t + t2 + County.Area, data = All)
summary(m1c)  # nonsig
## 
## Call:
## lm(formula = dTotalSTD ~ TMEANcm + t + t2 + County.Area, data = All)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -4.280 -0.483 -0.017  0.548  3.340 
## 
## Coefficients:
##                                  Estimate Std. Error t value Pr(>|t|)
## (Intercept)                      4.41e-02   1.41e-01    0.31     0.75
## TMEANcm                         -4.32e-03   1.04e-02   -0.42     0.68
## t                               -2.53e-03   4.29e-03   -0.59     0.56
## t2                               2.59e-05   3.98e-05    0.65     0.52
## County.AreaCamden               -3.92e-03   1.49e-01   -0.03     0.98
## County.AreaCarteret             -1.79e-02   1.49e-01   -0.12     0.90
## County.AreaDurham               -9.47e-03   1.49e-01   -0.06     0.95
## County.AreaDuval (Jacksonville)  2.37e-03   1.48e-01    0.02     0.99
## County.AreaLeon (Tallahassee)   -4.78e-03   1.48e-01   -0.03     0.97
## County.AreaLewiston             -1.72e-03   1.48e-01   -0.01     0.99
## County.AreaLewistonSub           1.94e-03   1.48e-01    0.01     0.99
## County.AreaMiami-Dade            1.42e-02   1.48e-01    0.10     0.92
## County.AreaOrange (Orlando)      1.41e-02   1.48e-01    0.10     0.92
## County.AreaPinellas (Tampa)     -2.98e-03   1.48e-01   -0.02     0.98
## County.AreaPortland             -2.74e-03   1.48e-01   -0.02     0.99
## County.AreaPortlandSub           5.27e-03   1.48e-01    0.04     0.97
## County.AreaSt. Lucie            -1.12e-03   1.48e-01   -0.01     0.99
## County.AreaStanly               -2.48e-02   1.49e-01   -0.17     0.87
## 
## Residual standard error: 1.03 on 1418 degrees of freedom
##   (4 observations deleted due to missingness)
## Multiple R-squared:  0.000496,   Adjusted R-squared:  -0.0115 
## F-statistic: 0.0414 on 17 and 1418 DF,  p-value: 1
SCtest(m1c)  # residuals still highly correlated over time
## 
## Call:
## lm(formula = res[-n] ~ res[-1])
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -4.220 -0.439  0.099  0.626  3.163 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) -0.000104   0.024808     0.0        1    
## res[-1]     -0.390734   0.024317   -16.1   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.94 on 1433 degrees of freedom
## Multiple R-squared:  0.153,  Adjusted R-squared:  0.152 
## F-statistic:  258 on 1 and 1433 DF,  p-value: <2e-16

m2c = lm(dTotalSTD ~ PRECIPcm + t + t2 + County.Area, data = All)
summary(m2c)  # nonsig
## 
## Call:
## lm(formula = dTotalSTD ~ PRECIPcm + t + t2 + County.Area, data = All)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -4.264 -0.490 -0.019  0.549  3.389 
## 
## Coefficients:
##                                  Estimate Std. Error t value Pr(>|t|)
## (Intercept)                      4.54e-02   1.41e-01    0.32     0.75
## PRECIPcm                        -5.05e-03   1.08e-02   -0.47     0.64
## t                               -2.44e-03   4.29e-03   -0.57     0.57
## t2                               2.43e-05   3.96e-05    0.61     0.54
## County.AreaCamden               -4.22e-03   1.49e-01   -0.03     0.98
## County.AreaCarteret             -1.83e-02   1.49e-01   -0.12     0.90
## County.AreaDurham               -9.96e-03   1.49e-01   -0.07     0.95
## County.AreaDuval (Jacksonville)  1.26e-03   1.48e-01    0.01     0.99
## County.AreaLeon (Tallahassee)   -6.55e-03   1.48e-01   -0.04     0.96
## County.AreaLewiston             -1.95e-03   1.48e-01   -0.01     0.99
## County.AreaLewistonSub           1.71e-03   1.48e-01    0.01     0.99
## County.AreaMiami-Dade            1.34e-02   1.48e-01    0.09     0.93
## County.AreaOrange (Orlando)      1.33e-02   1.48e-01    0.09     0.93
## County.AreaPinellas (Tampa)     -2.49e-03   1.48e-01   -0.02     0.99
## County.AreaPortland             -3.16e-03   1.48e-01   -0.02     0.98
## County.AreaPortlandSub           4.85e-03   1.48e-01    0.03     0.97
## County.AreaSt. Lucie            -1.97e-03   1.48e-01   -0.01     0.99
## County.AreaStanly               -2.51e-02   1.49e-01   -0.17     0.87
## 
## Residual standard error: 1.03 on 1418 degrees of freedom
##   (4 observations deleted due to missingness)
## Multiple R-squared:  0.000526,   Adjusted R-squared:  -0.0115 
## F-statistic: 0.0439 on 17 and 1418 DF,  p-value: 1
SCtest(m2c)  # residuals still highly correlated over time (also true for time fixed effects)
## 
## Call:
## lm(formula = res[-n] ~ res[-1])
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -4.204 -0.442  0.096  0.631  3.209 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) -0.000117   0.024807     0.0        1    
## res[-1]     -0.390779   0.024317   -16.1   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.94 on 1433 degrees of freedom
## Multiple R-squared:  0.153,  Adjusted R-squared:  0.152 
## F-statistic:  258 on 1 and 1433 DF,  p-value: <2e-16

Using Panel Data Package to include lags

## Setting up data
pdata = plm.data(All, index = c("County.Area", "t"))

## Assuming same intercepts, no time effects, with lags

m1d = plm(TotalSTD ~ TMEANcm + lag(TotalSTD, 1) + lag(TotalSTD, 2) + lag(TotalSTD, 
    3), data = pdata)
summary(m1d)  #nonsig
## Oneway (individual) effect Within Model
## 
## Call:
## plm(formula = TotalSTD ~ TMEANcm + lag(TotalSTD, 1) + lag(TotalSTD, 
##     2) + lag(TotalSTD, 3), data = pdata)
## 
## Balanced Panel: n=15, T=93, N=1395
## 
## Residuals :
##    Min. 1st Qu.  Median 3rd Qu.    Max. 
## -3.0600 -0.5040 -0.0968  0.4090  3.5500 
## 
## Coefficients :
##                  Estimate Std. Error t-value Pr(>|t|)    
## TMEANcm           0.00380    0.00832    0.46    0.647    
## lag(TotalSTD, 1)  0.31154    0.02601   11.98   <2e-16 ***
## lag(TotalSTD, 2)  0.04847    0.02726    1.78    0.076 .  
## lag(TotalSTD, 3)  0.25618    0.02590    9.89   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    1250
## Residual Sum of Squares: 948
## R-Squared      :  0.191 
##       Adj. R-Squared :  0.188 
## F-statistic: 108.708 on 4 and 1376 DF, p-value: <2e-16
SCtest(m1d)  # no sig serial correlation!
## 
## Call:
## lm(formula = res[-n] ~ res[-1])
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -3.101 -0.505 -0.102  0.400  3.567 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)
## (Intercept) 6.62e-05   2.21e-02    0.00      1.0
## res[-1]     2.77e-02   2.68e-02    1.03      0.3
## 
## Residual standard error: 0.825 on 1392 degrees of freedom
## Multiple R-squared:  0.000768,   Adjusted R-squared:  4.99e-05 
## F-statistic: 1.07 on 1 and 1392 DF,  p-value: 0.301

m2d = plm(TotalSTD ~ PRECIPcm + lag(TotalSTD, 1) + lag(TotalSTD, 2) + lag(TotalSTD, 
    3), data = pdata)
summary(m2d)  #nonsig
## Oneway (individual) effect Within Model
## 
## Call:
## plm(formula = TotalSTD ~ PRECIPcm + lag(TotalSTD, 1) + lag(TotalSTD, 
##     2) + lag(TotalSTD, 3), data = pdata)
## 
## Balanced Panel: n=15, T=93, N=1395
## 
## Residuals :
##    Min. 1st Qu.  Median 3rd Qu.    Max. 
##  -3.070  -0.505  -0.100   0.411   3.540 
## 
## Coefficients :
##                  Estimate Std. Error t-value Pr(>|t|)    
## PRECIPcm         -0.00767    0.00898   -0.85     0.39    
## lag(TotalSTD, 1)  0.31173    0.02598   12.00   <2e-16 ***
## lag(TotalSTD, 2)  0.04767    0.02723    1.75     0.08 .  
## lag(TotalSTD, 3)  0.25695    0.02588    9.93   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    1250
## Residual Sum of Squares: 947
## R-Squared      :  0.191 
##       Adj. R-Squared :  0.188 
## F-statistic: 108.879 on 4 and 1376 DF, p-value: <2e-16
SCtest(m2d)  # no sig serial correlation!
## 
## Call:
## lm(formula = res[-n] ~ res[-1])
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -3.111 -0.510 -0.103  0.392  3.555 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)
## (Intercept) 7.67e-05   2.21e-02    0.00      1.0
## res[-1]     2.79e-02   2.68e-02    1.04      0.3
## 
## Residual standard error: 0.825 on 1392 degrees of freedom
## Multiple R-squared:  0.000779,   Adjusted R-squared:  6.15e-05 
## F-statistic: 1.09 on 1 and 1392 DF,  p-value: 0.298

## With quadratic time trends and County FE

m1e = plm(TotalSTD ~ TMEANcm + lag(TotalSTD, 1) + lag(TotalSTD, 2) + as.numeric(t) + 
    t2 + County.Area, data = pdata)
summary(m1e)  #nonsig
## Oneway (individual) effect Within Model
## 
## Call:
## plm(formula = TotalSTD ~ TMEANcm + lag(TotalSTD, 1) + lag(TotalSTD, 
##     2) + as.numeric(t) + t2 + County.Area, data = pdata)
## 
## Balanced Panel: n=15, T=94, N=1410
## 
## Residuals :
##    Min. 1st Qu.  Median 3rd Qu.    Max. 
##  -2.940  -0.509  -0.095   0.440   3.240 
## 
## Coefficients :
##                   Estimate Std. Error t-value Pr(>|t|)    
## TMEANcm           9.71e-03   8.61e-03    1.13  0.25959    
## lag(TotalSTD, 1)  3.30e-01   2.65e-02   12.44  < 2e-16 ***
## lag(TotalSTD, 2)  1.18e-01   2.64e-02    4.47  8.3e-06 ***
## as.numeric(t)    -1.70e-02   3.86e-03   -4.39  1.2e-05 ***
## t2                1.22e-04   3.49e-05    3.50  0.00047 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    1270
## Residual Sum of Squares: 999
## R-Squared      :  0.166 
##       Adj. R-Squared :  0.163 
## F-statistic: 74.1574 on 5 and 1390 DF, p-value: <2e-16
SCtest(m1e)  # non sig serial correlation!
## 
## Call:
## lm(formula = res[-n] ~ res[-1])
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -2.879 -0.507 -0.083  0.436  3.191 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)
## (Intercept)  0.000183   0.022432    0.01     0.99
## res[-1]     -0.037339   0.026645   -1.40     0.16
## 
## Residual standard error: 0.842 on 1407 degrees of freedom
## Multiple R-squared:  0.00139,    Adjusted R-squared:  0.000684 
## F-statistic: 1.96 on 1 and 1407 DF,  p-value: 0.161

m2e = plm(TotalSTD ~ PRECIPcm + lag(TotalSTD, 1) + lag(TotalSTD, 2) + as.numeric(t) + 
    t2 + County.Area, data = pdata)
summary(m2e)  #nonsig
## Oneway (individual) effect Within Model
## 
## Call:
## plm(formula = TotalSTD ~ PRECIPcm + lag(TotalSTD, 1) + lag(TotalSTD, 
##     2) + as.numeric(t) + t2 + County.Area, data = pdata)
## 
## Balanced Panel: n=15, T=94, N=1410
## 
## Residuals :
##    Min. 1st Qu.  Median 3rd Qu.    Max. 
## -2.9400 -0.5090 -0.0978  0.4300  3.2200 
## 
## Coefficients :
##                   Estimate Std. Error t-value Pr(>|t|)    
## PRECIPcm         -8.03e-03   9.04e-03   -0.89  0.37490    
## lag(TotalSTD, 1)  3.31e-01   2.65e-02   12.51  < 2e-16 ***
## lag(TotalSTD, 2)  1.18e-01   2.65e-02    4.45  9.4e-06 ***
## as.numeric(t)    -1.73e-02   3.86e-03   -4.48  8.2e-06 ***
## t2                1.26e-04   3.48e-05    3.63  0.00029 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    1270
## Residual Sum of Squares: 999
## R-Squared      :  0.165 
##       Adj. R-Squared :  0.163 
## F-statistic: 74.0349 on 5 and 1390 DF, p-value: <2e-16
SCtest(m2e)  # non sig serial correlation!
## 
## Call:
## lm(formula = res[-n] ~ res[-1])
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -2.883 -0.515 -0.084  0.438  3.172 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)
## (Intercept)  0.00021    0.02244    0.01     0.99
## res[-1]     -0.03761    0.02664   -1.41     0.16
## 
## Residual standard error: 0.842 on 1407 degrees of freedom
## Multiple R-squared:  0.00141,    Adjusted R-squared:  0.000704 
## F-statistic: 1.99 on 1 and 1407 DF,  p-value: 0.158

## With month*year and County FE

m1f = plm(TotalSTD ~ TMEANcm + lag(TotalSTD, 1) + lag(TotalSTD, 2), data = pdata, 
    model = "within", effect = "twoways")
summary(m1f)  #nonsig
## Twoways effects Within Model
## 
## Call:
## plm(formula = TotalSTD ~ TMEANcm + lag(TotalSTD, 1) + lag(TotalSTD, 
##     2), data = pdata, effect = "twoways", model = "within")
## 
## Balanced Panel: n=15, T=94, N=1410
## 
## Residuals :
##    Min. 1st Qu.  Median 3rd Qu.    Max. 
## -2.9600 -0.3660 -0.0263  0.3680  3.1700 
## 
## Coefficients :
##                  Estimate Std. Error t-value Pr(>|t|)    
## TMEANcm          -0.00342    0.00922   -0.37     0.71    
## lag(TotalSTD, 1)  0.50664    0.02739   18.50  < 2e-16 ***
## lag(TotalSTD, 2)  0.11431    0.02732    4.18  3.1e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    805
## Residual Sum of Squares: 528
## R-Squared      :  0.117 
##       Adj. R-Squared :  0.108 
## F-statistic: 226.785 on 3 and 1299 DF, p-value: <2e-16
SCtest(m1f)  # non sig serial correlation!
## 
## Call:
## lm(formula = res[-n] ~ res[-1])
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.9277 -0.3656 -0.0208  0.3668  3.1196 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)
## (Intercept)  0.000182   0.016317    0.01     0.99
## res[-1]     -0.017345   0.026668   -0.65     0.52
## 
## Residual standard error: 0.612 on 1407 degrees of freedom
## Multiple R-squared:  0.000301,   Adjusted R-squared:  -0.00041 
## F-statistic: 0.423 on 1 and 1407 DF,  p-value: 0.516

m2f = plm(TotalSTD ~ PRECIPcm + lag(TotalSTD, 1) + lag(TotalSTD, 2), data = pdata, 
    model = "within", effect = "twoways")
summary(m2f)  #nonsig
## Twoways effects Within Model
## 
## Call:
## plm(formula = TotalSTD ~ PRECIPcm + lag(TotalSTD, 1) + lag(TotalSTD, 
##     2), data = pdata, effect = "twoways", model = "within")
## 
## Balanced Panel: n=15, T=94, N=1410
## 
## Residuals :
##    Min. 1st Qu.  Median 3rd Qu.    Max. 
## -2.9600 -0.3660 -0.0239  0.3630  3.1600 
## 
## Coefficients :
##                  Estimate Std. Error t-value Pr(>|t|)    
## PRECIPcm         -0.00378    0.00789   -0.48     0.63    
## lag(TotalSTD, 1)  0.50631    0.02739   18.49   <2e-16 ***
## lag(TotalSTD, 2)  0.11444    0.02732    4.19    3e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    805
## Residual Sum of Squares: 528
## R-Squared      :  0.117 
##       Adj. R-Squared :  0.108 
## F-statistic: 226.832 on 3 and 1299 DF, p-value: <2e-16
SCtest(m2f)  # non sig serial correlation!
## 
## Call:
## lm(formula = res[-n] ~ res[-1])
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.9291 -0.3731 -0.0217  0.3661  3.1163 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)
## (Intercept)  0.000187   0.016316    0.01     0.99
## res[-1]     -0.016933   0.026668   -0.63     0.53
## 
## Residual standard error: 0.612 on 1407 degrees of freedom
## Multiple R-squared:  0.000286,   Adjusted R-squared:  -0.000424 
## F-statistic: 0.403 on 1 and 1407 DF,  p-value: 0.526

Creating levels for PRECIPcm and TMEANcm


## 5% and 1% cutoffs

quantile(All$PRECIPcm, prob = seq(0, 1, 0.01))
##      0%      1%      2%      3%      4%      5%      6%      7%      8% 
## -8.6523 -4.7344 -4.1146 -3.8667 -3.5444 -3.3875 -3.1439 -3.0478 -2.8607 
##      9%     10%     11%     12%     13%     14%     15%     16%     17% 
## -2.7571 -2.6600 -2.5512 -2.4222 -2.3270 -2.2248 -2.1191 -2.0487 -2.0122 
##     18%     19%     20%     21%     22%     23%     24%     25%     26% 
## -1.9600 -1.9018 -1.8073 -1.7343 -1.6851 -1.6331 -1.5585 -1.4926 -1.4576 
##     27%     28%     29%     30%     31%     32%     33%     34%     35% 
## -1.3902 -1.3409 -1.2957 -1.2358 -1.1956 -1.1425 -1.0950 -1.0245 -0.9778 
##     36%     37%     38%     39%     40%     41%     42%     43%     44% 
## -0.9321 -0.9020 -0.8346 -0.8074 -0.7730 -0.7456 -0.6787 -0.6189 -0.5804 
##     45%     46%     47%     48%     49%     50%     51%     52%     53% 
## -0.5369 -0.4993 -0.4538 -0.4199 -0.3837 -0.3253 -0.2881 -0.2600 -0.2062 
##     54%     55%     56%     57%     58%     59%     60%     61%     62% 
## -0.1782 -0.1278 -0.0844 -0.0150  0.0367  0.0609  0.1286  0.1807  0.2662 
##     63%     64%     65%     66%     67%     68%     69%     70%     71% 
##  0.3186  0.3892  0.4706  0.5272  0.6000  0.6499  0.6935  0.7322  0.8000 
##     72%     73%     74%     75%     76%     77%     78%     79%     80% 
##  0.8744  0.9220  1.0185  1.0931  1.1961  1.2418  1.3253  1.4133  1.5548 
##     81%     82%     83%     84%     85%     86%     87%     88%     89% 
##  1.6519  1.7522  1.8904  2.0319  2.1653  2.4457  2.6180  2.8578  3.0733 
##     90%     91%     92%     93%     94%     95%     96%     97%     98% 
##  3.2300  3.5273  3.7282  3.9515  4.3794  4.7647  5.2184  5.8109  7.0914 
##     99%    100% 
##  8.0644 12.9992
All$PRECIPlevels = cut(All$PRECIPcm, breaks = c(-10, -4.7344, -3.1439, 4.3794, 
    8.0644, 15), labels = c("Drought", "Dry", "Normal", "Wet", "Soaked"))
tally(~All$PRECIPlevels)
## 
## Drought     Dry  Normal     Wet  Soaked 
##      15      72    1266      71      16

quantile(All$TMEANcm, prob = seq(0, 1, 0.01))
##       0%       1%       2%       3%       4%       5%       6%       7% 
## -12.1000  -7.5205  -6.0098  -5.5222  -4.6268  -4.3008  -3.9915  -3.6944 
##       8%       9%      10%      11%      12%      13%      14%      15% 
##  -3.5312  -3.2184  -3.0846  -2.8779  -2.7036  -2.5992  -2.4765  -2.3754 
##      16%      17%      18%      19%      20%      21%      22%      23% 
##  -2.2778  -2.1330  -2.0375  -1.8954  -1.8144  -1.6889  -1.6117  -1.5335 
##      24%      25%      26%      27%      28%      29%      30%      31% 
##  -1.4768  -1.4111  -1.3383  -1.2667  -1.1875  -1.1375  -1.0821  -1.0384 
##      32%      33%      34%      35%      36%      37%      38%      39% 
##  -0.9685  -0.8667  -0.7903  -0.7385  -0.6846  -0.6556  -0.5778  -0.5000 
##      40%      41%      42%      43%      44%      45%      46%      47% 
##  -0.4515  -0.4154  -0.3692  -0.3398  -0.2778  -0.2538  -0.2000  -0.1538 
##      48%      49%      50%      51%      52%      53%      54%      55% 
##  -0.0778  -0.0359   0.0226   0.0923   0.1333   0.1750   0.2158   0.3111 
##      56%      57%      58%      59%      60%      61%      62%      63% 
##   0.3623   0.4470   0.5154   0.5778   0.6250   0.6733   0.7552   0.8615 
##      64%      65%      66%      67%      68%      69%      70%      71% 
##   0.9370   1.0237   1.0615   1.1261   1.1685   1.2608   1.3250   1.4000 
##      72%      73%      74%      75%      76%      77%      78%      79% 
##   1.4224   1.5277   1.5871   1.7000   1.7615   1.8308   1.9318   2.0229 
##      80%      81%      82%      83%      84%      85%      86%      87% 
##   2.1292   2.2333   2.3384   2.4625   2.5366   2.6769   2.7625   2.9492 
##      88%      89%      90%      91%      92%      93%      94%      95% 
##   3.1222   3.3222   3.4000   3.5311   3.6330   3.7270   3.8974   4.1457 
##      96%      97%      98%      99%     100% 
##   4.5399   4.8571   5.2619   6.2111   9.3625
All$TMEANlevels = cut(All$TMEANcm, breaks = c(-16, -7.5205, -3.9915, 3.8974, 
    6.2111, 16), labels = c("Freezing", "Cold", "Normal", "Warm", "Hot"))
tally(~All$TMEANlevels)
## 
## Freezing     Cold   Normal     Warm      Hot 
##       15       72     1266       71       16

## Setting ref levels to Normal
All = within(All, PRECIPlevels <- relevel(PRECIPlevels, ref = "Normal"))
All = within(All, TMEANlevels <- relevel(TMEANlevels, ref = "Normal"))

## Validating choice of levels
table(All$PRECIPlevels, All$County.Area)
##          
##           Bar Harbor Camden Carteret Durham Duval (Jacksonville)
##   Normal          85     84       83     92                   87
##   Drought          0      0        0      0                    0
##   Dry              4      6        7      3                    3
##   Wet              6      4        6      1                    6
##   Soaked           1      2        0      0                    0
##          
##           Leon (Tallahassee) Lewiston LewistonSub Miami-Dade
##   Normal                  81       88          88         83
##   Drought                  2        0           0          4
##   Dry                      6        2           2          4
##   Wet                      7        6           6          4
##   Soaked                   0        0           0          1
##          
##           Orange (Orlando) Pinellas (Tampa) Portland PortlandSub St. Lucie
##   Normal                78               77       88          88        75
##   Drought                4                5        0           0         0
##   Dry                    8                4        3           3        12
##   Wet                    3                6        4           4         6
##   Soaked                 3                4        1           1         3
##          
##           Stanly
##   Normal      89
##   Drought      0
##   Dry          5
##   Wet          2
##   Soaked       0
table(All$PRECIPlevels, All$Year)
##          
##           2004 2005 2006 2007 2008 2009 2010 2011 2012
##   Normal    91  153  157  161  149  157  158  169   71
##   Drought    0    1    2    3    1    3    3    2    0
##   Dry        8    6   12   13   11    7   10    5    0
##   Wet        5   15    8    3   17   12    7    1    3
##   Soaked     1    5    1    0    2    1    2    3    1
# Drought rare, but not dry. Both sig so all good!

MLS OLS regressions with levels

## assuming same intercepts, no time effects

m1g = lm(TotalSTD ~ TMEANlevels, data = All)
summary(m1g)  # sig
## 
## Call:
## lm(formula = TotalSTD ~ TMEANlevels, data = All)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -2.932 -0.711 -0.086  0.603  3.609 
## 
## Coefficients:
##                     Estimate Std. Error t value Pr(>|t|)    
## (Intercept)           0.1882     0.0272    6.91  7.3e-12 ***
## TMEANlevelsFreezing  -0.5886     0.2517   -2.34   0.0195 *  
## TMEANlevelsCold      -0.2619     0.1174   -2.23   0.0259 *  
## TMEANlevelsWarm      -0.0083     0.1182   -0.07   0.9440    
## TMEANlevelsHot       -0.6780     0.2438   -2.78   0.0055 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.969 on 1435 degrees of freedom
## Multiple R-squared:  0.012,  Adjusted R-squared:  0.00929 
## F-statistic: 4.37 on 4 and 1435 DF,  p-value: 0.00162
SCtest(m1g)  # highly serially correlated
## 
## Call:
## lm(formula = res[-n] ~ res[-1])
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -3.112 -0.574 -0.078  0.467  3.527 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 0.000464   0.022884    0.02     0.98    
## res[-1]     0.442981   0.023645   18.73   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.868 on 1437 degrees of freedom
## Multiple R-squared:  0.196,  Adjusted R-squared:  0.196 
## F-statistic:  351 on 1 and 1437 DF,  p-value: <2e-16

m2g = lm(TotalSTD ~ PRECIPlevels, data = All)
summary(m2g)  # sig
## 
## Call:
## lm(formula = TotalSTD ~ PRECIPlevels, data = All)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -2.923 -0.727 -0.082  0.605  3.617 
## 
## Coefficients:
##                     Estimate Std. Error t value Pr(>|t|)    
## (Intercept)           0.1798     0.0274    6.57    7e-11 ***
## PRECIPlevelsDrought  -0.1162     0.2528   -0.46    0.646    
## PRECIPlevelsDry      -0.2272     0.1179   -1.93    0.054 .  
## PRECIPlevelsWet      -0.0875     0.1187   -0.74    0.461    
## PRECIPlevelsSoaked   -0.1683     0.2449   -0.69    0.492    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.973 on 1435 degrees of freedom
## Multiple R-squared:  0.00323,    Adjusted R-squared:  0.000454 
## F-statistic: 1.16 on 4 and 1435 DF,  p-value: 0.325
SCtest(m2g)  # highly serially correlated
## 
## Call:
## lm(formula = res[-n] ~ res[-1])
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -3.187 -0.588 -0.080  0.471  3.530 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 0.000488   0.022881    0.02     0.98    
## res[-1]     0.451155   0.023538   19.17   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.868 on 1437 degrees of freedom
## Multiple R-squared:  0.204,  Adjusted R-squared:  0.203 
## F-statistic:  367 on 1 and 1437 DF,  p-value: <2e-16

## 1st differences model with quadratic time trends and County FE

m1h = lm(dTotalSTD ~ TMEANlevels + t + t2 + County.Area, data = All)
summary(m1h)  # sig
## 
## Call:
## lm(formula = dTotalSTD ~ TMEANlevels + t + t2 + County.Area, 
##     data = All)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -4.259 -0.473 -0.018  0.564  3.362 
## 
## Coefficients:
##                                  Estimate Std. Error t value Pr(>|t|)  
## (Intercept)                      4.39e-02   1.41e-01    0.31    0.756  
## TMEANlevelsFreezing             -1.21e-01   2.68e-01   -0.45    0.652  
## TMEANlevelsCold                  1.18e-01   1.24e-01    0.95    0.341  
## TMEANlevelsWarm                  3.09e-01   1.25e-01    2.47    0.014 *
## TMEANlevelsHot                  -3.95e-01   2.61e-01   -1.51    0.131  
## t                               -3.57e-03   4.30e-03   -0.83    0.406  
## t2                               3.59e-05   3.98e-05    0.90    0.368  
## County.AreaCamden               -1.08e-02   1.48e-01   -0.07    0.942  
## County.AreaCarteret             -1.06e-02   1.48e-01   -0.07    0.943  
## County.AreaDurham               -1.12e-02   1.48e-01   -0.08    0.940  
## County.AreaDuval (Jacksonville)  5.90e-03   1.48e-01    0.04    0.968  
## County.AreaLeon (Tallahassee)    1.56e-03   1.48e-01    0.01    0.992  
## County.AreaLewiston              1.30e-02   1.48e-01    0.09    0.930  
## County.AreaLewistonSub           1.66e-02   1.48e-01    0.11    0.910  
## County.AreaMiami-Dade            2.18e-02   1.48e-01    0.15    0.883  
## County.AreaOrange (Orlando)      1.81e-02   1.48e-01    0.12    0.903  
## County.AreaPinellas (Tampa)     -8.89e-03   1.48e-01   -0.06    0.952  
## County.AreaPortland              2.71e-03   1.48e-01    0.02    0.985  
## County.AreaPortlandSub           1.07e-02   1.48e-01    0.07    0.942  
## County.AreaSt. Lucie             4.15e-03   1.48e-01    0.03    0.978  
## County.AreaStanly               -2.53e-02   1.48e-01   -0.17    0.864  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.02 on 1415 degrees of freedom
##   (4 observations deleted due to missingness)
## Multiple R-squared:  0.00707,    Adjusted R-squared:  -0.00696 
## F-statistic: 0.504 on 20 and 1415 DF,  p-value: 0.966
SCtest(m1h)  # residuals still highly correlated over time
## 
## Call:
## lm(formula = res[-n] ~ res[-1])
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -4.196 -0.440  0.098  0.619  3.193 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) -0.000113   0.024745       0        1    
## res[-1]     -0.389070   0.024336     -16   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.937 on 1433 degrees of freedom
## Multiple R-squared:  0.151,  Adjusted R-squared:  0.151 
## F-statistic:  256 on 1 and 1433 DF,  p-value: <2e-16

m2h = lm(dTotalSTD ~ PRECIPlevels + t + t2 + County.Area, data = All)
summary(m2h)  # sig
## 
## Call:
## lm(formula = dTotalSTD ~ PRECIPlevels + t + t2 + County.Area, 
##     data = All)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -4.277 -0.475 -0.019  0.540  3.413 
## 
## Coefficients:
##                                  Estimate Std. Error t value Pr(>|t|)  
## (Intercept)                      5.43e-02   1.42e-01    0.38    0.701  
## PRECIPlevelsDrought             -2.86e-01   2.71e-01   -1.06    0.291  
## PRECIPlevelsDry                 -2.63e-01   1.26e-01   -2.10    0.036 *
## PRECIPlevelsWet                 -5.94e-02   1.26e-01   -0.47    0.637  
## PRECIPlevelsSoaked              -9.43e-02   2.60e-01   -0.36    0.717  
## t                               -1.95e-03   4.29e-03   -0.45    0.650  
## t2                               1.87e-05   3.97e-05    0.47    0.638  
## County.AreaCamden                1.87e-03   1.48e-01    0.01    0.990  
## County.AreaCarteret             -1.02e-02   1.48e-01   -0.07    0.945  
## County.AreaDurham               -1.59e-02   1.49e-01   -0.11    0.915  
## County.AreaDuval (Jacksonville) -1.89e-03   1.48e-01   -0.01    0.990  
## County.AreaLeon (Tallahassee)    5.67e-03   1.48e-01    0.04    0.969  
## County.AreaLewiston             -8.16e-03   1.48e-01   -0.06    0.956  
## County.AreaLewistonSub          -4.50e-03   1.48e-01   -0.03    0.976  
## County.AreaMiami-Dade            2.52e-02   1.48e-01    0.17    0.865  
## County.AreaOrange (Orlando)      3.70e-02   1.49e-01    0.25    0.804  
## County.AreaPinellas (Tampa)      1.57e-02   1.49e-01    0.11    0.916  
## County.AreaPortland             -6.62e-03   1.48e-01   -0.04    0.964  
## County.AreaPortlandSub           1.39e-03   1.48e-01    0.01    0.992  
## County.AreaSt. Lucie             2.27e-02   1.48e-01    0.15    0.878  
## County.AreaStanly               -2.51e-02   1.49e-01   -0.17    0.866  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.03 on 1415 degrees of freedom
##   (4 observations deleted due to missingness)
## Multiple R-squared:  0.00428,    Adjusted R-squared:  -0.0098 
## F-statistic: 0.304 on 20 and 1415 DF,  p-value: 0.999
SCtest(m2h)  # residuals still highly correlated over time
## 
## Call:
## lm(formula = res[-n] ~ res[-1])
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -4.221 -0.421  0.094  0.621  3.224 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) -0.000127   0.024725   -0.01        1    
## res[-1]     -0.393889   0.024282  -16.22   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.937 on 1433 degrees of freedom
## Multiple R-squared:  0.155,  Adjusted R-squared:  0.155 
## F-statistic:  263 on 1 and 1433 DF,  p-value: <2e-16

Reg on levels with lags

## Setting up data
pdata = plm.data(All, index = c("County.Area", "t"))

## Assuming same intercepts, no time effects, with lags

m1i = plm(TotalSTD ~ TMEANlevels + lag(TotalSTD, 1) + lag(TotalSTD, 2) + lag(TotalSTD, 
    3), data = pdata)
summary(m1i)  #sig
## Oneway (individual) effect Within Model
## 
## Call:
## plm(formula = TotalSTD ~ TMEANlevels + lag(TotalSTD, 1) + lag(TotalSTD, 
##     2) + lag(TotalSTD, 3), data = pdata)
## 
## Balanced Panel: n=15, T=93, N=1395
## 
## Residuals :
##    Min. 1st Qu.  Median 3rd Qu.    Max. 
## -3.0600 -0.5010 -0.0966  0.4210  3.5400 
## 
## Coefficients :
##                     Estimate Std. Error t-value Pr(>|t|)    
## TMEANlevelsFreezing  -0.3527     0.2167   -1.63   0.1039    
## TMEANlevelsCold      -0.0548     0.1022   -0.54   0.5921    
## TMEANlevelsWarm       0.1115     0.1015    1.10   0.2720    
## TMEANlevelsHot       -0.5805     0.2103   -2.76   0.0059 ** 
## lag(TotalSTD, 1)      0.3117     0.0260   11.98   <2e-16 ***
## lag(TotalSTD, 2)      0.0396     0.0273    1.45   0.1471    
## lag(TotalSTD, 3)      0.2611     0.0259   10.08   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    1250
## Residual Sum of Squares: 940
## R-Squared      :  0.197 
##       Adj. R-Squared :  0.194 
## F-statistic: 64.184 on 7 and 1373 DF, p-value: <2e-16
SCtest(m1i)  # no sig serial correlation!
## 
## Call:
## lm(formula = res[-n] ~ res[-1])
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -3.105 -0.506 -0.106  0.411  3.555 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)
## (Intercept) 7.14e-05   2.20e-02    0.00     1.00
## res[-1]     3.00e-02   2.68e-02    1.12     0.26
## 
## Residual standard error: 0.821 on 1392 degrees of freedom
## Multiple R-squared:  0.0009, Adjusted R-squared:  0.000182 
## F-statistic: 1.25 on 1 and 1392 DF,  p-value: 0.263
xyplot(m1i$residuals ~ fitted(m1i))  # not terrible

plot of chunk unnamed-chunk-10

qqPlot(m1i$residuals)  # not great

plot of chunk unnamed-chunk-10


m2i = plm(TotalSTD ~ PRECIPlevels + lag(TotalSTD, 1) + lag(TotalSTD, 2) + lag(TotalSTD, 
    3), data = pdata)
summary(m2i)  #sig
## Oneway (individual) effect Within Model
## 
## Call:
## plm(formula = TotalSTD ~ PRECIPlevels + lag(TotalSTD, 1) + lag(TotalSTD, 
##     2) + lag(TotalSTD, 3), data = pdata)
## 
## Balanced Panel: n=15, T=93, N=1395
## 
## Residuals :
##    Min. 1st Qu.  Median 3rd Qu.    Max. 
## -3.0900 -0.4800 -0.0975  0.4140  3.5200 
## 
## Coefficients :
##                     Estimate Std. Error t-value Pr(>|t|)    
## PRECIPlevelsDrought  -0.4188     0.2185   -1.92   0.0555 .  
## PRECIPlevelsDry      -0.3185     0.1024   -3.11   0.0019 ** 
## PRECIPlevelsWet      -0.0956     0.1049   -0.91   0.3623    
## PRECIPlevelsSoaked   -0.2894     0.2170   -1.33   0.1825    
## lag(TotalSTD, 1)      0.3074     0.0259   11.86   <2e-16 ***
## lag(TotalSTD, 2)      0.0531     0.0272    1.95   0.0509 .  
## lag(TotalSTD, 3)      0.2577     0.0258   10.00   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    1250
## Residual Sum of Squares: 938
## R-Squared      :  0.198 
##       Adj. R-Squared :  0.195 
## F-statistic: 64.7304 on 7 and 1373 DF, p-value: <2e-16
SCtest(m2i)  # no sig serial correlation!
## 
## Call:
## lm(formula = res[-n] ~ res[-1])
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -3.122 -0.489 -0.098  0.405  3.537 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)
## (Intercept) 8.46e-05   2.20e-02    0.00     1.00
## res[-1]     2.04e-02   2.68e-02    0.76     0.45
## 
## Residual standard error: 0.821 on 1392 degrees of freedom
## Multiple R-squared:  0.000415,   Adjusted R-squared:  -0.000303 
## F-statistic: 0.578 on 1 and 1392 DF,  p-value: 0.447
xyplot(m2i$residuals ~ fitted(m2i))  # not bad

plot of chunk unnamed-chunk-10

qqPlot(m2i$residuals)  # not great

plot of chunk unnamed-chunk-10


## With quadratic time trends and County FE

m1j = plm(TotalSTD ~ TMEANlevels + lag(TotalSTD, 1) + lag(TotalSTD, 2) + as.numeric(t) + 
    t2, data = pdata, effect = "individual", model = "within")
summary(m1j)  #sig!
## Oneway (individual) effect Within Model
## 
## Call:
## plm(formula = TotalSTD ~ TMEANlevels + lag(TotalSTD, 1) + lag(TotalSTD, 
##     2) + as.numeric(t) + t2, data = pdata, effect = "individual", 
##     model = "within")
## 
## Balanced Panel: n=15, T=94, N=1410
## 
## Residuals :
##    Min. 1st Qu.  Median 3rd Qu.    Max. 
## -2.9300 -0.5150 -0.0956  0.4490  3.2200 
## 
## Coefficients :
##                      Estimate Std. Error t-value Pr(>|t|)    
## TMEANlevelsFreezing -0.384375   0.221902   -1.73    0.083 .  
## TMEANlevelsCold     -0.081522   0.103913   -0.78    0.433    
## TMEANlevelsWarm      0.150719   0.103774    1.45    0.147    
## TMEANlevelsHot      -0.440112   0.216112   -2.04    0.042 *  
## lag(TotalSTD, 1)     0.331735   0.026546   12.50  < 2e-16 ***
## lag(TotalSTD, 2)     0.111190   0.026481    4.20  2.9e-05 ***
## as.numeric(t)       -0.018233   0.003869   -4.71  2.7e-06 ***
## t2                   0.000137   0.000035    3.91  9.7e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    1270
## Residual Sum of Squares: 993
## R-Squared      :  0.17 
##       Adj. R-Squared :  0.168 
## F-statistic: 47.6381 on 8 and 1387 DF, p-value: <2e-16
SCtest(m1j)  # non sig serial correlation!
## 
## Call:
## lm(formula = res[-n] ~ res[-1])
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -2.878 -0.521 -0.084  0.451  3.170 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)
## (Intercept)  0.00022    0.02236    0.01     0.99
## res[-1]     -0.03764    0.02664   -1.41     0.16
## 
## Residual standard error: 0.839 on 1407 degrees of freedom
## Multiple R-squared:  0.00142,    Adjusted R-squared:  0.000707 
## F-statistic:    2 on 1 and 1407 DF,  p-value: 0.158
xyplot(m1j$residuals ~ fitted(m1j))  # not bad

plot of chunk unnamed-chunk-10

qqPlot(m1j$residuals)  # not great

plot of chunk unnamed-chunk-10


m2j = plm(TotalSTD ~ PRECIPlevels + lag(TotalSTD, 1) + lag(TotalSTD, 2) + lag(TotalSTD, 
    3) + as.numeric(t) + t2, data = pdata, effect = "individual", model = "within")
summary(m2j)  #sig
## Oneway (individual) effect Within Model
## 
## Call:
## plm(formula = TotalSTD ~ PRECIPlevels + lag(TotalSTD, 1) + lag(TotalSTD, 
##     2) + lag(TotalSTD, 3) + as.numeric(t) + t2, data = pdata, 
##     effect = "individual", model = "within")
## 
## Balanced Panel: n=15, T=93, N=1395
## 
## Residuals :
##    Min. 1st Qu.  Median 3rd Qu.    Max. 
## -2.9800 -0.4780 -0.0833  0.4010  3.2700 
## 
## Coefficients :
##                      Estimate Std. Error t-value Pr(>|t|)    
## PRECIPlevelsDrought -3.78e-01   2.17e-01   -1.74  0.08253 .  
## PRECIPlevelsDry     -3.21e-01   1.02e-01   -3.15  0.00167 ** 
## PRECIPlevelsWet     -9.31e-02   1.04e-01   -0.89  0.37239    
## PRECIPlevelsSoaked  -3.00e-01   2.16e-01   -1.39  0.16458    
## lag(TotalSTD, 1)     2.90e-01   2.60e-02   11.15  < 2e-16 ***
## lag(TotalSTD, 2)     4.02e-02   2.71e-02    1.48  0.13842    
## lag(TotalSTD, 3)     2.40e-01   2.59e-02    9.27  < 2e-16 ***
## as.numeric(t)       -1.51e-02   3.89e-03   -3.88  0.00011 ***
## t2                   1.14e-04   3.48e-05    3.27  0.00111 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    1250
## Residual Sum of Squares: 924
## R-Squared      :  0.209 
##       Adj. R-Squared :  0.206 
## F-statistic: 53.3225 on 9 and 1371 DF, p-value: <2e-16
SCtest(m2j)  # non sig serial correlation!
## 
## Call:
## lm(formula = res[-n] ~ res[-1])
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -3.015 -0.481 -0.080  0.404  3.281 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.000114   0.021817    0.01      1.0
## res[-1]     0.018204   0.026798    0.68      0.5
## 
## Residual standard error: 0.815 on 1392 degrees of freedom
## Multiple R-squared:  0.000331,   Adjusted R-squared:  -0.000387 
## F-statistic: 0.461 on 1 and 1392 DF,  p-value: 0.497
xyplot(m2j$residuals ~ fitted(m2j))  # not bad

plot of chunk unnamed-chunk-10

qqPlot(m2j$residuals)  # bad

plot of chunk unnamed-chunk-10


## With month*year and County FE

m1k = plm(TotalSTD ~ TMEANlevels + lag(TotalSTD, 1) + lag(TotalSTD, 2), data = pdata, 
    model = "within", effect = "twoways")
summary(m1k)  #nonsig
## Twoways effects Within Model
## 
## Call:
## plm(formula = TotalSTD ~ TMEANlevels + lag(TotalSTD, 1) + lag(TotalSTD, 
##     2), data = pdata, effect = "twoways", model = "within")
## 
## Balanced Panel: n=15, T=94, N=1410
## 
## Residuals :
##    Min. 1st Qu.  Median 3rd Qu.    Max. 
## -2.9600 -0.3710 -0.0238  0.3620  3.1600 
## 
## Coefficients :
##                     Estimate Std. Error t-value Pr(>|t|)    
## TMEANlevelsFreezing   0.1831     0.2309    0.79     0.43    
## TMEANlevelsCold      -0.0551     0.0958   -0.58     0.57    
## TMEANlevelsWarm       0.0157     0.0996    0.16     0.87    
## TMEANlevelsHot       -0.2905     0.1930   -1.50     0.13    
## lag(TotalSTD, 1)      0.5056     0.0274   18.43  < 2e-16 ***
## lag(TotalSTD, 2)      0.1137     0.0275    4.14  3.7e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    805
## Residual Sum of Squares: 527
## R-Squared      :  0.118 
##       Adj. R-Squared :  0.109 
## F-statistic: 113.963 on 6 and 1296 DF, p-value: <2e-16
SCtest(m1k)  # non sig serial correlation!
## 
## Call:
## lm(formula = res[-n] ~ res[-1])
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.9206 -0.3698 -0.0207  0.3612  3.1089 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)
## (Intercept)  0.000179   0.016296    0.01     0.99
## res[-1]     -0.018690   0.026667   -0.70     0.48
## 
## Residual standard error: 0.612 on 1407 degrees of freedom
## Multiple R-squared:  0.000349,   Adjusted R-squared:  -0.000361 
## F-statistic: 0.491 on 1 and 1407 DF,  p-value: 0.483

m2k = plm(TotalSTD ~ PRECIPlevels + lag(TotalSTD, 1) + lag(TotalSTD, 2), data = pdata, 
    model = "within", effect = "twoways")
summary(m2k)  #sig!
## Twoways effects Within Model
## 
## Call:
## plm(formula = TotalSTD ~ PRECIPlevels + lag(TotalSTD, 1) + lag(TotalSTD, 
##     2), data = pdata, effect = "twoways", model = "within")
## 
## Balanced Panel: n=15, T=94, N=1410
## 
## Residuals :
##    Min. 1st Qu.  Median 3rd Qu.    Max. 
## -2.9800 -0.3550 -0.0203  0.3630  3.1800 
## 
## Coefficients :
##                     Estimate Std. Error t-value Pr(>|t|)    
## PRECIPlevelsDrought  -0.4060     0.1767   -2.30  0.02173 *  
## PRECIPlevelsDry      -0.3279     0.0847   -3.87  0.00011 ***
## PRECIPlevelsWet      -0.1273     0.0848   -1.50  0.13338    
## PRECIPlevelsSoaked   -0.1111     0.1696   -0.66  0.51234    
## lag(TotalSTD, 1)      0.4979     0.0274   18.20  < 2e-16 ***
## lag(TotalSTD, 2)      0.1196     0.0272    4.39  1.2e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    805
## Residual Sum of Squares: 520
## R-Squared      :  0.123 
##       Adj. R-Squared :  0.113 
## F-statistic: 118.395 on 6 and 1296 DF, p-value: <2e-16
SCtest(m2k)  # non sig serial correlation!
## 
## Call:
## lm(formula = res[-n] ~ res[-1])
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.9330 -0.3610 -0.0193  0.3728  3.1009 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)
## (Intercept)  0.000183   0.016184    0.01     0.99
## res[-1]     -0.026655   0.026661   -1.00     0.32
## 
## Residual standard error: 0.608 on 1407 degrees of freedom
## Multiple R-squared:  0.00071,    Adjusted R-squared:  -3.2e-07 
## F-statistic:    1 on 1 and 1407 DF,  p-value: 0.318
xyplot(m2k$residuals ~ fitted(m2k))  # not bad

plot of chunk unnamed-chunk-10

qqPlot(m2k$residuals)  # not bad

plot of chunk unnamed-chunk-10


m3k = plm(TotalSTD ~ PRECIPlevels + TMEANlevels + lag(TotalSTD, 1) + lag(TotalSTD, 
    2) + lag(TotalSTD, 3) + factor(t) + County.Area, data = pdata)
summary(m3k)  # sig!
## Oneway (individual) effect Within Model
## 
## Call:
## plm(formula = TotalSTD ~ PRECIPlevels + TMEANlevels + lag(TotalSTD, 
##     1) + lag(TotalSTD, 2) + lag(TotalSTD, 3) + factor(t) + County.Area, 
##     data = pdata)
## 
## Balanced Panel: n=15, T=93, N=1395
## 
## Residuals :
##    Min. 1st Qu.  Median 3rd Qu.    Max. 
## -3.0000 -0.3510 -0.0197  0.3540  3.1800 
## 
## Coefficients :
##                     Estimate Std. Error t-value Pr(>|t|)    
## PRECIPlevelsDrought -0.45187    0.17667   -2.56  0.01065 *  
## PRECIPlevelsDry     -0.35976    0.08539   -4.21  2.7e-05 ***
## PRECIPlevelsWet     -0.13430    0.08656   -1.55  0.12103    
## PRECIPlevelsSoaked  -0.10836    0.17484   -0.62  0.53553    
## TMEANlevelsFreezing  0.17014    0.22914    0.74  0.45792    
## TMEANlevelsCold     -0.06191    0.09598   -0.64  0.51907    
## TMEANlevelsWarm      0.01719    0.09872    0.17  0.86179    
## TMEANlevelsHot      -0.35851    0.19236   -1.86  0.06258 .  
## lag(TotalSTD, 1)     0.47567    0.02778   17.12  < 2e-16 ***
## lag(TotalSTD, 2)     0.06622    0.03080    2.15  0.03177 *  
## lag(TotalSTD, 3)     0.10068    0.02770    3.63  0.00029 ***
## factor(t)9           0.43747    0.23169    1.89  0.05922 .  
## factor(t)10          0.33785    0.23142    1.46  0.14457    
## factor(t)11          1.36380    0.23159    5.89  5.0e-09 ***
## factor(t)12         -0.86549    0.23376   -3.70  0.00022 ***
## factor(t)13          0.05549    0.23640    0.23  0.81445    
## factor(t)14          1.19922    0.23572    5.09  4.2e-07 ***
## factor(t)15          0.28414    0.23458    1.21  0.22601    
## factor(t)16          0.63807    0.23780    2.68  0.00739 ** 
## factor(t)17          0.44348    0.23146    1.92  0.05559 .  
## factor(t)18          0.01224    0.23181    0.05  0.95791    
## factor(t)19          0.36565    0.23208    1.58  0.11539    
## factor(t)20          0.14594    0.23182    0.63  0.52913    
## factor(t)21         -0.16077    0.23472   -0.68  0.49350    
## factor(t)22          0.07234    0.23151    0.31  0.75473    
## factor(t)23          2.01393    0.23472    8.58  < 2e-16 ***
## factor(t)24         -0.90113    0.24690   -3.65  0.00027 ***
## factor(t)25         -0.16949    0.23938   -0.71  0.47906    
## factor(t)26          0.78053    0.23621    3.30  0.00098 ***
## factor(t)27          0.15819    0.23350    0.68  0.49823    
## factor(t)28          0.26325    0.23390    1.13  0.26060    
## factor(t)29          1.02863    0.23238    4.43  1.0e-05 ***
## factor(t)30          0.28599    0.23343    1.23  0.22073    
## factor(t)31          0.45908    0.23303    1.97  0.04905 *  
## factor(t)32          0.09834    0.23154    0.42  0.67112    
## factor(t)33          0.12863    0.23124    0.56  0.57812    
## factor(t)34         -0.15625    0.23846   -0.66  0.51243    
## factor(t)35          1.46363    0.24028    6.09  1.5e-09 ***
## factor(t)36         -0.63280    0.23484   -2.69  0.00714 ** 
## factor(t)37         -0.19053    0.23774   -0.80  0.42303    
## factor(t)38          0.70878    0.23357    3.03  0.00246 ** 
## factor(t)39          0.02421    0.23365    0.10  0.91751    
## factor(t)40          0.39594    0.23303    1.70  0.08954 .  
## factor(t)41          0.78983    0.23163    3.41  0.00067 ***
## factor(t)42          0.17023    0.23444    0.73  0.46790    
## factor(t)43          0.62446    0.23238    2.69  0.00730 ** 
## factor(t)44         -0.16386    0.23373   -0.70  0.48338    
## factor(t)45          0.15294    0.23208    0.66  0.51002    
## factor(t)46         -0.00156    0.23705   -0.01  0.99474    
## factor(t)47          1.23485    0.23346    5.29  1.4e-07 ***
## factor(t)48         -0.72884    0.23437   -3.11  0.00191 ** 
## factor(t)49         -0.35399    0.23530   -1.50  0.13272    
## factor(t)50          0.54198    0.23376    2.32  0.02058 *  
## factor(t)51          0.11073    0.23318    0.47  0.63495    
## factor(t)52          0.43810    0.23512    1.86  0.06265 .  
## factor(t)53          0.74169    0.23178    3.20  0.00141 ** 
## factor(t)54          0.12878    0.23410    0.55  0.58236    
## factor(t)55          0.28107    0.23303    1.21  0.22798    
## factor(t)56         -0.05608    0.23305   -0.24  0.80986    
## factor(t)57         -0.25522    0.23263   -1.10  0.27280    
## factor(t)58         -0.49827    0.23181   -2.15  0.03178 *  
## factor(t)59          1.20311    0.23275    5.17  2.7e-07 ***
## factor(t)60         -1.08532    0.23718   -4.58  5.2e-06 ***
## factor(t)61         -0.38853    0.23784   -1.63  0.10259    
## factor(t)62          0.12567    0.23554    0.53  0.59376    
## factor(t)63         -0.09812    0.23603   -0.42  0.67768    
## factor(t)64          0.09998    0.23482    0.43  0.67033    
## factor(t)65          0.45858    0.23389    1.96  0.05013 .  
## factor(t)66          0.28682    0.23760    1.21  0.22760    
## factor(t)67          0.29936    0.23290    1.29  0.19891    
## factor(t)68         -0.01781    0.23185   -0.08  0.93877    
## factor(t)69         -0.29882    0.23197   -1.29  0.19791    
## factor(t)70         -0.29194    0.23247   -1.26  0.20941    
## factor(t)71          1.06875    0.24060    4.44  9.7e-06 ***
## factor(t)72         -1.10950    0.23987   -4.63  4.1e-06 ***
## factor(t)73         -0.21735    0.24019   -0.90  0.36568    
## factor(t)74          0.54687    0.23727    2.30  0.02134 *  
## factor(t)75          0.04309    0.23540    0.18  0.85479    
## factor(t)76          0.09468    0.23530    0.40  0.68748    
## factor(t)77          0.60918    0.23238    2.62  0.00886 ** 
## factor(t)78         -0.01337    0.23311   -0.06  0.95429    
## factor(t)79          0.30717    0.23333    1.32  0.18826    
## factor(t)80          0.03005    0.23189    0.13  0.89693    
## factor(t)81         -0.11861    0.23184   -0.51  0.60901    
## factor(t)82         -0.28538    0.26821   -1.06  0.28752    
## factor(t)83          1.55077    0.23420    6.62  5.2e-11 ***
## factor(t)84         -1.15969    0.23587   -4.92  9.9e-07 ***
## factor(t)85         -0.15274    0.23839   -0.64  0.52182    
## factor(t)86          0.65533    0.23565    2.78  0.00550 ** 
## factor(t)87          0.06248    0.23465    0.27  0.79008    
## factor(t)88          0.15251    0.23397    0.65  0.51462    
## factor(t)89          0.74056    0.23147    3.20  0.00141 ** 
## factor(t)90          0.21359    0.23326    0.92  0.36002    
## factor(t)91          0.27171    0.23229    1.17  0.24235    
## factor(t)92          0.21425    0.23156    0.93  0.35502    
## factor(t)93         -0.14224    0.23132   -0.61  0.53872    
## factor(t)94          0.10611    0.23280    0.46  0.64862    
## factor(t)95          1.33306    0.23151    5.76  1.1e-08 ***
## factor(t)96         -1.02785    0.23513   -4.37  1.3e-05 ***
## factor(t)97          0.26529    0.25136    1.06  0.29143    
## factor(t)98          0.81186    0.23927    3.39  0.00071 ***
## factor(t)99          0.05008    0.23419    0.21  0.83069    
## factor(t)100         0.29305    0.23296    1.26  0.20863    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    1250
## Residual Sum of Squares: 509
## R-Squared      :  0.536 
##       Adj. R-Squared :  0.491 
## F-statistic: 17.9954 on 103 and 1277 DF, p-value: <2e-16
SCtest(m3k)  # non sig serial correlation!
## 
## Call:
## lm(formula = res[-n] ~ res[-1])
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -3.008 -0.350 -0.020  0.353  3.189 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.000175   0.016192    0.01     0.99
## res[-1]     0.002126   0.026802    0.08     0.94
## 
## Residual standard error: 0.605 on 1392 degrees of freedom
## Multiple R-squared:  4.52e-06,   Adjusted R-squared:  -0.000714 
## F-statistic: 0.00629 on 1 and 1392 DF,  p-value: 0.937
xyplot(m3k$residuals ~ fitted(m3k))  # not bad

plot of chunk unnamed-chunk-10

qqPlot(m3k$residuals)  # not bad

plot of chunk unnamed-chunk-10

plot(m3k$residuals ~ m3k$model[[7]])

plot of chunk unnamed-chunk-10

plot(m3k$residuals ~ m3k$model[[8]])

plot of chunk unnamed-chunk-10

plot(m3k$residuals[which(m3k$model[[8]] == "Carteret")] ~ m3k$model[[7]][which(m3k$model[[8]] == 
    "Carteret")])  # Res vs time

plot of chunk unnamed-chunk-10

plot(m3k$residuals[which(m3k$model[[8]] == "Camden")] ~ m3k$model[[7]][which(m3k$model[[8]] == 
    "Camden")])  # Res vs time

plot of chunk unnamed-chunk-10


# Removing outliers
findoutliers = plm(TotalSTD ~ PRECIPlevels + TMEANlevels + factor(t) + County.Area, 
    data = pdata)
outliers = which(findoutliers$residuals > 1)
pdata2 = pdata[-outliers, ]

# New reg without outliers
m3l = plm(TotalSTD ~ PRECIPlevels + TMEANlevels + lag(TotalSTD, 1) + lag(TotalSTD, 
    2) + lag(TotalSTD, 3) + factor(t) + County.Area, data = pdata2)
summary(m3l)  # still sig
## Oneway (individual) effect Within Model
## 
## Call:
## plm(formula = TotalSTD ~ PRECIPlevels + TMEANlevels + lag(TotalSTD, 
##     1) + lag(TotalSTD, 2) + lag(TotalSTD, 3) + factor(t) + County.Area, 
##     data = pdata2)
## 
## Unbalanced Panel: n=15, T=50-82, N=1054
## 
## Residuals :
##    Min. 1st Qu.  Median 3rd Qu.    Max. 
## -2.4800 -0.2950  0.0116  0.3230  1.6000 
## 
## Coefficients :
##                     Estimate Std. Error t-value Pr(>|t|)    
## PRECIPlevelsDrought -0.32767    0.15821   -2.07  0.03862 *  
## PRECIPlevelsDry     -0.34303    0.08235   -4.17  3.4e-05 ***
## PRECIPlevelsWet     -0.07918    0.08367   -0.95  0.34425    
## PRECIPlevelsSoaked   0.04579    0.16175    0.28  0.77719    
## TMEANlevelsFreezing  0.20848    0.20558    1.01  0.31081    
## TMEANlevelsCold     -0.03696    0.09384   -0.39  0.69375    
## TMEANlevelsWarm      0.01008    0.09426    0.11  0.91484    
## TMEANlevelsHot      -0.14670    0.17649   -0.83  0.40608    
## lag(TotalSTD, 1)     0.37088    0.03288   11.28  < 2e-16 ***
## lag(TotalSTD, 2)     0.11945    0.03499    3.41  0.00067 ***
## lag(TotalSTD, 3)     0.06174    0.03193    1.93  0.05344 .  
## factor(t)9           0.51234    0.22228    2.30  0.02139 *  
## factor(t)10          0.14207    0.22715    0.63  0.53182    
## factor(t)11          1.42019    0.22171    6.41  2.4e-10 ***
## factor(t)12         -0.80720    0.23235   -3.47  0.00054 ***
## factor(t)13         -0.12431    0.23454   -0.53  0.59623    
## factor(t)14          0.91472    0.23923    3.82  0.00014 ***
## factor(t)15          0.21090    0.23160    0.91  0.36273    
## factor(t)16          0.52448    0.23780    2.21  0.02766 *  
## factor(t)17          0.96896    0.24191    4.01  6.7e-05 ***
## factor(t)18          0.15793    0.25436    0.62  0.53484    
## factor(t)19          0.61792    0.25394    2.43  0.01515 *  
## factor(t)20          0.19140    0.22759    0.84  0.40057    
## factor(t)21         -0.05300    0.22401   -0.24  0.81302    
## factor(t)22          0.04398    0.22155    0.20  0.84268    
## factor(t)23          1.67839    0.24409    6.88  1.1e-11 ***
## factor(t)24         -0.76114    0.25517   -2.98  0.00293 ** 
## factor(t)25         -0.33928    0.24389   -1.39  0.16453    
## factor(t)26          0.55175    0.23134    2.39  0.01728 *  
## factor(t)27          0.28571    0.22463    1.27  0.20373    
## factor(t)28          0.15088    0.22596    0.67  0.50446    
## factor(t)29          1.08184    0.22870    4.73  2.6e-06 ***
## factor(t)30          0.39174    0.23007    1.70  0.08896 .  
## factor(t)31          0.50361    0.23582    2.14  0.03298 *  
## factor(t)32          0.26703    0.22304    1.20  0.23151    
## factor(t)33          0.22765    0.21713    1.05  0.29470    
## factor(t)34          0.00891    0.22053    0.04  0.96777    
## factor(t)35          1.00533    0.23655    4.25  2.4e-05 ***
## factor(t)36         -0.14434    0.23007   -0.63  0.53055    
## factor(t)37         -0.16216    0.23221   -0.70  0.48514    
## factor(t)38          0.53607    0.22719    2.36  0.01850 *  
## factor(t)39          0.19713    0.21945    0.90  0.36925    
## factor(t)40          0.46026    0.21910    2.10  0.03594 *  
## factor(t)41          0.84715    0.22170    3.82  0.00014 ***
## factor(t)42          0.25597    0.21777    1.18  0.24013    
## factor(t)43          0.63063    0.21922    2.88  0.00411 ** 
## factor(t)44          0.01558    0.21939    0.07  0.94341    
## factor(t)45          0.35496    0.21824    1.63  0.10418    
## factor(t)46          0.26770    0.22325    1.20  0.23079    
## factor(t)47          1.23838    0.22275    5.56  3.5e-08 ***
## factor(t)48         -0.41126    0.21765   -1.89  0.05913 .  
## factor(t)49         -0.33012    0.21756   -1.52  0.12951    
## factor(t)50          0.51499    0.22279    2.31  0.02102 *  
## factor(t)51          0.15283    0.21867    0.70  0.48478    
## factor(t)52          0.66429    0.22156    3.00  0.00279 ** 
## factor(t)53          0.78306    0.22751    3.44  0.00060 ***
## factor(t)54          0.04922    0.22567    0.22  0.82738    
## factor(t)55          0.19168    0.22366    0.86  0.39165    
## factor(t)56         -0.03444    0.22161   -0.16  0.87654    
## factor(t)57         -0.14148    0.22380   -0.63  0.52742    
## factor(t)58         -0.37602    0.21686   -1.73  0.08326 .  
## factor(t)59          1.30240    0.21347    6.10  1.5e-09 ***
## factor(t)60         -0.89219    0.21329   -4.18  3.1e-05 ***
## factor(t)61         -0.55193    0.21801   -2.53  0.01152 *  
## factor(t)62          0.25461    0.21308    1.19  0.23244    
## factor(t)63         -0.03807    0.21487   -0.18  0.85940    
## factor(t)64          0.16234    0.21404    0.76  0.44837    
## factor(t)65          0.39727    0.21146    1.88  0.06059 .  
## factor(t)66          0.08878    0.22365    0.40  0.69147    
## factor(t)67          0.17999    0.22357    0.81  0.42096    
## factor(t)68         -0.10829    0.22807   -0.47  0.63505    
## factor(t)69         -0.28219    0.22278   -1.27  0.20558    
## factor(t)70         -0.37797    0.22250   -1.70  0.08970 .  
## factor(t)71          1.40807    0.22589    6.23  6.9e-10 ***
## factor(t)72         -1.15038    0.22554   -5.10  4.1e-07 ***
## factor(t)73         -0.36223    0.23192   -1.56  0.11865    
## factor(t)74          0.61982    0.21945    2.82  0.00484 ** 
## factor(t)75          0.07848    0.21899    0.36  0.72015    
## factor(t)76          0.11043    0.21419    0.52  0.60629    
## factor(t)77          0.57209    0.20976    2.73  0.00651 ** 
## factor(t)78         -0.27503    0.22296   -1.23  0.21768    
## factor(t)79          0.18686    0.22414    0.83  0.40468    
## factor(t)80          0.08270    0.22273    0.37  0.71048    
## factor(t)81         -0.11220    0.21778   -0.52  0.60654    
## factor(t)82         -0.23052    0.25650   -0.90  0.36904    
## factor(t)83          1.79109    0.21836    8.20  7.7e-16 ***
## factor(t)84         -1.04781    0.22043   -4.75  2.3e-06 ***
## factor(t)85         -0.22361    0.21944   -1.02  0.30846    
## factor(t)86          0.65586    0.22139    2.96  0.00313 ** 
## factor(t)87          0.11289    0.22191    0.51  0.61105    
## factor(t)88          0.25063    0.21660    1.16  0.24751    
## factor(t)89          0.77796    0.21678    3.59  0.00035 ***
## factor(t)90          0.10266    0.22378    0.46  0.64651    
## factor(t)91          0.23799    0.22234    1.07  0.28472    
## factor(t)92          0.24816    0.22190    1.12  0.26370    
## factor(t)93          0.08436    0.22191    0.38  0.70392    
## factor(t)94          0.24286    0.22298    1.09  0.27636    
## factor(t)95          1.40164    0.21673    6.47  1.6e-10 ***
## factor(t)96         -0.92529    0.21974   -4.21  2.8e-05 ***
## factor(t)97          0.09653    0.24009    0.40  0.68773    
## factor(t)98          0.73805    0.23278    3.17  0.00157 ** 
## factor(t)99         -0.00962    0.23124   -0.04  0.96684    
## factor(t)100         0.41086    0.22349    1.84  0.06632 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    627
## Residual Sum of Squares: 249
## R-Squared      :  0.493 
##       Adj. R-Squared :  0.438 
## F-statistic: 13.8308 on 103 and 936 DF, p-value: <2e-16
SCtest(m3l)
## 
## Call:
## lm(formula = res[-n] ~ res[-1])
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.4605 -0.2960  0.0095  0.3255  1.6062 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)
## (Intercept)  0.000349   0.014988    0.02     0.98
## res[-1]     -0.014330   0.030958   -0.46     0.64
## 
## Residual standard error: 0.486 on 1051 degrees of freedom
## Multiple R-squared:  0.000204,   Adjusted R-squared:  -0.000747 
## F-statistic: 0.214 on 1 and 1051 DF,  p-value: 0.644
xyplot(m3l$residuals ~ fitted(m3l))  # looks ok

plot of chunk unnamed-chunk-10

qqPlot(m3l$residuals)  #looks OK

plot of chunk unnamed-chunk-10

plot(m3l$residuals ~ m3l$model[[7]])

plot of chunk unnamed-chunk-10

plot(m3l$residuals ~ m3l$model[[8]])

plot of chunk unnamed-chunk-10


# New reg without outliers or Camden
pdata3 = pdata2[which(pdata2$County.Area != "Camden"), ]
m3m = plm(TotalSTD ~ PRECIPlevels + TMEANlevels + lag(TotalSTD, 1) + lag(TotalSTD, 
    2) + lag(TotalSTD, 3) + factor(t) + County.Area, data = pdata3)
summary(m3m)  # still sig
## Oneway (individual) effect Within Model
## 
## Call:
## plm(formula = TotalSTD ~ PRECIPlevels + TMEANlevels + lag(TotalSTD, 
##     1) + lag(TotalSTD, 2) + lag(TotalSTD, 3) + factor(t) + County.Area, 
##     data = pdata3)
## 
## Unbalanced Panel: n=14, T=52-82, N=1004
## 
## Residuals :
##     Min.  1st Qu.   Median  3rd Qu.     Max. 
## -1.63000 -0.27900  0.00999  0.32100  1.65000 
## 
## Coefficients :
##                     Estimate Std. Error t-value Pr(>|t|)    
## PRECIPlevelsDrought -0.30748    0.15600   -1.97  0.04903 *  
## PRECIPlevelsDry     -0.31151    0.08347   -3.73  0.00020 ***
## PRECIPlevelsWet     -0.05200    0.08448   -0.62  0.53835    
## PRECIPlevelsSoaked  -0.12987    0.17394   -0.75  0.45547    
## TMEANlevelsFreezing  0.20852    0.20169    1.03  0.30148    
## TMEANlevelsCold     -0.02851    0.09370   -0.30  0.76103    
## TMEANlevelsWarm      0.00235    0.09465    0.02  0.98023    
## TMEANlevelsHot      -0.14581    0.17318   -0.84  0.40006    
## lag(TotalSTD, 1)     0.39402    0.03365   11.71  < 2e-16 ***
## lag(TotalSTD, 2)     0.10101    0.03638    2.78  0.00560 ** 
## lag(TotalSTD, 3)     0.05815    0.03291    1.77  0.07759 .  
## factor(t)9           0.33054    0.22879    1.44  0.14889    
## factor(t)10          0.08699    0.22760    0.38  0.70242    
## factor(t)11          1.37457    0.22250    6.18  9.9e-10 ***
## factor(t)12         -0.88843    0.23296   -3.81  0.00015 ***
## factor(t)13         -0.14189    0.23611   -0.60  0.54802    
## factor(t)14          0.86614    0.23934    3.62  0.00031 ***
## factor(t)15          0.13640    0.23202    0.59  0.55676    
## factor(t)16          0.46617    0.23877    1.95  0.05121 .  
## factor(t)17          0.91003    0.24186    3.76  0.00018 ***
## factor(t)18          0.11271    0.25403    0.44  0.65737    
## factor(t)19          0.56880    0.25385    2.24  0.02530 *  
## factor(t)20          0.13294    0.23504    0.57  0.57180    
## factor(t)21         -0.04165    0.23114   -0.18  0.85703    
## factor(t)22         -0.00093    0.22239    0.00  0.99666    
## factor(t)23          1.64139    0.24394    6.73  3.1e-11 ***
## factor(t)24         -0.84970    0.25517   -3.33  0.00090 ***
## factor(t)25         -0.34816    0.24553   -1.42  0.15653    
## factor(t)26          0.54831    0.23784    2.31  0.02138 *  
## factor(t)27          0.30275    0.23089    1.31  0.19013    
## factor(t)28          0.10888    0.23168    0.47  0.63850    
## factor(t)29          1.07845    0.23504    4.59  5.1e-06 ***
## factor(t)30          0.37597    0.23727    1.58  0.11342    
## factor(t)31          0.43039    0.24429    1.76  0.07845 .  
## factor(t)32          0.21632    0.22958    0.94  0.34632    
## factor(t)33          0.21405    0.22273    0.96  0.33679    
## factor(t)34         -0.05479    0.22491   -0.24  0.80760    
## factor(t)35          1.05683    0.24275    4.35  1.5e-05 ***
## factor(t)36         -0.22326    0.23682   -0.94  0.34607    
## factor(t)37         -0.19793    0.24045   -0.82  0.41064    
## factor(t)38          0.50723    0.23416    2.17  0.03056 *  
## factor(t)39          0.12577    0.22505    0.56  0.57640    
## factor(t)40          0.48888    0.22478    2.17  0.02990 *  
## factor(t)41          0.85914    0.22796    3.77  0.00017 ***
## factor(t)42          0.21092    0.22389    0.94  0.34641    
## factor(t)43          0.63282    0.22453    2.82  0.00493 ** 
## factor(t)44         -0.13448    0.22451   -0.60  0.54933    
## factor(t)45          0.34982    0.22371    1.56  0.11824    
## factor(t)46          0.28435    0.22797    1.25  0.21260    
## factor(t)47          1.09215    0.22951    4.76  2.3e-06 ***
## factor(t)48         -0.47591    0.22175   -2.15  0.03213 *  
## factor(t)49         -0.37509    0.22268   -1.68  0.09245 .  
## factor(t)50          0.51892    0.22857    2.27  0.02343 *  
## factor(t)51          0.08882    0.21948    0.40  0.68581    
## factor(t)52          0.60817    0.22282    2.73  0.00647 ** 
## factor(t)53          0.72560    0.22802    3.18  0.00151 ** 
## factor(t)54          0.01756    0.22669    0.08  0.93827    
## factor(t)55          0.16068    0.23028    0.70  0.48551    
## factor(t)56         -0.10719    0.22778   -0.47  0.63807    
## factor(t)57         -0.21111    0.23028   -0.92  0.35951    
## factor(t)58         -0.44655    0.22227   -2.01  0.04484 *  
## factor(t)59          1.29203    0.21848    5.91  4.8e-09 ***
## factor(t)60         -0.99107    0.21804   -4.55  6.2e-06 ***
## factor(t)61         -0.56757    0.22038   -2.58  0.01017 *  
## factor(t)62          0.21353    0.21428    1.00  0.31928    
## factor(t)63         -0.09365    0.21586   -0.43  0.66451    
## factor(t)64          0.10898    0.21549    0.51  0.61317    
## factor(t)65          0.28723    0.21615    1.33  0.18423    
## factor(t)66         -0.01953    0.22957   -0.09  0.93222    
## factor(t)67          0.08298    0.22954    0.36  0.71780    
## factor(t)68         -0.16885    0.22846   -0.74  0.46006    
## factor(t)69         -0.32932    0.22352   -1.47  0.14101    
## factor(t)70         -0.42339    0.22317   -1.90  0.05813 .  
## factor(t)71          1.35736    0.22670    5.99  3.1e-09 ***
## factor(t)72         -1.23695    0.22614   -5.47  5.9e-08 ***
## factor(t)73         -0.37987    0.23407   -1.62  0.10497    
## factor(t)74          0.57121    0.22029    2.59  0.00967 ** 
## factor(t)75          0.00383    0.22002    0.02  0.98613    
## factor(t)76          0.06182    0.21578    0.29  0.77456    
## factor(t)77          0.47742    0.21460    2.22  0.02636 *  
## factor(t)78         -0.07065    0.22911   -0.31  0.75787    
## factor(t)79         -0.02834    0.22977   -0.12  0.90187    
## factor(t)80         -0.01753    0.22881   -0.08  0.93893    
## factor(t)81         -0.23240    0.22259   -1.04  0.29674    
## factor(t)82         -0.27511    0.25505   -1.08  0.28104    
## factor(t)83          1.73805    0.21918    7.93  6.6e-15 ***
## factor(t)84         -1.13542    0.22163   -5.12  3.7e-07 ***
## factor(t)85         -0.22045    0.22214   -0.99  0.32128    
## factor(t)86          0.60980    0.22234    2.74  0.00622 ** 
## factor(t)87          0.04133    0.22278    0.19  0.85287    
## factor(t)88          0.18437    0.22223    0.83  0.40698    
## factor(t)89          0.74277    0.22237    3.34  0.00087 ***
## factor(t)90          0.05883    0.22936    0.26  0.79763    
## factor(t)91          0.18471    0.22873    0.81  0.41955    
## factor(t)92          0.15950    0.22813    0.70  0.48463    
## factor(t)93         -0.04096    0.22798   -0.18  0.85744    
## factor(t)94          0.20061    0.22376    0.90  0.37020    
## factor(t)95          1.35311    0.21768    6.22  7.8e-10 ***
## factor(t)96         -1.00230    0.22103   -4.53  6.6e-06 ***
## factor(t)97          0.09063    0.24196    0.37  0.70806    
## factor(t)98          0.68851    0.23310    2.95  0.00322 ** 
## factor(t)99         -0.07455    0.23174   -0.32  0.74775    
## factor(t)100         0.36409    0.23003    1.58  0.11382    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    602
## Residual Sum of Squares: 226
## R-Squared      :  0.513 
##       Adj. R-Squared :  0.454 
## F-statistic: 14.339 on 103 and 887 DF, p-value: <2e-16
SCtest(m3m)
## 
## Call:
## lm(formula = res[-n] ~ res[-1])
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -1.6199 -0.2823  0.0082  0.3253  1.6551 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)
## (Intercept)  0.000356   0.014997    0.02     0.98
## res[-1]     -0.017896   0.031728   -0.56     0.57
## 
## Residual standard error: 0.475 on 1001 degrees of freedom
## Multiple R-squared:  0.000318,   Adjusted R-squared:  -0.000681 
## F-statistic: 0.318 on 1 and 1001 DF,  p-value: 0.573
xyplot(m3m$residuals ~ fitted(m3m))  # looks ok

plot of chunk unnamed-chunk-10

qqPlot(m3m$residuals)  #looks OK

plot of chunk unnamed-chunk-10

plot(m3m$residuals ~ m3m$model[[7]])

plot of chunk unnamed-chunk-10

plot(m3m$residuals ~ m3m$model[[8]])

plot of chunk unnamed-chunk-10


# Reg with outliers and interaction terms
m3n = plm(TotalSTD ~ PRECIPlevels * TMEANlevels + lag(TotalSTD, 1) + lag(TotalSTD, 
    2) + lag(TotalSTD, 3) + factor(t) + County.Area, data = pdata)
summary(m3n)  # sig!
## Oneway (individual) effect Within Model
## 
## Call:
## plm(formula = TotalSTD ~ PRECIPlevels * TMEANlevels + lag(TotalSTD, 
##     1) + lag(TotalSTD, 2) + lag(TotalSTD, 3) + factor(t) + County.Area, 
##     data = pdata)
## 
## Balanced Panel: n=15, T=93, N=1395
## 
## Residuals :
##    Min. 1st Qu.  Median 3rd Qu.    Max. 
## -3.0000 -0.3530 -0.0206  0.3560  3.1800 
## 
## Coefficients :
##                                     Estimate Std. Error t-value Pr(>|t|)
## PRECIPlevelsDrought                  -0.4579     0.1769   -2.59  0.00974
## PRECIPlevelsDry                      -0.3421     0.0859   -3.98  7.2e-05
## PRECIPlevelsWet                      -0.1481     0.0932   -1.59  0.11246
## PRECIPlevelsSoaked                   -0.1077     0.1749   -0.62  0.53833
## TMEANlevelsFreezing                   0.1396     0.2436    0.57  0.56672
## TMEANlevelsCold                      -0.0719     0.0994   -0.72  0.46937
## TMEANlevelsWarm                       0.0474     0.1014    0.47  0.64046
## TMEANlevelsHot                       -0.3561     0.1926   -1.85  0.06476
## lag(TotalSTD, 1)                      0.4753     0.0278   17.08  < 2e-16
## lag(TotalSTD, 2)                      0.0629     0.0309    2.03  0.04221
## lag(TotalSTD, 3)                      0.1039     0.0279    3.73  0.00020
## factor(t)9                            0.4330     0.2317    1.87  0.06192
## factor(t)10                           0.3376     0.2315    1.46  0.14499
## factor(t)11                           1.3643     0.2317    5.89  5.0e-09
## factor(t)12                          -0.8644     0.2339   -3.70  0.00023
## factor(t)13                           0.0535     0.2369    0.23  0.82143
## factor(t)14                           1.1968     0.2360    5.07  4.5e-07
## factor(t)15                           0.2856     0.2347    1.22  0.22380
## factor(t)16                           0.6412     0.2379    2.70  0.00712
## factor(t)17                           0.4417     0.2315    1.91  0.05663
## factor(t)18                           0.0125     0.2319    0.05  0.95692
## factor(t)19                           0.3613     0.2322    1.56  0.11991
## factor(t)20                           0.1461     0.2319    0.63  0.52886
## factor(t)21                          -0.1581     0.2349   -0.67  0.50089
## factor(t)22                           0.0732     0.2316    0.32  0.75195
## factor(t)23                           2.0001     0.2350    8.51  < 2e-16
## factor(t)24                          -0.9015     0.2470   -3.65  0.00027
## factor(t)25                          -0.1646     0.2395   -0.69  0.49213
## factor(t)26                           0.7720     0.2363    3.27  0.00112
## factor(t)27                           0.1555     0.2336    0.67  0.50581
## factor(t)28                           0.2689     0.2340    1.15  0.25071
## factor(t)29                           1.0308     0.2326    4.43  1.0e-05
## factor(t)30                           0.2829     0.2335    1.21  0.22592
## factor(t)31                           0.4581     0.2331    1.97  0.04960
## factor(t)32                           0.0949     0.2316    0.41  0.68207
## factor(t)33                           0.1295     0.2313    0.56  0.57559
## factor(t)34                          -0.1755     0.2390   -0.73  0.46288
## factor(t)35                           1.4429     0.2409    5.99  2.7e-09
## factor(t)36                          -0.6324     0.2350   -2.69  0.00721
## factor(t)37                          -0.1851     0.2380   -0.78  0.43681
## factor(t)38                           0.7037     0.2337    3.01  0.00265
## factor(t)39                           0.0260     0.2338    0.11  0.91163
## factor(t)40                           0.3986     0.2331    1.71  0.08759
## factor(t)41                           0.7886     0.2317    3.40  0.00069
## factor(t)42                           0.2483     0.2383    1.04  0.29762
## factor(t)43                           0.6213     0.2325    2.67  0.00762
## factor(t)44                          -0.1756     0.2340   -0.75  0.45311
## factor(t)45                           0.1490     0.2322    0.64  0.52105
## factor(t)46                          -0.0196     0.2375   -0.08  0.93422
## factor(t)47                           1.2377     0.2337    5.30  1.4e-07
## factor(t)48                          -0.7351     0.2345   -3.14  0.00176
## factor(t)49                          -0.3480     0.2354   -1.48  0.13964
## factor(t)50                           0.5378     0.2339    2.30  0.02163
## factor(t)51                           0.1095     0.2333    0.47  0.63876
## factor(t)52                           0.4333     0.2352    1.84  0.06569
## factor(t)53                           0.7426     0.2319    3.20  0.00140
## factor(t)54                           0.1284     0.2342    0.55  0.58352
## factor(t)55                           0.2835     0.2331    1.22  0.22422
## factor(t)56                          -0.0524     0.2334   -0.22  0.82245
## factor(t)57                          -0.2532     0.2329   -1.09  0.27714
## factor(t)58                          -0.4996     0.2319   -2.15  0.03139
## factor(t)59                           1.2013     0.2328    5.16  2.9e-07
## factor(t)60                          -1.0835     0.2375   -4.56  5.6e-06
## factor(t)61                          -0.3844     0.2380   -1.62  0.10647
## factor(t)62                           0.1204     0.2357    0.51  0.60939
## factor(t)63                          -0.0961     0.2362   -0.41  0.68407
## factor(t)64                           0.0975     0.2349    0.42  0.67813
## factor(t)65                           0.4602     0.2340    1.97  0.04948
## factor(t)66                           0.2719     0.2396    1.13  0.25670
## factor(t)67                           0.3006     0.2330    1.29  0.19730
## factor(t)68                          -0.0208     0.2319   -0.09  0.92865
## factor(t)69                          -0.2986     0.2321   -1.29  0.19838
## factor(t)70                          -0.2934     0.2326   -1.26  0.20740
## factor(t)71                           1.0658     0.2407    4.43  1.0e-05
## factor(t)72                          -1.1009     0.2405   -4.58  5.2e-06
## factor(t)73                          -0.2424     0.2454   -0.99  0.32348
## factor(t)74                           0.5448     0.2448    2.23  0.02621
## factor(t)75                           0.0408     0.2355    0.17  0.86254
## factor(t)76                           0.0900     0.2354    0.38  0.70226
## factor(t)77                           0.6071     0.2325    2.61  0.00912
## factor(t)78                          -0.0149     0.2332   -0.06  0.94908
## factor(t)79                           0.3081     0.2334    1.32  0.18709
## factor(t)80                           0.0266     0.2320    0.11  0.90857
## factor(t)81                          -0.1197     0.2319   -0.52  0.60591
## factor(t)82                          -0.2660     0.2727   -0.98  0.32947
## factor(t)83                           1.5538     0.2345    6.62  5.1e-11
## factor(t)84                          -1.1621     0.2360   -4.93  9.5e-07
## factor(t)85                          -0.1481     0.2385   -0.62  0.53476
## factor(t)86                           0.6465     0.2358    2.74  0.00620
## factor(t)87                           0.0603     0.2347    0.26  0.79727
## factor(t)88                           0.1544     0.2341    0.66  0.50971
## factor(t)89                           0.7378     0.2316    3.19  0.00148
## factor(t)90                           0.2125     0.2333    0.91  0.36256
## factor(t)91                           0.2737     0.2324    1.18  0.23913
## factor(t)92                           0.2140     0.2316    0.92  0.35567
## factor(t)93                          -0.1424     0.2314   -0.62  0.53855
## factor(t)94                           0.0977     0.2330    0.42  0.67501
## factor(t)95                           1.3315     0.2316    5.75  1.1e-08
## factor(t)96                          -1.0336     0.2352   -4.39  1.2e-05
## factor(t)97                           0.2540     0.2516    1.01  0.31290
## factor(t)98                           0.8030     0.2394    3.35  0.00082
## factor(t)99                           0.0531     0.2343    0.23  0.82089
## factor(t)100                          0.2961     0.2330    1.27  0.20404
## PRECIPlevelsWet:TMEANlevelsFreezing   0.2788     0.7071    0.39  0.69342
## PRECIPlevelsWet:TMEANlevelsCold       0.1320     0.2966    0.44  0.65644
## PRECIPlevelsDry:TMEANlevelsWarm      -1.2626     0.6698   -1.89  0.05964
## PRECIPlevelsWet:TMEANlevelsWarm      -0.0628     0.5024   -0.13  0.90050
##                                        
## PRECIPlevelsDrought                 ** 
## PRECIPlevelsDry                     ***
## PRECIPlevelsWet                        
## PRECIPlevelsSoaked                     
## TMEANlevelsFreezing                    
## TMEANlevelsCold                        
## TMEANlevelsWarm                        
## TMEANlevelsHot                      .  
## lag(TotalSTD, 1)                    ***
## lag(TotalSTD, 2)                    *  
## lag(TotalSTD, 3)                    ***
## factor(t)9                          .  
## factor(t)10                            
## factor(t)11                         ***
## factor(t)12                         ***
## factor(t)13                            
## factor(t)14                         ***
## factor(t)15                            
## factor(t)16                         ** 
## factor(t)17                         .  
## factor(t)18                            
## factor(t)19                            
## factor(t)20                            
## factor(t)21                            
## factor(t)22                            
## factor(t)23                         ***
## factor(t)24                         ***
## factor(t)25                            
## factor(t)26                         ** 
## factor(t)27                            
## factor(t)28                            
## factor(t)29                         ***
## factor(t)30                            
## factor(t)31                         *  
## factor(t)32                            
## factor(t)33                            
## factor(t)34                            
## factor(t)35                         ***
## factor(t)36                         ** 
## factor(t)37                            
## factor(t)38                         ** 
## factor(t)39                            
## factor(t)40                         .  
## factor(t)41                         ***
## factor(t)42                            
## factor(t)43                         ** 
## factor(t)44                            
## factor(t)45                            
## factor(t)46                            
## factor(t)47                         ***
## factor(t)48                         ** 
## factor(t)49                            
## factor(t)50                         *  
## factor(t)51                            
## factor(t)52                         .  
## factor(t)53                         ** 
## factor(t)54                            
## factor(t)55                            
## factor(t)56                            
## factor(t)57                            
## factor(t)58                         *  
## factor(t)59                         ***
## factor(t)60                         ***
## factor(t)61                            
## factor(t)62                            
## factor(t)63                            
## factor(t)64                            
## factor(t)65                         *  
## factor(t)66                            
## factor(t)67                            
## factor(t)68                            
## factor(t)69                            
## factor(t)70                            
## factor(t)71                         ***
## factor(t)72                         ***
## factor(t)73                            
## factor(t)74                         *  
## factor(t)75                            
## factor(t)76                            
## factor(t)77                         ** 
## factor(t)78                            
## factor(t)79                            
## factor(t)80                            
## factor(t)81                            
## factor(t)82                            
## factor(t)83                         ***
## factor(t)84                         ***
## factor(t)85                            
## factor(t)86                         ** 
## factor(t)87                            
## factor(t)88                            
## factor(t)89                         ** 
## factor(t)90                            
## factor(t)91                            
## factor(t)92                            
## factor(t)93                            
## factor(t)94                            
## factor(t)95                         ***
## factor(t)96                         ***
## factor(t)97                            
## factor(t)98                         ***
## factor(t)99                            
## factor(t)100                           
## PRECIPlevelsWet:TMEANlevelsFreezing    
## PRECIPlevelsWet:TMEANlevelsCold        
## PRECIPlevelsDry:TMEANlevelsWarm     .  
## PRECIPlevelsWet:TMEANlevelsWarm        
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    1250
## Residual Sum of Squares: 507
## R-Squared      :  0.537 
##       Adj. R-Squared :  0.49 
## F-statistic: 17.3575 on 107 and 1273 DF, p-value: <2e-16
SCtest(m3n)  # non sig serial correlation!
## 
## Call:
## lm(formula = res[-n] ~ res[-1])
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -3.011 -0.355 -0.021  0.356  3.197 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.000175   0.016167    0.01     0.99
## res[-1]     0.005093   0.026802    0.19     0.85
## 
## Residual standard error: 0.604 on 1392 degrees of freedom
## Multiple R-squared:  2.59e-05,   Adjusted R-squared:  -0.000692 
## F-statistic: 0.0361 on 1 and 1392 DF,  p-value: 0.849
xyplot(m3n$residuals ~ fitted(m3n))  # not bad

plot of chunk unnamed-chunk-10

qqPlot(m3n$residuals)  # not terrible

plot of chunk unnamed-chunk-10

plot(m3n$residuals ~ m3n$model[[7]])

plot of chunk unnamed-chunk-10

plot(m3n$residuals ~ m3n$model[[8]])

plot of chunk unnamed-chunk-10

plot(m3n$residuals[which(m3n$model[[8]] == "Carteret")] ~ m3n$model[[7]][which(m3n$model[[8]] == 
    "Carteret")])  # Res vs time

plot of chunk unnamed-chunk-10

plot(m3n$residuals[which(m3n$model[[8]] == "Miami-Dade")] ~ m3n$model[[7]][which(m3n$model[[8]] == 
    "Miami-Dade")])  # Res vs time

plot of chunk unnamed-chunk-10