El objetivo de este análisis es evaluar cómo las inversiones en tecnologías de la información y comunicación (TIC) y en investigación y desarrollo (I+D) influyen en las exportaciones totales de las empresas.
Para poder cargar la base de datos desde nuestro excel hay que utilizar el siguiente comando:
# Cargar datos excel
library(readr)
## Warning: package 'readr' was built under R version 4.4.2
datos_Edit <- read_delim("C:/Users/Santiago/Documents/CUARTO SEMESTRE/EDIT_X_2019_2020.csv",
delim = ";", escape_double = FALSE, trim_ws = TRUE)
## Rows: 6798 Columns: 729
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ";"
## chr (1): TIPOLO
## dbl (677): NORDEMP, CIIU4, I1R1C1N, I1R1C2N, I1R2C1N, I1R2C2N, I1R3C1N, I1R3...
## lgl (51): V1R15C3, V1R19C3, V1R20C3, V1R22C3, V3R2C12, V3R3C8, V3R3C12, V3R...
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
View(datos_Edit)
Se calcularon los coeficientes de correlación de Pearson para medir la relación lineal entre las variables:
I3R2C2).II1R4C2).II1R3C1).# Correlaciones
cor_tic <- cor.test(datos_Edit$I3R2C2, datos_Edit$II1R4C2)
cor_id <- cor.test(datos_Edit$I3R2C2, datos_Edit$II1R3C1)
# Mostrar resultados
cor_tic
##
## Pearson's product-moment correlation
##
## data: datos_Edit$I3R2C2 and datos_Edit$II1R4C2
## t = 12.721, df = 1976, p-value < 2.2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.2338852 0.3153732
## sample estimates:
## cor
## 0.2751232
cor_id
##
## Pearson's product-moment correlation
##
## data: datos_Edit$I3R2C2 and datos_Edit$II1R3C1
## t = 20.539, df = 1976, p-value < 2.2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.3824388 0.4551037
## sample estimates:
## cor
## 0.4194429
Visualizamos las relaciones entre exportaciones y las variables independientes mediante gráficos de dispersión:
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 4.4.2
# Gráfico: Exportaciones vs TIC
ggplot(datos_Edit, aes(x = II1R4C2, y = I3R2C2)) +
geom_point(alpha = 0.5) +
geom_smooth(method = "lm", color = "blue", se = TRUE) +
labs(title = "Exportaciones vs Inversión en TIC",
x = "Inversión en TIC",
y = "Exportaciones Totales") +
theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'
## Warning: Removed 4820 rows containing non-finite outside the scale range
## (`stat_smooth()`).
## Warning: Removed 4820 rows containing missing values or values outside the scale range
## (`geom_point()`).
# Gráfico: Exportaciones vs I+D
ggplot(datos_Edit, aes(x = II1R3C1, y = I3R2C2)) +
geom_point(alpha = 0.5) +
geom_smooth(method = "lm", color = "green", se = TRUE) +
labs(title = "Exportaciones vs Inversión en I+D",
x = "Inversión en I+D",
y = "Exportaciones Totales") +
theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'
## Warning: Removed 4820 rows containing non-finite outside the scale range
## (`stat_smooth()`).
## Removed 4820 rows containing missing values or values outside the scale range
## (`geom_point()`).