wvs |>
count(kota_desa)# A tibble: 2 × 2
kota_desa n
<chr> <int>
1 Pedesaan 2098
2 Perkotaan 785
\[ \mathrm{SD} (\hat{p}) = \sqrt{\frac {p (1 - p)} {n}} \]
\[ -1.96 \cdot \mathrm{SD} (\hat{p}) < \hat{p} - p < 1.96 \cdot \mathrm{SD} (\hat{p}) \]
\[ \mathrm{SE} (\hat{p}) = \sqrt{\frac {\hat{p} (1 - \hat{p})} {n}} \]
\[ \frac {\hat{p} - p} {\mathrm{SE} (\hat{p})} = \frac {\mathrm{observed} - \mathrm{expected}} {\mathrm{SE}} \]
\[ -1.96 \cdot \mathrm{SE} (\hat{p}) < \hat{p} - p < 1.96 \cdot \mathrm{SE} (\hat{p}) \]
\[ \hat{p} - 1.96 \cdot \mathrm{SE} (\hat{p}) < p < \hat{p} + 1.96 \cdot \mathrm{SE} (\hat{p}) \]
\[ Z = \frac {\bar{x} - \mu} {\sigma \mathbin{/} \sqrt{n}} = \frac {\bar{x} - \mu} {\mathrm{SD} (\hat{x})} \]
\[ T = \frac {\bar{x} - \mu} {s \mathbin{/} \sqrt{n}} = \frac {\bar{x} - \mu} {\mathrm{SE} (\bar{x})} = \frac {\mathrm{observed} - \mathrm{expected}} {\mathrm{SE}} \] \[ P \left( -t ^* < \frac {\bar{x} - \mu} {\mathrm{SE} (\bar{x})} < t ^* \right) = 1 - \alpha \]
\[ P \left( \bar{x} - t ^* \cdot \mathrm{SE} < \mu < \bar{x} + t ^* \cdot \mathrm{SE} \right) = 1 - \alpha \]
\[ \bar{x} \pm t ^* \mathrm{SE} (\bar{x}) \]
xbar <- 66
s <- 4
n <- 30
alpha <- 1 - 0.95
t_star <- qt(1 - alpha / 2, df = n - 1)
se <- s / sqrt(n)
moe <- t_star * se
xbar + c(-1,1) * moe[1] 64.50638 67.49362