1 Carga y exploración de 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>

2 Análisis descriptivo

# Cargar paquetes
library(dplyr)
library(plm)
library(lmtest)

# Asegurarse que Anio sea numérico
datos <- datos %>%
  mutate(Anio = as.numeric(Anio))

# Crear panel
panel_datos <- pdata.frame(datos, index = c("Empresa", "Anio"))

3 Modelo ROE

# Modelo para ROE
modelo_roe_fe <- plm(ROE ~ Porc_Mujeres_Junta + Rep_Legal, data = panel_datos, model = "within")
modelo_roe_re <- plm(ROE ~ Porc_Mujeres_Junta + Rep_Legal, data = panel_datos, model = "random")

# Test de Hausman para ROE
hausman_roe <- phtest(modelo_roe_fe, modelo_roe_re)

# Test de Breusch-Pagan (LM test) para ROE (para ver si RE es mejor que OLS)
modelo_roe_pool <- plm(ROE ~ Porc_Mujeres_Junta, data = panel_datos, model = "pooling")
bp_roe <- plmtest(modelo_roe_pool, type = "bp")

summary(modelo_roe_re)
## Oneway (individual) effect Random Effect Model 
##    (Swamy-Arora's transformation)
## 
## Call:
## plm(formula = ROE ~ Porc_Mujeres_Junta + Rep_Legal, data = panel_datos, 
##     model = "random")
## 
## Balanced Panel: n = 32, T = 11, N = 352
## 
## Effects:
##                  var std.dev share
## idiosyncratic 51.062   7.146  0.46
## individual    59.842   7.736  0.54
## theta: 0.7317
## 
## Residuals:
##      Min.   1st Qu.    Median   3rd Qu.      Max. 
## -35.73353  -2.67152  -0.11726   3.25438  24.42244 
## 
## Coefficients:
##                    Estimate Std. Error z-value  Pr(>|z|)    
## (Intercept)        8.340996   1.514500  5.5074 3.641e-08 ***
## Porc_Mujeres_Junta 0.042303   0.034644  1.2211    0.2221    
## Rep_Legal          2.654427   1.702958  1.5587    0.1191    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    17915
## Residual Sum of Squares: 17732
## R-Squared:      0.010182
## Adj. R-Squared: 0.0045098
## Chisq: 3.59011 on 2 DF, p-value: 0.16612
hausman_roe
## 
##  Hausman Test
## 
## data:  ROE ~ Porc_Mujeres_Junta + Rep_Legal
## chisq = 0.25378, df = 2, p-value = 0.8808
## alternative hypothesis: one model is inconsistent
bp_roe
## 
##  Lagrange Multiplier Test - (Breusch-Pagan)
## 
## data:  ROE ~ Porc_Mujeres_Junta
## chisq = 476.27, df = 1, p-value < 2.2e-16
## alternative hypothesis: significant effects

4 Modelo ROA

# Modelo para ROA
modelo_roa_fe <- plm(ROA ~ Porc_Mujeres_Junta + Rep_Legal, data = panel_datos, model = "within")
modelo_roa_re <- plm(ROA ~ Porc_Mujeres_Junta + Rep_Legal, data = panel_datos, model = "random")

# Test de Hausman para ROA
hausman_roa <- phtest(modelo_roa_fe, modelo_roa_re)

# Test de Breusch-Pagan para ROA
modelo_roa_pool <- plm(ROA ~ Porc_Mujeres_Junta, data = panel_datos, model = "pooling")
bp_roa <- plmtest(modelo_roa_pool, type = "bp")

# Resultados
summary(modelo_roa_re)
## Oneway (individual) effect Random Effect Model 
##    (Swamy-Arora's transformation)
## 
## Call:
## plm(formula = ROA ~ Porc_Mujeres_Junta + Rep_Legal, data = panel_datos, 
##     model = "random")
## 
## Balanced Panel: n = 32, T = 11, N = 352
## 
## Effects:
##                  var std.dev share
## idiosyncratic  9.074   3.012 0.377
## individual    15.009   3.874 0.623
## theta: 0.7718
## 
## Residuals:
##      Min.   1st Qu.    Median   3rd Qu.      Max. 
## -13.89580  -1.03237  -0.17534   1.03119  11.43483 
## 
## Coefficients:
##                    Estimate Std. Error z-value  Pr(>|z|)    
## (Intercept)        3.138286   0.738613  4.2489 2.148e-05 ***
## Porc_Mujeres_Junta 0.021036   0.014750  1.4262    0.1538    
## Rep_Legal          0.401232   0.725002  0.5534    0.5800    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    3176.6
## Residual Sum of Squares: 3156.6
## R-Squared:      0.0062905
## Adj. R-Squared: 0.00059587
## Chisq: 2.20928 on 2 DF, p-value: 0.33133
hausman_roa
## 
##  Hausman Test
## 
## data:  ROA ~ Porc_Mujeres_Junta + Rep_Legal
## chisq = 0.82605, df = 2, p-value = 0.6616
## alternative hypothesis: one model is inconsistent
bp_roa
## 
##  Lagrange Multiplier Test - (Breusch-Pagan)
## 
## data:  ROA ~ Porc_Mujeres_Junta
## chisq = 645.59, df = 1, p-value < 2.2e-16
## alternative hypothesis: significant effects

5 Modelos con variables de control

modelo_roa_re_ctrl <- plm(ROA ~ Porc_Mujeres_Junta + Tamano_Junta + Rep_Legal + factor(Anio),
                          data = panel_datos, model = "random")
summary(modelo_roa_re_ctrl)
## Oneway (individual) effect Random Effect Model 
##    (Swamy-Arora's transformation)
## 
## Call:
## plm(formula = ROA ~ Porc_Mujeres_Junta + Tamano_Junta + Rep_Legal + 
##     factor(Anio), data = panel_datos, model = "random")
## 
## Balanced Panel: n = 32, T = 11, N = 352
## 
## Effects:
##                  var std.dev share
## idiosyncratic  9.150   3.025 0.381
## individual    14.868   3.856 0.619
## theta: 0.7698
## 
## Residuals:
##     Min.  1st Qu.   Median  3rd Qu.     Max. 
## -13.0566  -1.0725  -0.1595   1.0645  11.4355 
## 
## Coefficients:
##                      Estimate Std. Error z-value Pr(>|z|)
## (Intercept)         1.7943258  2.0407943  0.8792   0.3793
## Porc_Mujeres_Junta  0.0187030  0.0173722  1.0766   0.2817
## Tamano_Junta        0.2024458  0.2764550  0.7323   0.4640
## Rep_Legal           0.3693875  0.7391765  0.4997   0.6173
## factor(Anio)2014   -0.0079409  0.7551993 -0.0105   0.9916
## factor(Anio)2015    0.0980519  0.7565344  0.1296   0.8969
## factor(Anio)2016    0.2097068  0.7657754  0.2738   0.7842
## factor(Anio)2017   -0.0434061  0.7678077 -0.0565   0.9549
## factor(Anio)2018   -0.4675181  0.7709117 -0.6064   0.5442
## factor(Anio)2019    0.2708168  0.7677299  0.3528   0.7243
## factor(Anio)2020   -0.7344306  0.7763897 -0.9460   0.3442
## factor(Anio)2021    0.4511446  0.7897960  0.5712   0.5679
## factor(Anio)2022    0.9093640  0.7993759  1.1376   0.2553
## factor(Anio)2023   -0.6348824  0.8185599 -0.7756   0.4380
## 
## Total Sum of Squares:    3181.3
## Residual Sum of Squares: 3080.4
## R-Squared:      0.031715
## Adj. R-Squared: -0.0055264
## Chisq: 11.0709 on 13 DF, p-value: 0.60488

6 Verificación de supuestos

6.1 Heterocedasticidad (Test de Breusch-Pagan)

## 
##  Breusch-Pagan test
## 
## data:  modelo_roa_re
## BP = 7.9674, df = 2, p-value = 0.01862
## 
##  Breusch-Pagan test
## 
## data:  modelo_roe_re
## BP = 4.1576, df = 2, p-value = 0.1251

6.2 Autocorrelación (Test de Wooldridge)

## 
##  Durbin-Watson test for serial correlation in panel models
## 
## data:  ROA ~ Porc_Mujeres_Junta + Rep_Legal
## DW = 1.3455, p-value = 2.615e-10
## alternative hypothesis: serial correlation in idiosyncratic errors
## 
##  Durbin-Watson test for serial correlation in panel models
## 
## data:  ROE ~ Porc_Mujeres_Junta + Rep_Legal
## DW = 1.4284, p-value = 2.75e-08
## alternative hypothesis: serial correlation in idiosyncratic errors

6.3 Multicolinealidad (VIF)

## Porc_Mujeres_Junta          Rep_Legal 
##           1.006886           1.006886
## Porc_Mujeres_Junta          Rep_Legal 
##           1.006886           1.006886