Skip to content

Commit

Permalink
merge brechas
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniOlivaresCollio committed Sep 17, 2024
1 parent 77b31b6 commit 330d28c
Show file tree
Hide file tree
Showing 21 changed files with 169 additions and 310 deletions.
2 changes: 1 addition & 1 deletion .Rproj.user/EC41330D/pcs/source-pane.pper
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"activeTab": 0
"activeTab": 2
}
12 changes: 6 additions & 6 deletions .Rproj.user/EC41330D/pcs/windowlayoutstate.pper
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"left": {
"splitterpos": 179,
"splitterpos": 233,
"topwindowstate": "NORMAL",
"panelheight": 744,
"windowheight": 782
"panelheight": 959,
"windowheight": 997
},
"right": {
"splitterpos": 463,
"splitterpos": 596,
"topwindowstate": "NORMAL",
"panelheight": 744,
"windowheight": 782
"panelheight": 959,
"windowheight": 997
}
}
8 changes: 4 additions & 4 deletions .Rproj.user/EC41330D/sources/per/t/66F09476
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"path": "C:/Users/danie/Documents/fondecyt/minicoes-huelgas/mybook/_quarto.yml",
"project_path": "mybook/_quarto.yml",
"type": "yaml",
"hash": "1169045749",
"hash": "2060925020",
"contents": "",
"dirty": false,
"created": 1726144966272.0,
Expand All @@ -12,15 +12,15 @@
"properties": {
"source_window_id": "",
"Source": "Source",
"cursorPosition": "17,16",
"cursorPosition": "5,32",
"scrollLine": "0"
},
"folds": "",
"lastKnownWriteTime": 1726148321,
"lastKnownWriteTime": 1726589141,
"encoding": "UTF-8",
"collab_server": "",
"source_window": "",
"last_content_update": 1726148321863,
"last_content_update": 1726589141998,
"read_only": false,
"read_only_alternatives": []
}
4 changes: 2 additions & 2 deletions .Rproj.user/EC41330D/sources/per/t/66F09476-contents
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ project:

book:
title: "Mini-COES Huelgas"
author: "Daniela Olivares Collío"
date: "12-09-2024"
author: "Daniela, Kevin, Pablo"
date: "09-17-2024"
chapters:
- index.qmd
- 01-exploracion.qmd
Expand Down
10 changes: 5 additions & 5 deletions .Rproj.user/EC41330D/sources/per/t/81C3E99C
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"path": "C:/Users/danie/Documents/fondecyt/minicoes-huelgas/mybook/01-exploracion.qmd",
"project_path": "mybook/01-exploracion.qmd",
"type": "quarto_markdown",
"hash": "1087394086",
"hash": "3230283438",
"contents": "",
"dirty": false,
"created": 1726145776441.0,
Expand All @@ -12,16 +12,16 @@
"properties": {
"source_window_id": "",
"Source": "Source",
"cursorPosition": "111,0",
"scrollLine": "103",
"cursorPosition": "447,5",
"scrollLine": "422",
"docOutlineVisible": "1"
},
"folds": "",
"lastKnownWriteTime": 1726155560,
"lastKnownWriteTime": 1726589245,
"encoding": "UTF-8",
"collab_server": "",
"source_window": "",
"last_content_update": 1726155829695,
"last_content_update": 1726589245578,
"read_only": false,
"read_only_alternatives": []
}
107 changes: 101 additions & 6 deletions .Rproj.user/EC41330D/sources/per/t/81C3E99C-contents
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

```{r cargar-paquetes-2,echo=FALSE,warning=FALSE,message=FALSE}
rm(list=ls())

options(scipen = 999)
library(pacman)
p_load(tidyverse,
knitr,
Expand Down Expand Up @@ -34,7 +34,7 @@ p_load(tidyverse,
```

```{r datos-2,echo=FALSE}
load("../input/data/ELSOC_Long.RData")
load(here::here("input/data/ELSOC_Long.RData"))
```

Primero, se realiza una revisión exploratoria de las variables de interés, considerando todas las olas de la base de datos, tanto para la muestra original como la de refresco, sin ponderar.
Expand All @@ -49,12 +49,18 @@ data <- elsoc_long_2016_2022 %>%
m03,ciuo88_m03,ciuo08_m03, # caract ocupacional
m04,ciiu3_m04,ciiu4_m04, # caract ocupacional
c12_04, # membresia sindicato
c08_03, # freq participa huelgas
c08_02, # freq participa marchas
marcha=c08_03, # freq participa huelgas
mov_valora=c20,mov_valora_otro=c20_otro, # mov que mas valora
c21_01,c21_02,c21_03,c21_04,c21_05,c21_06, # caract mov valora
c21_07,c21_08,c21_09,c21_10,c21_11,c22,c23,c24, # caract mov valora
c13,c14_01,c14_02 # interes politica
)
c13,c14_01,c14_02, # interes politica
perc_gerente=d03_01, # Salario percibido gerente
perc_obrero=d03_02, # Salario percibido obrero
just_gerente=d04_01, # Salario justo gerente
just_obrero=d04_02 # Salario justo obrero
)%>%
sjlabelled::set_na(., na = c(-999, -888, -777, -666))
```

Se comienza con 18.035 observaciones.
Expand Down Expand Up @@ -172,7 +178,7 @@ Por lo tanto, se realiza una recodificación generando una nueva variable donde

```{r,echo=FALSE,message=FALSE,warning=FALSE}
# Carga bbdd con comparacion 88 y 08
isco08_88 <- read_excel("../input/isco08-88.xls")
isco08_88 <- read_excel(here::here("input/isco08-88.xls"))
isco08_88 <- isco08_88 %>%
rename(isco08=`ISCO 08 Code`,isco88=`ISCO-88 code`)

Expand Down Expand Up @@ -363,3 +369,92 @@ sjt.xtab(data$class_2, data$ola,
title = "Frecuencias y porcentajes de la Posición de clase 2, por ola")
```

### Alluvial


# Brechas salariales

Eliminamos los casos que responden '0' en salario.
{revisar si se deberían eliminar también los que responden 1}

```{r}
summary(data$perc_gerente)
data <- data %>% filter(perc_gerente>0)
data <- data %>% filter(perc_obrero>0)
data <- data %>% filter(just_gerente>0)
data <- data %>% filter(just_obrero>0)
summary(data$perc_gerente)
```


```{r}
data$brecha_perc <- log(data$perc_gerente/data$perc_obrero)
data$brecha_just <- log(data$just_gerente/data$just_obrero)
data$brecha_gerente <- log(data$perc_gerente/data$just_gerente)
data$brecha_obrero <- log(data$perc_obrero/data$just_obrero)
```

```{r}
summary(data$brecha_perc)
```

* Brecha > 0: El salario percibido gerente es mayor que el salario percibido obrero.
* Brecha = 0: El salario percibido gerente es igual al salario percibido obrero (equidad).
* Brecha < 0: El salario percibido gerente es menor que el salario percibido obrero.

```{r}
summary(data$brecha_just)
```

* Brecha > 0: El salario de un gerente debería ser mayor que el salario obrero.
* Brecha = 0: El salario de un gerente debería ser igual al salario obrero (equidad).
* Brecha < 0: El salario de un gerente debería ser menor que el salario obrero.

```{r}
summary(data$brecha_gerente)
```

* Brecha > 0: El salario percibido de un gerente es mayor que el salario que debería tener (sobrepago).
* Brecha = 0: El salario percibido de un gerente es igual al salario que debería tener (equidad).
* Brecha < 0: El salario percibido de un gerente es menor que el salario que debería tener (infra-pago).

```{r}
summary(data$brecha_obrero)
```

* Brecha > 0: El salario percibido de un obrero es mayor que el salario que debería tener (sobrepago).
* Brecha = 0: El salario percibido de un obrero es igual al salario que debería tener (equidad).
* Brecha < 0: El salario percibido de un obrero es menor que el salario que debería tener (infra-pago).

## Regresiones

### Ola

```{r}
data$ola <- factor(data$ola)
```


```{r results='asis'}
reg1 <- lm(brecha_perc~ola, data=data)
reg2 <- lm(brecha_just~ola, data=data)
reg3 <- lm(brecha_gerente~ola, data=data)
reg4 <- lm(brecha_obrero~ola, data=data)

texreg::htmlreg(list(reg1, reg2, reg3, reg4),
custom.model.names=c("Brecha percibida", "Brecha justa", "Brecha gerente", "Brecha obrero"))
```

### Ola + marcha

```{r results='asis'}
reg1 <- lm(brecha_perc~ola+marcha, data=data)
reg2 <- lm(brecha_just~ola+marcha, data=data)
reg3 <- lm(brecha_gerente~ola+marcha, data=data)
reg4 <- lm(brecha_obrero~ola+marcha, data=data)

texreg::htmlreg(list(reg1, reg2, reg3, reg4),
custom.model.names=c("Brecha percibida", "Brecha justa", "Brecha gerente", "Brecha obrero"))
```


2 changes: 1 addition & 1 deletion .Rproj.user/EC41330D/sources/prop/3FE0B19D
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"source_window_id": "",
"Source": "Source",
"cursorPosition": "17,16",
"cursorPosition": "5,32",
"scrollLine": "0"
}
4 changes: 2 additions & 2 deletions .Rproj.user/EC41330D/sources/prop/AFD47782
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"source_window_id": "",
"Source": "Source",
"cursorPosition": "111,0",
"scrollLine": "103",
"cursorPosition": "447,5",
"scrollLine": "422",
"docOutlineVisible": "1"
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"chunk_definitions":[{"row":33,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","label":"cargar-paquetes-2","warning":false,"message":false,"dev":"png"},"document_id":"81C3E99C","chunk_id":"c5d1vi3obdrst","chunk_label":"cargar-paquetes-2"},{"row":37,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","label":"datos-2","dev":"png"},"document_id":"81C3E99C","chunk_id":"cpqee69o83nu3","chunk_label":"datos-2"},{"row":57,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","label":"seleccion","dev":"png"},"document_id":"81C3E99C","chunk_id":"czq2zfw0o396y","chunk_label":"seleccion"},{"row":103,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","label":"unnamed-chunk-1","dev":"png"},"document_id":"81C3E99C","chunk_id":"chogxpruzybd3","chunk_label":"unnamed-chunk-2"},{"row":119,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","label":"unnamed-chunk-2","dev":"png"},"document_id":"81C3E99C","chunk_id":"cf23ot32q8zrp","chunk_label":"unnamed-chunk-3"}],"doc_write_time":1726155547}
{"chunk_definitions":[],"doc_write_time":1726588863}

This file was deleted.

1 change: 0 additions & 1 deletion .Rproj.user/shared/notebooks/paths
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
C:/Users/danie/Documents/fondecyt/efectos-huelgas/01-exploracion.Rmd="9AAA52B9"
C:/Users/danie/Documents/fondecyt/minicoes-huelgas/mybook/01-exploracion.qmd="F3C603CA"
C:/Users/danie/Documents/fondecyt/minicoes-huelgas/mybook/index.qmd="45152BE5"
C:/Users/danie/Documents/fondecyt/minicoes-huelgas/mybook/summary.qmd="CF7244EC"
11 changes: 2 additions & 9 deletions mybook/.quarto/_freeze/01-exploracion/execute-results/html.json

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions mybook/.quarto/idx/01-exploracion.qmd.json

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions mybook/.quarto/xref/02d719da
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
<<<<<<< HEAD
{"entries":[],"options":{"chapters":true},"headings":["caracterización-empleo","actividad-principal","relación-de-empleo","ocupación","nivel-de-cualificación","supervisión","class"]}
=======
{"headings":["caracterización-empleo","actividad-principal","relación-de-empleo","ocupación","nivel-de-cualificación","supervisión","class","alluvial","brechas-salariales","regresiones","ola","ola-marcha"],"options":{"chapters":true},"entries":[]}
>>>>>>> 7aed0a61320086aea0fc44c9a5f3ebe91aceeb4d
{"options":{"chapters":true},"entries":[],"headings":["caracterización-empleo","actividad-principal","relación-de-empleo","ocupación","nivel-de-cualificación","supervisión","class","alluvial","brechas-salariales","regresiones","ola","ola-marcha"]}
2 changes: 1 addition & 1 deletion mybook/.quarto/xref/f104748f
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"headings":["presentación"],"entries":[],"options":{"chapters":true}}
{"entries":[],"options":{"chapters":true},"headings":["presentación"]}
2 changes: 1 addition & 1 deletion mybook/01-exploracion.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ texreg::htmlreg(list(reg1, reg2, reg3, reg4),
custom.model.names=c("Brecha percibida", "Brecha justa", "Brecha gerente", "Brecha obrero"))
```

### ola + marcha
### Ola + marcha

```{r results='asis'}
reg1 <- lm(brecha_perc~ola+marcha, data=data)
Expand Down
Loading

0 comments on commit 330d28c

Please sign in to comment.