Multi factor regression on nyc-east-river-bicycle-counts data set
bikes <- read_csv("/Users/bchand005c/CUNY/DATA-605/assignment/week-12/nyc-east-river-bicycle-counts.csv")
## Warning: Missing column names filled in: 'X1' [1]
## Parsed with column specification:
## cols(
## X1 = col_integer(),
## Date = col_datetime(format = ""),
## Day = col_datetime(format = ""),
## `High Temp (°F)` = col_double(),
## `Low Temp (°F)` = col_double(),
## Precipitation = col_character(),
## `Brooklyn Bridge` = col_double(),
## `Manhattan Bridge` = col_integer(),
## `Williamsburg Bridge` = col_double(),
## `Queensboro Bridge` = col_double(),
## Total = col_integer()
## )
head(bikes)
## # A tibble: 6 x 11
## X1 Date Day `High Temp (°F)`
## <int> <dttm> <dttm> <dbl>
## 1 0 2016-04-01 00:00:00 2016-04-01 00:00:00 78.1
## 2 1 2016-04-02 00:00:00 2016-04-02 00:00:00 55
## 3 2 2016-04-03 00:00:00 2016-04-03 00:00:00 39.9
## 4 3 2016-04-04 00:00:00 2016-04-04 00:00:00 44.1
## 5 4 2016-04-05 00:00:00 2016-04-05 00:00:00 42.1
## 6 5 2016-04-06 00:00:00 2016-04-06 00:00:00 45
## # ... with 7 more variables: `Low Temp (°F)` <dbl>, Precipitation <chr>,
## # `Brooklyn Bridge` <dbl>, `Manhattan Bridge` <int>, `Williamsburg
## # Bridge` <dbl>, `Queensboro Bridge` <dbl>, Total <int>
bikes.lm <- lm(`Manhattan Bridge` ~ `High Temp (°F)` + `Low Temp (°F)` + Precipitation, data = bikes)
summary(bikes.lm)
##
## Call:
## lm(formula = `Manhattan Bridge` ~ `High Temp (°F)` + `Low Temp (°F)` +
## Precipitation, data = bikes)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1780.0 -321.2 0.0 393.7 1044.9
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 18.92 340.89 0.056 0.95578
## `High Temp (°F)` 27.74 10.82 2.564 0.01108 *
## `Low Temp (°F)` 72.48 12.16 5.962 1.13e-08 ***
## Precipitation0.01 -2062.87 182.85 -11.282 < 2e-16 ***
## Precipitation0.05 -821.28 275.12 -2.985 0.00319 **
## Precipitation0.09 -2729.08 212.89 -12.819 < 2e-16 ***
## Precipitation0.15 -3442.76 291.59 -11.807 < 2e-16 ***
## Precipitation0.16 -3105.83 293.36 -10.587 < 2e-16 ***
## Precipitation0.2 -2683.57 269.51 -9.957 < 2e-16 ***
## Precipitation0.24 -1565.27 266.93 -5.864 1.87e-08 ***
## Precipitation0.47 (S) -2574.24 282.04 -9.127 < 2e-16 ***
## PrecipitationT -1844.47 283.99 -6.495 6.57e-10 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 673.9 on 198 degrees of freedom
## Multiple R-squared: 0.8519, Adjusted R-squared: 0.8437
## F-statistic: 103.6 on 11 and 198 DF, p-value: < 2.2e-16