This document provides an analysis of the impact of robotization on productivity. We will create a dataframe, generate plots, and compute statistics to interpret the results.
First, we create a dataframe that includes the number of robots and productivity over the years.
# Creating a simple dataframe
df2 <- data.frame(
year = c(2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023),
robots = c(5, 7, 8, 10, 15, 20, 22, 25, 30),
productivity = c(50, 52, 53, 55, 60, 65, 70, 72, 75)
)
# Viewing the dataframe
print(df2)
## year robots productivity
## 1 2015 5 50
## 2 2016 7 52
## 3 2017 8 53
## 4 2018 10 55
## 5 2019 15 60
## 6 2020 20 65
## 7 2021 22 70
## 8 2022 25 72
## 9 2023 30 75
# Installing and loading the ggplot2 package
if(!require(ggplot2)) install.packages("ggplot2")
## Loading required package: ggplot2
library(ggplot2)
# Line plot for the number of robots over the years
ggplot(df2, aes(x = year, y = robots)) +
geom_line() +
geom_point() +
labs(title = "Number of Robots Over the Years", x = "Year", y = "Number of Robots")
# Scatter plot for the number of robots and productivity
ggplot(df2, aes(x = robots, y = productivity)) +
geom_point() +
geom_smooth(method = "lm", col = "blue") +
labs(title = "Number of Robots vs Productivity", x = "Number of Robots", y = "Productivity")
## `geom_smooth()` using formula = 'y ~ x'
# Linear regression between number of robots and productivity
model <- lm(productivity ~ robots, data = df2)
# Summary of the model
model_summary <- summary(model)
print(model_summary)
##
## Call:
## lm(formula = productivity ~ robots, data = df2)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.39127 -0.50985 -0.09852 0.07776 2.07882
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 44.62843 0.76188 58.58 1.11e-10 ***
## robots 1.05876 0.04265 24.82 4.39e-08 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.072 on 7 degrees of freedom
## Multiple R-squared: 0.9888, Adjusted R-squared: 0.9872
## F-statistic: 616.3 on 1 and 7 DF, p-value: 4.389e-08
# Interpretation of results
intercept <- model_summary$coefficients[1, 1]
slope <- model_summary$coefficients[2, 1]
r_squared <- model_summary$r.squared
cat("The regression equation is: Productivity = ", intercept, " + ", slope, " * Robots\n")
## The regression equation is: Productivity = 44.62843 + 1.058761 * Robots
cat("The R-squared value is: ", r_squared, "\n")
## The R-squared value is: 0.9887688
From the analysis, we observe that there is a positive relationship between the number of robots and productivity. The regression model helps us understand the impact of increasing robotization on productivity over the years.
Specifically:
The regression equation indicates that for each additional robot, productivity increases by approximately r round(slope, 2) units.
The R-squared value of r round(r_squared, 2) suggests that r round(r_squared * 100, 2)% of the variability in productivity can be explained by the number of robots.
These results demonstrate a significant positive impact of robotization on productivity, highlighting the importance of technological advancements in driving economic performance.