\[H_0: p1 = p2\\ H_1: p1 \neq p2\]
\(\alpha = 0.05\)
\[z = \frac{\hat{p_1}-\hat{p_2}}{\sqrt{\frac{p_1(1-p_1)}{n_1}+\frac{p_2(1-p_2)}{n_2}}}\]
\[z = \frac{0.38-0.35}{\sqrt{\frac{0.38(1-0.38)}{150}+\frac{0.35(1-0.35)}{100}}} = 0.48\]
# Estadístico calculado
numerador <- 0.38 - 0.35
denominador <- sqrt(((0.38*0.62)/150)+((0.35*0.65)/100))
z_calculado <- numerador / denominador
z_calculado
## [1] 0.4837661
qnorm(p = 0.025, mean = 0, sd = 1, lower.tail = TRUE)
## [1] -1.959964
qnorm(p = 0.025, mean = 0, sd = 1, lower.tail = FALSE)
## [1] 1.959964
prop.test()
x:
número de casos exitosos.n:
número total de casos.p:
proporción a contrastar.alternative:
tipo de hipótesis alternativa.conf.level:
nivel de confianza.prop.test(x = c(57, 35), n = c(150, 100), alternative = "two.sided",
conf.level = 0.95)
##
## 2-sample test for equality of proportions with continuity
## correction
##
## data: c(57, 35) out of c(150, 100)
## X-squared = 0.12111, df = 1, p-value = 0.7278
## alternative hypothesis: two.sided
## 95 percent confidence interval:
## -0.09987744 0.15987744
## sample estimates:
## prop 1 prop 2
## 0.38 0.35