Este documento presenta un análisis comparativo de la brecha salarial entre México y Estados Unidos, empleando un conjunto de datos sintéticos pero consistentes con la lógica de mercados laborales.
Este es un ejercicio que intenta reproducir la mayoría de los análisis estadísticos llevados a cabo en la asignatura de Métodos Cuantitativos, impartida por el PhD. Carlos Rodríguez en el posgrado de la Facultad de Contaduría y Administración de la UNAM, en el semestre 2026-I.
Los objetivos son:
Fuentes:
CONASAMI (Comisión Nacional de Salarios Mínimos), https://www.gob.mx/conasami
U.S. Department of Labor– Wage and Hour Division, https://www.dol.gov/agencies/whd/minimum-wage
Datos de 2025
| pais | esquema | salario_local | moneda_local | salario_usd | ratio_vs_mx |
|---|---|---|---|---|---|
| MX | Salario mínimo diario | 312.41 | MXN/día | 17.36 | 1.00 |
| USA | Salario mínimo 8 horas | 58.00 | USD/día | 58.00 | 3.34 |
ESTADÍSTICOS GENERALES
| salario_mx_prom | salario_us_prom | brecha_prom_abs | brecha_prom_rel_pct | ratio_promedio |
|---|---|---|---|---|
| 901.67 | 3708.33 | 2806.67 | 324.57 | 4.25 |
COMPARATIVO POR OCUPACIÓN
| ocupacion | sector | salario_mx_usd | salario_us_usd | diferencia | ratio_salario | brecha_relativa |
|---|---|---|---|---|---|---|
| Maestro de educación básica | Educación | 700 | 4000 | 3300 | 5.71 | 471.4 |
| Enfermera general | Salud | 950 | 5200 | 4250 | 5.47 | 447.4 |
| Chofer de transporte | Logística | 700 | 3500 | 2800 | 5.00 | 400.0 |
| Operador de manufactura | Manufactura | 650 | 3000 | 2350 | 4.62 | 361.5 |
| Técnico en mantenimiento | Serv técnicos | 800 | 3600 | 2800 | 4.50 | 350.0 |
| Auxiliar administrativo | Admón y neg | 720 | 2900 | 2180 | 4.03 | 302.8 |
| Contador | Serv prof | 900 | 3500 | 2600 | 3.89 | 288.9 |
| Ingeniero industrial | Manufactura | 1000 | 3800 | 2800 | 3.80 | 280.0 |
| Administrador de empresas | Alta Admón | 850 | 3200 | 2350 | 3.76 | 276.5 |
| Representante de ventas | Comercio | 750 | 2800 | 2050 | 3.73 | 273.3 |
| Analista de datos | Ciencia datos | 1300 | 4200 | 2900 | 3.23 | 223.1 |
| Desarrollador software | Tec Información | 1500 | 4800 | 3300 | 3.20 | 220.0 |
GRÁFICA COMPARATIVA DE SALARIOS POR OCUPACIÓN
datos_long <- datos_salarios %>%
pivot_longer(
cols = c(salario_mx_usd, salario_us_usd),
names_to = "pais",
values_to = "salario_usd"
) %>%
mutate(
pais = recode(
pais,
"salario_mx_usd" = "MX",
"salario_us_usd" = "USA"
)
)
ggplot(datos_long, aes(x = reorder(ocupacion, salario_usd),
y = salario_usd / 1000,
fill = pais)) +
geom_col(position = "dodge") +
coord_flip() +
scale_y_continuous() +
scale_fill_manual(values = c("MX" = "darkgreen",
"USA" = "darkblue")) +
labs(
title = "Comparativo de salarios medios por ocupación",
subtitle = "Graphic by Carlos Rodriguez, PhD",
x = "Ocupación",
y = "Salario mensual (miles de USD)",
fill = "País"
) +
theme_minimal()
Hipótesis nula y prueba t de Student
PLANTEAMIENTO FORMAL DE LA HIPÓTESIS NULA
PRUEBA “t” PAREADA MX VS USA
diferencias <- datos_salarios$diferencia
n <- length(diferencias)
media_diff <- mean(diferencias)
sd_diff <- sd(diferencias)
se_diff <- sd_diff / sqrt(n)
df <- n - 1
prueba_t <- t.test(
x = datos_salarios$salario_us_usd,
y = datos_salarios$salario_mx_usd,
paired = TRUE,
alternative = "greater"
)
t_obs <- as.numeric(prueba_t$statistic)
p_valor <- prueba_t$p.value
ic_diff <- prueba_t$conf.int
resumen_t <- tibble(
Estadístico = c(
"n",
"Media diferencias (USA - MX)",
"Desv. estándar",
"Error estándar",
"t observado",
"Grados de libertad",
"p-valor (cola derecha)"
),
Valor = c(
n,
round(media_diff, 2),
round(sd_diff, 2),
round(se_diff, 2),
round(t_obs, 3),
df,
signif(p_valor, 4)
)
)
kable(resumen_t, caption = "Resultados de la prueba t de Student (pareada, USA > MX)") %>%
kable_styling(full_width = FALSE)
| Estadístico | Valor |
|---|---|
| n | 12.000 |
| Media diferencias (USA - MX) | 2806.670 |
| Desv. estándar | 603.310 |
| Error estándar | 174.160 |
| t observado | 16.115 |
| Grados de libertad | 11.000 |
| p-valor (cola derecha) | 0.000 |
INTERVALO DE CONFIANZA 95% PARA LA DIFERENCIA
| Limite_inferior | Limite_superior |
|---|---|
| 2493.89 | Inf |
DISTRIBUCIÓN “t” DE STUDENT CON REGIÓN DE RECHAZO
t_crit <- qt(1 - alpha, df = df)
t_seq <- seq(-4, 10, length.out = 1000)
dens <- dt(t_seq, df = df)
df_plot <- tibble(t = t_seq, dens = dens)
ggplot(df_plot, aes(x = t, y = dens)) +
geom_line(size = 1, color = "darkblue") +
geom_area(
data = subset(df_plot, t >= t_crit),
aes(y = dens),
alpha = 0.3,
fill = "darkred"
) +
geom_vline(xintercept = t_crit, linetype = "dashed", color = "black") +
geom_vline(xintercept = t_obs, color = "red", linetype = "dotted", size = 1) +
annotate("text",
x = t_crit, y = max(dens) * 0.6,
label = paste0("t crítico = ", round(t_crit, 2)),
hjust = -0.1, angle = 90, color = "black") +
annotate("text",
x = t_obs, y = max(dens) * 0.8,
label = paste0("t obs = ", round(t_obs, 2)),
hjust = -0.1, angle = 90, color = "red") +
labs(
title = "Distribución t de Student con región de rechazo (cola derecha)",
subtitle = "Graphic by Carlos Rodriguez, PhD",
x = "t",
y = "f(t)"
) +
theme_minimal()
HISTOGRAMA Y DENSIDAD DE LAS DIFERENCIAS SALARIALES
df_dif <- tibble(diferencia = diferencias)
ggplot(df_dif, aes(x = diferencia)) +
geom_histogram(aes(y = after_stat(density)),
bins = 8,
fill = "yellow",
color = "darkblue",
alpha = 0.7) +
geom_density(color = "maroon", size = 1.2) +
labs(
title = "Distribución de la diferencia salarial (USA - MX)",
subtitle = "Graphic by Carlos Rodriguez, PhD",
x = "Diferencia salarial mensual (USD)",
y = "Densidad"
) +
theme_minimal()
DECISIÓN SOBRE H₀
Como el p-valor = 2.672e-09 es menor que α = 0.05, se rechaza H₀. La evidencia estadística respalda que el salario promedio en Estados Unidos es mayor que en México para las ocupaciones consideradas.
BOXPLOT GLOBAL MX vs USA
datos_box_global <- datos_salarios %>%
select(ocupacion, salario_mx_usd, salario_us_usd) %>%
pivot_longer(
cols = c(salario_mx_usd, salario_us_usd),
names_to = "pais",
values_to = "salario_usd"
) %>%
mutate(
pais = recode(
pais,
"salario_mx_usd" = "MX",
"salario_us_usd" = "USA"
)
)
ggplot(datos_box_global, aes(x = pais, y = salario_usd, fill = pais)) +
geom_boxplot(alpha = 0.7) +
scale_y_continuous(labels = dollar_format(prefix = "USD $")) +
labs(
title = "Distribución salarial global: MX vs USA",
subtitle = "Graphic by Carlos Rodriguez, PhD",
x = "País",
y = "Salario mensual (USD)"
) +
theme_minimal() +
theme(legend.position = "none")
ANOVA de la DIFERENCIA SALARIAL por SECTOR
| term | df | sumsq | meansq | statistic | p.value |
|---|---|---|---|---|---|
| sector | 10 | 3902617 | 390261.7 | 3.8544 | 0.3784 |
| Residuals | 1 | 101250 | 101250.0 | NA | NA |
BOXPLOTS POR SECTOR Y PAÍS
if (!"sector" %in% names(datos_salarios)) {
stop("❌ 'datos_salarios' no contiene la columna 'sector'.")
}
datos_box_sector <- datos_salarios %>%
select(ocupacion, sector, salario_mx_usd, salario_us_usd) %>%
pivot_longer(
cols = c(salario_mx_usd, salario_us_usd),
names_to = "pais",
values_to = "salario_usd"
) %>%
mutate(
pais = recode(
pais,
"salario_mx_usd" = "MX",
"salario_us_usd" = "USA"
)
)
ggplot(datos_box_sector, aes(x = pais, y = salario_usd, fill = pais)) +
geom_boxplot(alpha = 0.7) +
facet_wrap(~ sector, scales = "free_y") +
scale_y_continuous(labels = dollar_format(prefix = "USD $")) +
labs(
title = "Distribución salarial por sector y país",
subtitle = "Graphic by Carlos Rodriguez, PhD",
x = "País",
y = "Salario mensual (USD)"
) +
theme_minimal() +
theme(legend.position = "bottom")
CORRELACIÓN ENTRE SALARIOS MX y USA
| Variable_X | Variable_Y | Correlacion |
|---|---|---|
| Salario MX (USD) | Salario USA (USD) | 0.665 |
GRÁFICA DE HEATMAP DE CORRELACIÓN (variables salariales)
MODELO DE REGRESIÓN LINEAL
| term | estimate | std.error | statistic | p.value |
|---|---|---|---|---|
| (Intercept) | 1991.1140 | 632.6731 | 3.1471 | 0.0104 |
| salario_mx_usd | 1.9045 | 0.6764 | 2.8156 | 0.0183 |
GRÁFICA DE REGRESIÓN SALARIAL MX → USA
ggplot(datos_salarios, aes(x = salario_mx_usd, y = salario_us_usd)) +
geom_point(color = "red", size = 3) +
geom_smooth(method = "lm", se = TRUE, color = "darkblue") +
labs(
title = "Relación lineal entre salarios MX y USA",
subtitle = "Graphic by Carlos Rodriguez, PhD",
x = "Salario en México (USD mensuales)",
y = "Salario en Estados Unidos (USD mensuales)"
) +
theme_minimal()
SOBRE LA HIPÓTESIS NULA Y LA BRECHA SALARIAL