#Which three leading industries file the most AI patents, and how do their distributions compare to eachother?
#The dataset used in this analysis contains AI patent application data by industry across multiple countries. Each observation represents a respective industries patent application per country. Although the dataset includes several industry categories, this analysis focuses on the three sectors with the highest AI patent activity; Industry and Manufacturing, Energy Management, and Banking and Finance. By comparing these industries through exploratory data analysis, correlation, and a multi-linear regression model we are able to compare the distributions and data nuances that each data story tells. Further comparing the highest perofrmng industry to say its to predecessors initiates further questioning into just how behaviors within such industries relate or differ. Only when new observations can be constructed from existing parrelels can data be employed to best research every facet of life behind a given data set explored.
#To address the research question, I will first conduct exploratory data analysis to summarize the data, identify missing values and outliers, and examine the distribution of the variables using descriptive statistics and visualizations. This will provide an overall understanding of the dataset and help identify any patterns or issues before further analysis. This step is as well crucial in comparing and contrasting the average values between each sectors, and noting and significant differences.
#I will then perform regression analysis to examine the relationship between the top two applying sectors, followed by correlation analysis to measure the strength and direction of the relationships among the variables. The visual support will be the histograms, box plots, scatter plots with regression lines, and a correlation heatmap to visualize the datas relationship between top sectors. Following up with a QQ plot to show the distribution of the residuals in relation to the regression line.
library(tidyverse)
## Entity Code Year Banking and finance
## Length:221 Length:221 Min. :2016 Min. : 0.00
## Class :character Class :character 1st Qu.:2017 1st Qu.: 0.00
## Mode :character Mode :character Median :2018 Median : 1.00
## Mean :2018 Mean : 52.43
## 3rd Qu.:2018 3rd Qu.: 10.00
## Max. :2019 Max. :1529.00
## Business Energy management Industry and manufacturing Life sciences
## Min. : 0 Min. : 0.00 Min. : 0.00 Min. : 0.0
## 1st Qu.: 0 1st Qu.: 0.00 1st Qu.: 0.00 1st Qu.: 0.0
## Median : 2 Median : 1.00 Median : 1.00 Median : 4.0
## Mean : 184 Mean : 59.02 Mean : 85.47 Mean : 197.1
## 3rd Qu.: 20 3rd Qu.: 6.00 3rd Qu.: 12.00 3rd Qu.: 40.0
## Max. :5511 Max. :1822.00 Max. :2761.00 Max. :5573.0
## Physical sciences and engineering Security Telecommunications
## Min. : 0.00 Min. : 0.00 Min. : 0.0
## 1st Qu.: 0.00 1st Qu.: 0.00 1st Qu.: 0.0
## Median : 1.00 Median : 1.00 Median : 4.0
## Mean : 51.57 Mean : 80.48 Mean : 280.4
## 3rd Qu.: 13.00 3rd Qu.: 16.00 3rd Qu.: 39.0
## Max. :1594.00 Max. :2284.00 Max. :7900.0
## Transportation Personal devices and computing
## Min. : 0.0 Min. : 0.0
## 1st Qu.: 0.0 1st Qu.: 1.0
## Median : 2.0 Median : 6.0
## Mean : 159.9 Mean : 797.1
## 3rd Qu.: 22.0 3rd Qu.: 104.0
## Max. :4282.0 Max. :24373.0
## [1] 221 6
## `geom_smooth()` using formula = 'y ~ x'
#The scatterplot displays a clear positive linear relationship, meaning that countries with a higher number of Industry and Manufacturing AI patents also tend to have a higher number of Business AI patents. The regression line slopes upward, indicating that as Industry and Manufacturing patent activity increases, Business patent activity also increases. Although there is some variation among countries, most data points follow the overall trend, suggesting a strong positive association between the two leading industries.
#The QQ plot shows that the residuals are not normally distributed because the points do not follow the straight line. Instead, they curve away from the line at both ends; suggesting there are several outliers in the data. Since the normality assumption is violated, the results of the linear regression should be interpreted with a wider margin of error.
#The Residuals vs Fitted plot suggests that the model may have some issues with its assumptions. The residuals are not randomly spread around zero, and the downward trend in the smoothing line shows that the relationship may not be completely linear. The spread of the residuals also changes across the plot, which could indicate unequal error variance. Observations 34, 96, and 221 appear different from the rest of the data and may have an influence on the model’s predictions.
## Industry and manufacturing Energy management
## Industry and manufacturing 1.0000000 0.9887378
## Energy management 0.9887378 1.0000000
## Banking and finance 0.9115019 0.8653256
## Banking and finance
## Industry and manufacturing 0.9115019
## Energy management 0.8653256
## Banking and finance 1.0000000
#All of the correlations are above 0.86, which means these industries tend to move together. Countries with high AI patent activity in one sector generally have high AI patent activity in the other sectors as well. The strongest relationship is between Industry and manufacturing and Energy management.
##
## Call:
## lm(formula = `Industry and manufacturing` ~ `Banking and finance` +
## `Energy management`, data = patents)
##
## Residuals:
## Min 1Q Median 3Q Max
## -159.918 0.285 0.670 1.670 159.122
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.67018 2.17386 -0.308 0.758
## `Banking and finance` 0.38566 0.02335 16.516 <2e-16 ***
## `Energy management` 1.11676 0.01891 59.066 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 30.99 on 218 degrees of freedom
## Multiple R-squared: 0.9901, Adjusted R-squared: 0.99
## F-statistic: 1.085e+04 on 2 and 218 DF, p-value: < 2.2e-16
#This section builds a multiple linear regression model using Industry and manufacturing & Energy Management patent counts to predict Industry and Manufacturing patent counts. The output shows the intercept, regression coefficients, p-values, and R-squared value, which explain how well the predictor variables account for the variation in Industry and Manufacturing patents.
## [1] 0.9887378
## [1] 30.77997
#This section calculates the Root Mean Squared Error (RMSE) to evaluate how accurate the regression model’s predictions are by measuring the average prediction error. I then use the predict() function to estimate the expected number of Industry and Manufacturing patents based on specific values of the predictor variables.
#Final Thoughts
#The exploratory analysis showed that Industry and Manufacturing consistently had the highest average number of AI patents among the industries examined. The regression analysis indicated that Business and Energy Management patent activity were positively associated with Industry and Manufacturing patents, suggesting that industries with higher AI innovation tend to experience similar growth across sectors. Overall, the regression models and various other visualizations above provide evidence to conclude that within each country, each industry was founded to do follow in significant pattern or trend with the predecessing sector in applying for more or less patents in noticeable pattern .
#The null hypothesis was rejected because the regression model showed a statistically significant relationship between Banking and Finance, Energy Management, and Industry and Manufacturing AI patent activity. The extremely small p-values (< 2e-16) indicate that these relationships are unlikely to occur by chance. The model suggests that countries with higher AI patent activity in Industry and manufacturing & Energy Management also tend to have higher Industry and Manufacturing AI patent activity
#Future research could include additional industries or incorporate more recent patent data to determine whether these trends continue over time and what industries may prevail. Other statistical models or international comparisons could also provide a broader understanding of how AI innovation varies across sectors and countries and just how intimate these correlations in data influxes are amongst globally leading industries as AI stands to change the world and all facets as we know it.