<div dir="ltr"><font face="arial, sans-serif" style="font-family:arial,sans-serif;font-size:12.727272033691406px">Ainda trabalhando com os 50 municipios mais populosos do Brasil, divido a população em dois estratos, onde no primeiro estrato esteja os 10 mais populosos e no segundo os 40 restantes.</font><br style="font-family:arial,sans-serif;font-size:12.727272033691406px">
<span style="font-family:arial,sans-serif;font-size:12.727272033691406px">Preciso obter uma amostra com reposição de 10 municípios usando o alocação proporcional e calcular a estimativa da média e variancia.</span><br style="font-family:arial,sans-serif;font-size:12.727272033691406px">
<span style="font-family:arial,sans-serif;font-size:12.727272033691406px">Alguém pode ajudar?<br></span><br>Estou com dúvida aqui, pois preciso encontrar uma maneira de alocar proporcionalmente a população inteira e não apenas o estrato 2<br>
<br><div style="font-family:arial,sans-serif;font-size:12.727272033691406px"><span style="font-size:13px">pop = c(11376685,6390290,2710968,</span><span style="font-size:13px">2648532,2500532,2395785,</span><span style="font-size:13px">1861838,1776761,1555039,</span><span style="font-size:13px">1416014,1410430,1333767,</span><span style="font-size:13px">1244518,1098630,1039610,</span><span style="font-size:13px">1016128,953393,867067,830231,</span><span style="font-size:13px">817590,805397,801746,774886,</span><span style="font-size:13px">742428,680496,668877,654786,</span><span style="font-size:13px">643603,619746,619536,613815,</span><span style="font-size:13px">600692,587701,568099,561329,</span><span style="font-size:13px">526338,525225,515707,491807,</span><span style="font-size:13px">483821,474596,474596,472300,</span><span style="font-size:13px">460062,446911,442701,433158,</span><span style="font-size:13px">425169,424948,422569)</span></div>
<div style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px"># order</div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">
pop <- sort(pop, T)<br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px"># Alocação </div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">
sub1 <- pop[(1:10)]<br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">sub2 <- pop[(11:50)]<br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br></div>
<div style="font-family:arial,sans-serif;font-size:12.727272033691406px"># Alocação proporcional DÚVIDA</div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">prop <- sub2/sum(sub2) </div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">
<br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px"><span style="font-size:13px"> set.seed(51)</span><br></div><div class="gmail_extra" style="font-family:arial,sans-serif;font-size:12.727272033691406px">
<span style="font-size:13px">sub3</span><span style="font-size:13px"> <- sample(sub2, 10, replace=TRUE, prob=prop)</span></div></div>