[1] 15 13 15 11 16 21 19 14 15 12
18 décembre 2024
echantillon = dplyr::slice_sample(population, n = 31)
mean_revenu = mean(echantillon$revenu)
proportion_celibataires = sum(echantillon$celibataire == 1) / 31
echantillon |> as_tibble()
mean_revenu
proportion_celibataires
# A tibble: 31 × 2
revenu celibataire
<dbl> <int>
1 1454. 0
2 1647. 1
3 747. 0
4 2049. 1
5 1362. 1
6 1786. 0
7 1124. 0
8 652. 0
9 2182. 0
10 1380. 0
# ℹ 21 more rows
[1] 1384.903
[1] 0.2258065