count_ny uk_2015
count_ny 1.0000 0.7945
uk_2015 0.7945 1.0000

Interpretation of the results:

According to the results, it seems that there’s a strong positive correlation between the variables.

Hour Scaled_NY Scaled_UK_2015 Scaled_UK_2016
0 -0.1268 -1.0976 -1.2122
1 -1.0385 -0.9678 -1.2122
2 -1.2616 -1.0976 -1.0583
3 -1.3574 -1.0976 -1.0583
4 -1.4094 -1.0976 -1.2122
5 -1.4532 -1.0976 -1.0583
6 -1.1151 -0.5785 -0.4426
7 -0.7893 0.8489 0.6350
8 -0.2760 0.0703 0.6350
9 -0.2555 -0.1892 -0.5965
10 -0.3349 -0.1892 -0.4426
11 -0.0201 -0.0595 0.0192
12 0.2482 0.4596 0.4810
13 0.4220 1.1084 2.1743
14 0.9353 -0.1892 1.0968
15 1.0777 0.3298 -0.1347
16 1.4486 1.7572 0.4810
17 1.7689 2.6655 1.8665
18 1.5800 1.3679 1.4047
19 1.1817 0.4596 0.9429
20 0.7588 0.2000 0.0192
21 0.3153 -0.4488 -0.2886
22 0.1113 -0.3190 -0.1347
23 -0.4102 -0.8380 -0.9044

Interpretation of the results:

It can be seen from the results, that for all 3 variables, correlation is positive and rather strong, and for all 3 cases above - completely significant.

Correlation - for review!

Plotly Plot of scaled data (3D) is for your review!

<The data was scaled for NY, for UK15 and for UK16, according to Lana’s comments.>

## 
## Call:
## lm(formula = count_ny ~ uk_2015 + uk_2016, data = final_hour_data)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1053.49  -336.21   -47.73   358.62   664.27 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   637.34     148.54   4.291 0.000324 ***
## uk_2015        57.06      24.41   2.338 0.029390 *  
## uk_2016        25.10      28.96   0.867 0.395770    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 456.2 on 21 degrees of freedom
## Multiple R-squared:  0.644,  Adjusted R-squared:   0.61 
## F-statistic: 18.99 on 2 and 21 DF,  p-value: 1.954e-05

* Please note: The regression isn’t for review!

* Also - The Plot’s aren’t for review!

Pleae note: This plot (the purple one at the top) is FOR YOUR REVIWE

According to the statistical procedure, my hypothesis was altered - is there a sigificant difference in the number of cars involved in a single accident, between 2015 and 2016, both in UK.

Testing Assumptions of The Model (for your review!)

## 
##  Shapiro-Wilk normality test
## 
## data:  vec_2015
## W = 0.67541, p-value < 2.2e-16
## 
##  Shapiro-Wilk normality test
## 
## data:  vec_2016
## W = 0.72839, p-value < 2.2e-16

Result/conclusion for Shapiro-Wilks test:

since both tests turned significant results, we can assume the data for both vectors isn’t normally distributed.

However, since the sample size for both vectors is dramatically greater than 30, we can overlook that and still use t-test assuming normality of the results.

Nonetheless, we’ll use both tests and conclude based upon both of them.

## 
##  F test to compare two variances
## 
## data:  vec_2015 and vec_2016
## F = 0.71111, num df = 202, denom df = 188, p-value = 0.01747
## alternative hypothesis: true ratio of variances is not equal to 1
## 95 percent confidence interval:
##  0.5361349 0.9418266
## sample estimates:
## ratio of variances 
##          0.7111085

Variance’s test results:

It turned that variances are significantly different - so we need to assume that while using the t-test procedure

## 
##  Welch Two Sample t-test
## 
## data:  data_2015_relevant$Number.of.Vehicles and data_2016_relevant$Number.of.Vehicles
## t = -0.84809, df = 368.86, p-value = 0.3969
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.15863568  0.06303269
## sample estimates:
## mean of x mean of y 
##  1.788177  1.835979

T-Test Result:

According to the t-test procedure - there’s no significance difference between 2015 and 2016; that means that we fail to reject the null hypothesis (H0 is the correct hypothesis).

## 
##  Wilcoxon rank sum test with continuity correction
## 
## data:  data_2015_relevant$Number.of.Vehicles and data_2016_relevant$Number.of.Vehicles
## W = 18727, p-value = 0.6183
## alternative hypothesis: true location shift is not equal to 0

Wilcoxon results:

Wilcoxon test led to the same result: there’s no significant difference in number of vehicles involved for both 2015 and 2016.

Year_2015 Year_2016
Year_2015 1.0000 0.9999
Year_2016 0.9999 1.0000

Please Note: The above the data is for review. Also The above data, is the data we used for the descriptive statistics and for the above correlation plot.

Year_2015 Year_2016
Year 2015 2016
Count 203 189
mean 1.788177 1.835979
median 2 2
min 1 1
max 3 4
sd 0.5068424 0.6010423
var 0.2568892 0.3612518

Please Note:

(for the Descriptive Table’s Part). For the Descriptive Statistics Part, I’ve ### manipulated the data of 2015 and 2016, and combined them together in such a way ### that I was able to generate the descriptive table without any designated package, and according to my specific desire. Please note that the above manipulation, was also used for generation of the orange stack plot.