<div>Veja se é isso:<br /><br /><strong># População:</strong><br /><br /> pop <- c(11376685,6390290,2710968,2648532,2500532,2395785,1861838,1776761,<br /> 1555039,1416014,1410430,1333767,1244518,1098630,1039610,1016128,953393,<br /> 867067,830231,817590,805397,801746,774886,742428,680496,668877,654786,<br /> 643603,619746,619536,613815,600692,587701,568099,561329,526338,525225,<br /> 515707,491807,483821,474596,474596,472300,460062,446911,442701,433158,<br /> 425169,424948,422569)<br /><br /> Npop <- length(pop)<br /><br /><strong># Estratos:</strong><br /><br />  EstI <- c(11376685,6390290,2710968,2648532,2500532,2395785,1861838,1776761,<br />           1555039,1416014)<br /><br /> EstII <- c(1410430,1333767,1244518,1098630,1039610,1016128,953393,867067,<br /> 830231,817590,805397,801746,774886,742428,680496,668877,654786,643603,619746,<br /> 619536,613815,600692,587701,568099,561329,526338,525225,515707,491807,483821,<br />Â
474596,474596,472300,460062,446911,442701,433158,425169,424948,422569)<br /><br /> nEstI<-length(EstI)<br /> nEstII<-length(EstII)<br /><br /><strong># Amostras:</strong><br /><br /> set.seed(2013)<br /> A1 <- sample(EstI,5)<br /> A2 <- sample(EstII,5)<br /><br /><strong># Estimativas:</strong><br /><br /> Médias <- c(mean(A1),mean(A2))<br /> Variâncias <- c(var(A1),var(A2))<br /> Desv_Pad <- sqrt(Variâncias)<br /><br /> Result <- data.frame(Médias,Variâncias,Desv_Pad)<br /> rownames(Result) <- c("EstI","EstII")<br /> Result<br /><br /><em>Att.</em><br /><em>André</em><br /><br /></div>
<hr style="border-top: 1px solid #ccc;" />
<div>Em 26/04/2013 01:56, <strong>Matheus Monteiro < matheusmont@gmail.com ></strong> escreveu:</div>
<div dir="ltr">Estou trabalhando com os 50 municipios mais populosos do Brasil, foi pedido para dividir a população em dois estratos, onde no primeiro estrato esteja os 10 mais populosos e no segundo o restante.<br />Preciso obter uma amostra de 5 municÃpios de cada estrato e calcular a estimativa da media amostral e variancia.<br /> Sei que preciso instalar o pacote gtools mas não estou conseguindo.<br />Não estou conseguindo, alguém pode ajudar?<br />Por enquanto está assim:<br />
<div>Â </div>
<div>pop = c(11376685,6390290,2710968,2648532,2500532,2395785,1861838,1776761,1555039,1416014,1410430,1333767,1244518,1098630,1039610,1016128,953393,867067,830231,817590,805397,801746,774886,742428,680496,668877,654786,643603,619746,619536,613815,600692,587701,568099,561329,526338,525225,515707,491807,483821,474596,474596,472300,460062,446911,442701,433158,425169,424948,422569)</div>
<div>Â </div>
<div>Npop=length(pop)</div>
<div>Â </div>
<div>Npop</div>
<div>Â </div>
<div>EstI=c(11376685,6390290,2710968,2648532,2500532,2395785,1861838,1776761,1555039,1416014)</div>
<div>Â </div>
<div>EstII=c(1410430,1333767,1244518,1098630,1039610,1016128,953393,867067,830231,817590,805397,801746,774886,742428,680496,668877,654786,643603,619746,619536,613815,600692,587701,568099,561329,526338,525225,515707,491807,483821,474596,474596,472300,460062,446911,442701,433158,425169,424948,422569)</div>
<div>Â </div>
<div>nEstI=length(EstI)</div>
<div>Â </div>
<div>nEstII=length(EstII)</div>
</div>
<div>Â </div>