library(readxl)
datos <- read_excel("datos.xlsx")
library(plm) # Modelos de datos panel
library(lmtest) # Pruebas estadísticas
## Loading required package: zoo
##
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
##
## as.Date, as.Date.numeric
library(sandwich) # Errores estándar robustos
library(ggplot2) # Gráficos
library(dplyr) # Manipulación de datos
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:plm':
##
## between, lag, lead
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(readxl) # Lectura de archivos Excel
datos <- read_excel("datos.xlsx")
colnames(datos) <- c("Empresa", "Nemotecnico", "Fecha", "ROE", "ROA",
"Tamano_Junta", "Mujeres_Junta", "Porc_Mujeres_Junta", "Rep_Legal")
datos <- datos %>%
mutate(Empresa = as.factor(Empresa),
Fecha = as.Date(Fecha, format = "%m/%d/%Y"),
Anio = format(Fecha, "%Y"))
head(datos)
## # A tibble: 6 × 10
## Empresa Nemotecnico Fecha ROE ROA Tamano_Junta Mujeres_Junta
## <fct> <chr> <date> <dbl> <dbl> <dbl> <dbl>
## 1 RIOPAILA AGRICO… IRP.CN 2023-12-31 6.17 4.13 5 0
## 2 RIOPAILA AGRICO… IRP.CN 2022-12-31 9.74 6.58 5 0
## 3 RIOPAILA AGRICO… IRP.CN 2021-12-31 6.05 4.17 5 0
## 4 RIOPAILA AGRICO… IRP.CN 2020-12-31 3.38 2.29 5 0
## 5 RIOPAILA AGRICO… IRP.CN 2019-12-31 1.96 1.26 5 0
## 6 RIOPAILA AGRICO… IRP.CN 2018-12-31 -2.24 -1.36 5 0
## # ℹ 3 more variables: Porc_Mujeres_Junta <dbl>, Rep_Legal <dbl>, Anio <chr>
ggplot(datos, aes(x = Porc_Mujeres_Junta)) +
geom_histogram(binwidth = 0.05, fill = "blue", alpha = 0.5) +
labs(title = "% de Mujeres en la Junta Directiva", x = "% Mujeres", y = "Frecuencia")
promedio_mujeres <- datos %>%
group_by(Anio) %>%
summarise(Promedio_Porc_Mujeres = mean(Porc_Mujeres_Junta, na.rm = TRUE))
ggplot(promedio_mujeres, aes(x = as.numeric(Anio), y = Promedio_Porc_Mujeres)) +
geom_line(color = "blue") +
geom_point(color = "red") +
scale_x_continuous(breaks = seq(min(as.numeric(promedio_mujeres$Anio)),
max(as.numeric(promedio_mujeres$Anio)), by = 1)) +
labs(title = "Evolución Promedio del % de Mujeres en Junta Directiva",
x = "Año",
y = "% Promedio Mujeres en Junta Directiva") +
theme_minimal()
modelo_roa <- plm(ROA ~ Porc_Mujeres_Junta + Rep_Legal,
data = datos, index = c("Empresa", "Fecha"),
model = "within")
summary(modelo_roa)
## Oneway (individual) effect Within Model
##
## Call:
## plm(formula = ROA ~ Porc_Mujeres_Junta + Rep_Legal, data = datos,
## model = "within", index = c("Empresa", "Fecha"))
##
## Balanced Panel: n = 32, T = 11, N = 352
##
## Residuals:
## Min. 1st Qu. Median 3rd Qu. Max.
## -13.77860 -0.93486 0.10243 1.03155 10.66784
##
## Coefficients:
## Estimate Std. Error t-value Pr(>|t|)
## Porc_Mujeres_Junta 1.89331 1.51397 1.2506 0.2120
## Rep_Legal 0.27739 0.74409 0.3728 0.7095
##
## Total Sum of Squares: 2900.3
## Residual Sum of Squares: 2885.5
## R-Squared: 0.0050919
## Adj. R-Squared: -0.098153
## F-statistic: 0.813763 on 2 and 318 DF, p-value: 0.44411
modelo_roe <- plm(ROE ~ Porc_Mujeres_Junta + Rep_Legal,
data = datos, index = c("Empresa", "Fecha"),
model = "within")
summary(modelo_roe)
## Oneway (individual) effect Within Model
##
## Call:
## plm(formula = ROE ~ Porc_Mujeres_Junta + Rep_Legal, data = datos,
## model = "within", index = c("Empresa", "Fecha"))
##
## Balanced Panel: n = 32, T = 11, N = 352
##
## Residuals:
## Min. 1st Qu. Median 3rd Qu. Max.
## -34.37548 -2.74867 0.17313 2.98752 20.42944
##
## Coefficients:
## Estimate Std. Error t-value Pr(>|t|)
## Porc_Mujeres_Junta 4.0466 3.5915 1.1267 0.2607
## Rep_Legal 2.4291 1.7651 1.3762 0.1697
##
## Total Sum of Squares: 16385
## Residual Sum of Squares: 16238
## R-Squared: 0.0090026
## Adj. R-Squared: -0.093837
## F-statistic: 1.44442 on 2 and 318 DF, p-value: 0.23743
bptest(modelo_roa, studentize = FALSE)
##
## Breusch-Pagan test
##
## data: modelo_roa
## BP = 7.9674, df = 2, p-value = 0.01862
bptest(modelo_roe, studentize = FALSE)
##
## Breusch-Pagan test
##
## data: modelo_roe
## BP = 4.1576, df = 2, p-value = 0.1251
pdwtest(modelo_roa)
##
## Durbin-Watson test for serial correlation in panel models
##
## data: ROA ~ Porc_Mujeres_Junta + Rep_Legal
## DW = 1.4355, p-value = 5.527e-08
## alternative hypothesis: serial correlation in idiosyncratic errors
pdwtest(modelo_roe)
##
## Durbin-Watson test for serial correlation in panel models
##
## data: ROE ~ Porc_Mujeres_Junta + Rep_Legal
## DW = 1.5368, p-value = 6.615e-06
## alternative hypothesis: serial correlation in idiosyncratic errors
library(car)
## Loading required package: carData
##
## Attaching package: 'car'
## The following object is masked from 'package:dplyr':
##
## recode
vif(lm(ROA ~ Porc_Mujeres_Junta + Rep_Legal, data = datos))
## Porc_Mujeres_Junta Rep_Legal
## 1.006886 1.006886
vif(lm(ROE ~ Porc_Mujeres_Junta + Rep_Legal, data = datos))
## Porc_Mujeres_Junta Rep_Legal
## 1.006886 1.006886
Se analizó la relación entre la presencia de mujeres en la junta directiva y el desempeño financiero (ROA y ROE) con modelos de datos panel de efectos fijos por empresa y año. Se realizaron pruebas para verificar los supuestos del modelo.