## 4 Results and Discussion
### Level 2: Inferential Statistics
#### 4.2.4 Chi-Square  
Chi-Square is a non-parametric test, which is divided into two different types: Chi-Square Goodness of Fit and Chi-Square of Independence. The purpose of Chi-Square Goodness of Fit is to compare the observed and expected values from one categorical variable. Meanwhile, Chi-Square of Independence defines whether there is an association among categorical variables, meaning that the variables are related or independent, known as the Chi-Square Test of Association [40].  
To implement the Chi-Square Goodness of Fit test, the dataset is split into the period of 2017 to 2020, used for testing the predictions of 2021 whether there is a significant difference between the observed and expected values. First, the Chi-Square Goodness of Fit Test is applied to compare the Total Fuel Consumption by Vehicle Class between expected (from 2017 to 2020) and observed (2021) using a confidence level of 98% (\(\alpha\) = 0.02), and the results attained are discussed below.  
* Chi-Square value: 0.5317;
* \(p\)-value: 0.4659.  
It can be seen that:  
\[p\text{-value}=0.47>\alpha=0.02. \tag{6}\]  
Therefore, the null hypothesis can be accepted, meaning that there is no significant difference between the observed and expected values.  
A similar Chi-Square Goodness of Fit Test is conducted for comparing Total Fuel Consumption by Fuel Type in expected (from 2017 to 2020) and observed (2021) with the following outputs.  
* The Chi-Square value is: 6.3380;
* \(p\)-value: 0.0118.  
\[p\text{-value}=0.012<\alpha=0.02. \tag{7}\]  
Therefore, the null hypothesis can be rejected, meaning that there is a significant difference between the observed and expected values.  
Next, to address RQ2.4 (What are the relationships between all features to each other of the entire dataset?), the Chi-Square of Independence Test was conducted to ascertain whether there is a relationship between fuel type and CO\({}_{2}\) rating and the results are the following.  
* The Chi-Square value is: 765.5951;
* The \(p\)-value is: 6.6296 \(\times\) 10\({}^{-144}\);
* The degree of freedom is: 27.  
It is perceived that  
\[p\text{-value}=6.63\times 10^{-144}<\alpha=0.02. \tag{8}\]  
With the chosen confidence level of 98%, the null hypothesis is rejected, and there is a relationship between fuel type and CO\({}_{2}\) rating.  
A chain of similar Chi-Square of Independence tests have also been implemented to define relationships amongst all features and are presented in a correlation heat map  
Figure 14: Importance of features on predicting CO\({}_{2}\) emissions.  
shown in Figure 15. In the heat map, all the correlation coefficients have been calculated and indicated as 1, if there is a relationship between corresponding parameters on the left and the corresponding parameters at the bottom, and indicated as 0 if there is no relationship among them. It reveals that there is some form of relationship amongst almost all features except that there is no relationship between year and model, cylinders, and total fuel consumption (mpg). Through this test, it is concluded that all the features from the chosen dataset can be used for prediction models proposed in Level 3 and 4, and year can be used as a time index for the estimation.