Pregunta de investigación: ¿Qué factores sociales y económicos han influido en el crecimiento y/o variaciones del PIB entre los años 2020 y 2021 en las 50 economías más grandes del mundo?
Justificación: El estudio del crecimiento económico mediante el PIB, y de sus determinantes, es fundamental para entender los diversos procesos sociales que pueden estar interrelacionados con dicho crecimiento. El análisis de estos 50 países, los cuales representan a la mayor parte de la economía global, nos ofrece una amplia y valiosa visión comparativa. El período comprendido entre el 2020 y el 2021 es de particular interés dados los efectos que trajo consigo la pandemia de COVID-19. Esto nos permitirá entonces observar de manera directa dichos efectos durante el tiempo de la crisis. El comprender las variables que impulsan el crecimiento económico puede permitirnos conocer acerca de la toma de decisiones de políticas públicas en dicho período. Finalmente, creemos que la originalidad del presente trabajo recae en el enfoque de tomar en cuenta a las 50 economías más grandes del mundo, junto con las demás variables que expondremos más adelante.
Hipótesis: Esperamos que, dado que el PIB es nuestra variable independiente, tenga cierta variación del año 2020 al 2021, bajo la influencia de nuestras variables independientes, que abarcan cuestiones sociopolíticas y económicas. Con ello, y teniendo en cuenta el contexto de la pandemia de COVID-19, esperamos que el PIB de dichas economías crezca.
Kaiser-Meyer-Olkin factor adequacy
Call: psych::KMO(r = corMatrix)
Overall MSA = 0.61
MSA for each item =
exports_gdp_por GDP_growth_por GDP_per_capita_growth_por
0.40 0.47 0.48
edu_govexp_gdp inflation_rate military_gdp
0.54 0.67 0.36
health_exp_gdp R_._D_exp_GDP gov_eff
0.69 0.76 0.70
UHC_coverage
0.77
[1] FALSE
[1] FALSE
Parallel analysis suggests that the number of factors = 2 and the number of components = NA
Loadings:
ML2 ML1
exports_gdp_por 0.367 0.301
GDP_growth_por -0.150 0.926
GDP_per_capita_growth_por 0.997
edu_govexp_gdp 0.369
inflation_rate 0.381
military_gdp
health_exp_gdp 0.698
R_._D_exp_GDP 0.787
gov_eff 0.898
UHC_coverage 0.786 0.207
ML2 ML1
SS loadings 2.972 2.017
Proportion Var 0.297 0.202
Cumulative Var 0.297 0.499
Loadings:
ML2 ML1
exports_gdp_por
GDP_growth_por 0.926
GDP_per_capita_growth_por 0.997
edu_govexp_gdp
inflation_rate
military_gdp
health_exp_gdp 0.698
R_._D_exp_GDP 0.787
gov_eff 0.898
UHC_coverage 0.786
ML2 ML1
SS loadings 2.972 2.017
Proportion Var 0.297 0.202
Cumulative Var 0.297 0.499
COUNTRY exports_gdp_por GDP_growth_por GDP_per_capita_growth_por
Length:50 Min. : 9.05 Min. : 1.570 Min. : 1.450
Class :character 1st Qu.: 22.13 1st Qu.: 4.300 1st Qu.: 3.420
Mode :character Median : 32.37 Median : 5.585 Median : 5.320
Mean : 43.16 Mean : 6.244 Mean : 5.889
3rd Qu.: 53.79 3rd Qu.: 7.270 3rd Qu.: 7.655
Max. :183.01 Max. :16.260 Max. :15.150
edu_govexp_gdp inflation_rate military_gdp health_exp_gdp
Min. : 0.380 Min. :-56.320 Min. :0.200 Min. : 2.400
1st Qu.: 3.623 1st Qu.: -9.648 1st Qu.:1.125 1st Qu.: 5.325
Median : 4.655 Median : -4.560 Median :1.400 Median : 8.850
Mean : 4.734 Mean : -8.139 Mean :1.850 Mean : 8.134
3rd Qu.: 5.480 3rd Qu.: -2.605 3rd Qu.:2.175 3rd Qu.:10.625
Max. :18.790 Max. : 0.190 Max. :7.200 Max. :17.500
R_._D_exp_GDP gov_eff UHC_coverage ice_efa
Min. :0.100 Min. :-1.000 Min. :38.00 Min. :-1.4089
1st Qu.:0.500 1st Qu.:-0.075 1st Qu.:75.25 1st Qu.:-0.7206
Median :1.400 Median : 0.850 Median :82.00 Median :-0.1667
Mean :1.640 Mean : 0.680 Mean :78.26 Mean : 0.0000
3rd Qu.:2.375 3rd Qu.: 1.400 3rd Qu.:85.00 3rd Qu.: 0.5436
Max. :5.800 Max. : 2.200 Max. :91.00 Max. : 2.8599
Call:
lm(formula = modelo27, data = locura)
Residuals:
Min 1Q Median 3Q Max
-1.7845 -0.6202 -0.2311 0.7530 2.1536
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -2.267443 1.313042 -1.727 0.0917 .
exports_gdp_por 0.010898 0.006261 1.741 0.0893 .
edu_govexp_gdp 0.008736 0.075180 0.116 0.9081
inflation_rate -0.004943 0.014809 -0.334 0.7402
military_gdp 0.074521 0.136863 0.544 0.5890
health_exp_gdp 0.028566 0.075809 0.377 0.7083
R_._D_exp_GDP -0.093873 0.176904 -0.531 0.5985
gov_eff -0.254658 0.353796 -0.720 0.4757
UHC_coverage 0.021370 0.021482 0.995 0.3257
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.998 on 41 degrees of freedom
Multiple R-squared: 0.1625, Adjusted R-squared: -0.000881
F-statistic: 0.9946 on 8 and 41 DF, p-value: 0.4546
Call:
lm(formula = modelo11, data = locura)
Residuals:
Min 1Q Median 3Q Max
-1.7683 -0.6470 -0.2185 0.6615 2.0463
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.392456 0.224604 -1.747 0.0870 .
exports_gdp_por 0.009094 0.004144 2.194 0.0331 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.9608 on 48 degrees of freedom
Multiple R-squared: 0.09118, Adjusted R-squared: 0.07225
F-statistic: 4.816 on 1 and 48 DF, p-value: 0.03307
Call:
lm(formula = modelo30, data = locura)
Residuals:
Min 1Q Median 3Q Max
-1.3148 -0.7701 -0.2063 0.4487 2.9161
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.147720 0.418778 -0.353 0.726
edu_govexp_gdp 0.034164 0.060702 0.563 0.576
health_exp_gdp -0.001723 0.046854 -0.037 0.971
Residual standard error: 1.015 on 47 degrees of freedom
Multiple R-squared: 0.007232, Adjusted R-squared: -0.03501
F-statistic: 0.1712 on 2 and 47 DF, p-value: 0.8432
Call:
lm(formula = modelo31, data = locura)
Residuals:
Min 1Q Median 3Q Max
-1.65719 -0.63075 -0.08479 0.42625 2.63613
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -1.84992 1.05547 -1.753 0.0863 .
edu_govexp_gdp 0.01214 0.06073 0.200 0.8425
health_exp_gdp -0.06715 0.05917 -1.135 0.2623
UHC_coverage 0.02988 0.01708 1.750 0.0868 .
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.9933 on 46 degrees of freedom
Multiple R-squared: 0.06921, Adjusted R-squared: 0.008503
F-statistic: 1.14 on 3 and 46 DF, p-value: 0.3429
Call:
lm(formula = modelo32, data = locura)
Residuals:
Min 1Q Median 3Q Max
-1.6862 -0.6210 -0.1005 0.6069 2.5586
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -2.25063 1.13072 -1.990 0.0526 .
edu_govexp_gdp 0.01016 0.06078 0.167 0.8680
health_exp_gdp -0.04684 0.06264 -0.748 0.4584
UHC_coverage 0.03598 0.01816 1.982 0.0537 .
R_._D_exp_GDP -0.14153 0.14304 -0.989 0.3277
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.9935 on 45 degrees of freedom
Multiple R-squared: 0.08903, Adjusted R-squared: 0.008051
F-statistic: 1.099 on 4 and 45 DF, p-value: 0.3685
pam exports_gdp_por GDP_growth_por GDP_per_capita_growth_por edu_govexp_gdp
1 1 42.78069 6.894483 6.485517 4.122414
2 2 43.67381 5.344762 5.065238 5.578571
inflation_rate military_gdp health_exp_gdp R_._D_exp_GDP gov_eff
1 -11.47966 1.955172 5.955172 0.7758621 0.1344828
2 -3.52619 1.704762 11.142857 2.8333333 1.4333333
UHC_coverage
1 72.65517
2 86.00000
agnes exports_gdp_por GDP_growth_por GDP_per_capita_growth_por edu_govexp_gdp
1 1 34.24333 6.444074 5.872963 4.211852
2 2 53.61826 6.008261 5.907826 5.346957
inflation_rate military_gdp health_exp_gdp R_._D_exp_GDP gov_eff
1 -11.909259 1.996296 5.959259 0.7185185 0.007407407
2 -3.713478 1.678261 10.686957 2.7217391 1.469565217
UHC_coverage pam
1 71.66667 1.000000
2 86.00000 1.913043
diana exports_gdp_por GDP_growth_por GDP_per_capita_growth_por edu_govexp_gdp
1 1 38.36917 5.963125 5.519583 4.809792
2 2 158.03500 12.975000 14.755000 2.915000
inflation_rate military_gdp health_exp_gdp R_._D_exp_GDP gov_eff UHC_coverage
1 -8.241667 1.86875 8.227083 1.64375 0.63125 77.9375
2 -5.680000 1.40000 5.900000 1.55000 1.85000 86.0000
pam agnes
1 1.4375 1.4375
2 1.0000 2.0000
Call:
lm(formula = modelo11, data = locura)
Residuals:
Min 1Q Median 3Q Max
-1.7683 -0.6470 -0.2185 0.6615 2.0463
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.392456 0.224604 -1.747 0.0870 .
exports_gdp_por 0.009094 0.004144 2.194 0.0331 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.9608 on 48 degrees of freedom
Multiple R-squared: 0.09118, Adjusted R-squared: 0.07225
F-statistic: 4.816 on 1 and 48 DF, p-value: 0.03307
Existe una relación entre las exportaciones en base al porcentaje del PIB y el crecimiento económico medido en el crecimiento del PIB dado que por cada 1% de incremento en exportaciones (en base al porcentaje del PIB), el índice de crecimiento económico aumenta 0.0090 unidades. Ahora, teniendo en cuenta el contexto global del período analizado, podemos también observar que este tipo de crecimiento no se vió afectado por la pandemia de COVID-19.
Call:
lm(formula = modelo30, data = locura)
Residuals:
Min 1Q Median 3Q Max
-1.3148 -0.7701 -0.2063 0.4487 2.9161
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.147720 0.418778 -0.353 0.726
edu_govexp_gdp 0.034164 0.060702 0.563 0.576
health_exp_gdp -0.001723 0.046854 -0.037 0.971
Residual standard error: 1.015 on 47 degrees of freedom
Multiple R-squared: 0.007232, Adjusted R-squared: -0.03501
F-statistic: 0.1712 on 2 and 47 DF, p-value: 0.8432
Call:
lm(formula = modelo31, data = locura)
Residuals:
Min 1Q Median 3Q Max
-1.65719 -0.63075 -0.08479 0.42625 2.63613
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -1.84992 1.05547 -1.753 0.0863 .
edu_govexp_gdp 0.01214 0.06073 0.200 0.8425
health_exp_gdp -0.06715 0.05917 -1.135 0.2623
UHC_coverage 0.02988 0.01708 1.750 0.0868 .
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.9933 on 46 degrees of freedom
Multiple R-squared: 0.06921, Adjusted R-squared: 0.008503
F-statistic: 1.14 on 3 and 46 DF, p-value: 0.3429
Call:
lm(formula = modelo32, data = locura)
Residuals:
Min 1Q Median 3Q Max
-1.6862 -0.6210 -0.1005 0.6069 2.5586
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -2.25063 1.13072 -1.990 0.0526 .
edu_govexp_gdp 0.01016 0.06078 0.167 0.8680
health_exp_gdp -0.04684 0.06264 -0.748 0.4584
UHC_coverage 0.03598 0.01816 1.982 0.0537 .
R_._D_exp_GDP -0.14153 0.14304 -0.989 0.3277
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.9935 on 45 degrees of freedom
Multiple R-squared: 0.08903, Adjusted R-squared: 0.008051
F-statistic: 1.099 on 4 and 45 DF, p-value: 0.3685
---
title: "Determinantes del Crecimiento Económico"
author: "Augusto Granados y Leonardo Argandoña"
output:
flexdashboard::flex_dashboard:
theme: journal
orientation: columns
vertical_layout: fill
source_code: embed
---
<style>
.scroll-box {
height: calc(100vh - 120px); /* 100% de la altura de la ventana menos 120px */
overflow-y: auto; /* Añade scroll vertical si es necesario */
padding-right: 15px; /* Espacio opcional para la barra de scroll */
}
</style>
1. Introducción {data-icon="fa-solid fa-lightbulb"}
=====================================
Column {data-width=650}
-----------------------------------------------------------------------
```{r setup, include=FALSE}
library(flexdashboard)
library(stringi)
library(ggplot2)
library(corrplot)
library(dplyr)
library(rio)
library(tidyverse)
library(BBmisc)
library(ggthemes)
library(polycor)
library(psych)
library(matrixcalc)
library(GPArotation)
library(cluster)
library(factoextra)
library(kableExtra)
library(modelsummary)
library(plotly)
library(sf)
library(ggrepel)
library(leaflet)
library(DT)
library(fontawesome)
library(vtable)
library(reshape2)
library(tmap)
htmltools::tagList(fontawesome::fa_html_dependency())
computeMuestra = function(...) return("Muestra")
computePaises = function(...) return(50)
"C:/Users/Augusto/Desktop/Ciclo 2025-1/Estadistica para el Análisis Político 2/EAP2 - Tf"
link_locura="https://docs.google.com/spreadsheets/d/e/2PACX-1vRlKbBagehW10J-kbK9KsXDd6wbJ21TWUTkv-NFRw7F1Ne0earsXK0Iv6v4Qnxb0xwfYHDh4IRoRySE/pub?gid=1509063522&single=true&output=csv"
locura=read.csv(link_locura)
names(locura)
locura$inflation_rate=-1*locura$inflation_rate
boxplot(BBmisc::normalize(locura[,2:11],method='standardize'))
```
### Datos de la muestra
```{r}
muestra = computeMuestra()
valueBox(muestra, icon = "fa-solid fa-flask")
```
### Economías más grandes del mundo
```{r}
paises = computePaises()
valueBox(paises, icon = "fas fa-earth-americas")
```
### Hipótesis
* **Pregunta de investigación:**
¿Qué factores sociales y económicos han influido en el crecimiento y/o variaciones del PIB entre los años 2020 y 2021 en las 50 economías más grandes del mundo?
* **Justificación:**
El estudio del crecimiento económico mediante el PIB, y de sus determinantes, es fundamental para entender los diversos procesos sociales que pueden estar interrelacionados con dicho crecimiento. El análisis de estos 50 países, los cuales representan a la mayor parte de la economía global, nos ofrece una amplia y valiosa visión comparativa. El período comprendido entre el 2020 y el 2021 es de particular interés dados los efectos que trajo consigo la pandemia de COVID-19. Esto nos permitirá entonces observar de manera directa dichos efectos durante el tiempo de la crisis. El comprender las variables que impulsan el crecimiento económico puede permitirnos conocer acerca de la toma de decisiones de políticas públicas en dicho período. Finalmente, creemos que la originalidad del presente trabajo recae en el enfoque de tomar en cuenta a las 50 economías más grandes del mundo, junto con las demás variables que expondremos más adelante.
* **Hipótesis:**
Esperamos que, dado que el PIB es nuestra variable independiente, tenga cierta variación del año 2020 al 2021, bajo la influencia de nuestras variables independientes, que abarcan cuestiones sociopolíticas y económicas. Con ello, y teniendo en cuenta el contexto de la pandemia de COVID-19, esperamos que el PIB de dichas economías crezca.
Column {data-width=400}{.tabset}
-----------------------------------------------------------------------
### Distribución del crecimiento del PBI en 2021
```{r}
locura %>%
ggplot(aes(x = GDP_growth_por)) +
geom_histogram(color = "black", fill = "hotpink1", bins = 40) +
ggtitle("Crecimiento anual del PBI de las 50 economías más grandes del mundo en 2021") +
ylab("Frecuencia")+xlab("Tasa anual del crecimiento del PBI")+
geom_vline(xintercept = mean(locura$GDP_growth_por, na.rm = TRUE), color = "red", linetype = "dashed", size = 1) + # Línea de la media
geom_vline(xintercept = median(locura$GDP_growth_por, na.rm = TRUE), color = "grey", linetype = "dashed", size = 1) + # Línea de la mediana
theme_minimal()
```
2. Análisis factorial {data-icon="fa-solid fa-layer-group"}
=====================================
Column {data-width=500}{.tabset}
-----------------------------------------------------------------------
```{r}
dontselect=c("COUNTRY")
select=setdiff(names(locura),dontselect)
theData=locura[,select]
row.names(theData)=locura$COUNTRY
```
### Correlación de las variables
```{r}
corMatrix=polycor::hetcor(theData)$correlations
ggcorrplot::ggcorrplot(corMatrix)
```
Column {data-width=500}{.tabset}
-----------------------------------------------------------------------
### Prueba KMO
```{r}
psych::KMO(corMatrix)
```
### Prueba de Matriz de Identidad
```{r}
cortest.bartlett(corMatrix,n=nrow(theData))$p.value>0.05
```
### Prueba de Matriz Singular
```{r}
is.singular.matrix(corMatrix)
```
### Factores Recomendados
```{r}
psych::fa.parallel(theData, fa = 'fa',correct = T,plot = F,fm = 'ml')
```
::::: {.scroll-box}
```{r}
resfa <- psych::fa(theData,
nfactors =2,
cor = 'mixed',
rotate = "varimax", #oblimin?
fm="ml")
print(resfa$loadings)
```
:::::
```{r}
print(resfa$loadings,cutoff = 0.5)
```
### Resultados del Análisis Factorial
```{r}
psych::fa.diagram(resfa,main = "Resultados del EFA")
```
```{r}
locura$ice_efa=resfa$scores[,2]
```
2. Análisis Univariado {data-icon="fa-solid fa-chart-simple"}
=====================================
Column {data-width=500}{.tabset}
-----------------------------------------------------------------------
### Histograma con Curva de densidad
```{r}
ggplot(data.frame(locura), aes(x = ice_efa)) +
geom_histogram(aes(y = ..density..),
color = "gray", fill = "white") +
geom_density(fill = "black", alpha = 0.2)
```
### Medidas de dispersión:
```{r}
summary(locura)
```
3. Análisis Bivariado {data-icon="fa-solid fa-chart-simple"}
=====================================
Column {data-width=500}{.tabset}
-----------------------------------------------------------------------
### Gráfico de dispersión 1:
```{r}
ggplot(locura, aes(x=ice_efa, y=exports_gdp_por)) +
geom_point(colour="skyblue") + xlab("Indice de Crecimiento Económico") + ylab("Exportaciones de bienes y servicios") +
ggtitle("Relación entre el Indice de Crecimiento Económico y las exportaicones de bienes y servicios") +
theme_light()+ geom_smooth(method=lm,se=F)
```
### Gráfico de dispersión 2:
```{r}
ggplot(locura, aes(x=ice_efa, y=edu_govexp_gdp)) +
geom_point(colour="skyblue") + xlab("Indice de Crecimiento Económico") + ylab("Gasto del Gobierno en Educación") +
ggtitle("Relación entre el Indice de Crecimiento Económico y el Gasto del Gobierno en Educación") +
theme_light()+ geom_smooth(method=lm,se=F)
```
### Gráfico de dispersión 3:
```{r}
ggplot(locura, aes(x=ice_efa, y=UHC_coverage)) +
geom_point(colour="skyblue") + xlab("Indice de Crecimiento Económico") + ylab("Cobertura del Seguro Universal de Salud") +
ggtitle("Relación entre el Indice de Crecimiento Económico y la Cobertura del Seguro Universal de Salud") +
theme_light()+ geom_smooth(method=lm,se=F)
```
3. Regresiones {data-icon="fa-solid fa-wave-square"}
=====================================
Column {data-width=500}{.tabset}
-----------------------------------------------------------------------
### Regresión Gaussiana: Variables Independientes
```{r}
modelo27=formula(ice_efa~exports_gdp_por+edu_govexp_gdp+inflation_rate+military_gdp+health_exp_gdp+R_._D_exp_GDP+gov_eff+UHC_coverage)
reg27=lm(modelo27,data=locura)
summary(reg27)
```
Column {data-width=500}{.tabset}
-----------------------------------------------------------------------
### Regresión Gaussiana 1:
```{r}
modelo11=formula(ice_efa~exports_gdp_por)
reg11=lm(modelo11,data=locura)
summary(reg11)
```
### Regresión Gaussiana 2:
```{r}
modelo30=formula(ice_efa~edu_govexp_gdp+health_exp_gdp)
reg30=lm(modelo30,data=locura)
summary(reg30)
```
### Regresión Gaussiana 3:
```{r}
modelo31=formula(ice_efa~edu_govexp_gdp+health_exp_gdp+UHC_coverage)
reg31=lm(modelo31,data=locura)
summary(reg31)
```
### Regresión Gaussiana 4:
```{r}
modelo32=formula(ice_efa~edu_govexp_gdp+health_exp_gdp+UHC_coverage+R_._D_exp_GDP)
reg32=lm(modelo32,data=locura)
summary(reg32)
```
6. Análisis conglomerado {data-icon="fa-solid fa-object-ungroup"}
=====================================
Column {data-width=500} {.tabset}
-----------------------------------------------------------------------
### Datos
```{r}
boxplot(BBmisc::normalize(locura[,2:11],method='standardize'))
```
```{r}
dataClus=locura[,c(2:11)]
row.names(dataClus)=locura$COUNTRY
```
```{r}
library(cluster)
g.dist = daisy(dataClus, metric="gower")
```
### Clusters PAM
```{r}
library(factoextra)
fviz_nbclust(dataClus, pam,diss=g.dist,method = "gap_stat",k.max = 10,verbose = F)
```
### Clusters AGNES:
```{r}
fviz_nbclust(dataClus,hcut,diss=g.dist,method = "gap_stat",k.max = 10,verbose = F,hc_func = "agnes")
```
### Clusters DIANA
```{r}
fviz_nbclust(dataClus, hcut,diss=g.dist,method = "gap_stat",k.max = 10,verbose = F,hc_func = "diana")
```
Column {data-width=500} {.tabset}
-----------------------------------------------------------------------
### Datos PAM
```{r}
library(kableExtra)
set.seed(123)
res.pam=pam(g.dist,2,cluster.only = F)
#nueva columna
dataClus$pam=res.pam$cluster
aggregate(.~ pam, data=dataClus,mean)
```
### Silueta PAM
```{r}
fviz_silhouette(res.pam,print.summary = F)
```
### Datos AGNES
```{r}
set.seed(123)
library(factoextra)
res.agnes<- hcut(g.dist, k = 2,hc_func='agnes',hc_method = "ward.D")
dataClus$agnes=res.agnes$cluster
aggregate(.~ agnes, data=dataClus,mean)
```
### Silueta AGNES
```{r}
fviz_silhouette(res.agnes,print.summary = F)
```
### Datos DIANA
```{r}
set.seed(123)
res.diana <- hcut(g.dist, k = 2,hc_func='diana')
dataClus$diana=res.diana$cluster
aggregate(.~ diana, data=dataClus,mean)
```
### Silueta DIANA:
```{r}
fviz_silhouette(res.diana,print.summary = F)
```
7. Conclusiones {data-icon="fa-solid fa-layer-group"}
=====================================
Column {data-width=500}{.tabset}
-----------------------------------------------------------------------
### Hipótesis 1:
```{r}
modelo11=formula(ice_efa~exports_gdp_por)
reg11=lm(modelo11,data=locura)
summary(reg11)
```
### Interpretación Hipótesis 1:
Existe una relación entre las exportaciones en base al porcentaje del PIB y el crecimiento económico medido en el crecimiento del PIB dado que por cada 1% de incremento en exportaciones (en base al porcentaje del PIB), el índice de crecimiento económico aumenta 0.0090 unidades. Ahora, teniendo en cuenta el contexto global del período analizado, podemos también observar que este tipo de crecimiento no se vió afectado por la pandemia de COVID-19.
### Hipótesis 2:
```{r}
modelo30=formula(ice_efa~edu_govexp_gdp+health_exp_gdp)
reg30=lm(modelo30,data=locura)
summary(reg30)
```
### Interpretación Hipótesis 2:
### Hipótesis 3:
```{r}
modelo31=formula(ice_efa~edu_govexp_gdp+health_exp_gdp+UHC_coverage)
reg31=lm(modelo31,data=locura)
summary(reg31)
```
### Interpretación Hipótesis 3:
### Hipótesis 4:
```{r}
modelo32=formula(ice_efa~edu_govexp_gdp+health_exp_gdp+UHC_coverage+R_._D_exp_GDP)
reg32=lm(modelo32,data=locura)
summary(reg32)
```
### Interpretación Hipótesis 4: