<div dir="ltr">Uma solução. <div><br></div><div>O comando retorna um dataframe contendo uma coluna com as médias e outra com os desvios. A partir daí fazer os graficos fica a seu sabor.</div><div><br></div><div><div>populacao <- rchisq(100000, df = 10)</div><div>tamanhoAmostra <- c(6,14,16,18,20)</div><div><br></div><div>##x:dados a serem amostrados</div><div>##n= tamanho da amostra</div><div>##r =número de repetições. deve ser um valor inteiro</div><div>amostra <- function(x,n,r){</div><div> a <- list() ##guarda as amostras</div><div> rptn <- list() ##guarda a repetição da amostragem</div><div> </div><div> for(i in 1:length(n)){</div><div> z <- 1</div><div> while(z <= r){</div><div><br></div><div> rptn[[z]] <- sample(x,size = n[i]) </div><div> names(rptn)[z] <- paste0("repetição",z)</div><div> z = z + 1</div><div> }</div><div><br></div><div> a[,i] <- rptn</div><div><br></div><div> }</div><div> </div><div> </div><div> return(a)</div><div><br></div><div>}</div><div>amostrados <- amostra(populacao,tamanhoAmostra,2)</div><div><br></div><div>#install.packages("plyr")</div><div>library(plyr)</div><div><br></div><div><br></div><div>resultado <- ldply (amostrados,function(x){</div><div> media <- mean(c(x$repetição1,x$repetição2))</div><div> desvio <- sd(c(x$repetição1,x$repetição2))</div><div> resposta <- data.frame(media,desvio)</div><div> return(resposta)</div><div><br></div><div>})</div><div><br></div><div>##você pode converter o dataframe para matrix</div><div>as.matrix(resultado)</div></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">Em 28 de setembro de 2017 15:45, FHRB Toledo via R-br <span dir="ltr"><<a href="mailto:r-br@listas.c3sl.ufpr.br" target="_blank">r-br@listas.c3sl.ufpr.br</a>></span> escreveu:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Isso tem bastante cara de um exercício de classe. De qualquer forma, segue uma versão funcionando que se aproxima muito da sua explicação:<br><br>> library(plyr)<br>> library(ggplot2)<br><br>> R <- 1E4 # tamanho da populacao<br>> S <- 1E3 # quantidade de amostras<br>> T <- 2:50 # tamanho das amostras<br>> names(T) <- T # nomeando vetor<br> <br>> pop <- rnorm(R) # populacao<br><br>> ## cavalor de forca... : gera os dados<br>> sampler <- function(t, s, p) ldply(t, .id = 'size',<br> function(ts) t(sapply(lapply(1:S,<br> <wbr> function(ss) sample(x = p,<br> <wbr> <wbr> size = t,<br> <wbr> <wbr> replace = TRUE)),<br> <wbr> function(x) c(mu = mean(x), sigma = sd(x)))))<br><br>> ## resume por tamanho de amostras<br>> dados <- mutate(ddply(sampler(T, S, pop), .(size),<br> summarize, muBar = mean(mu), sigmaBar = mean(sigma)),<br> size = as.numeric(as.character(size))<wbr>)<br><br>> ## media das medias<br>> ggplot(dados, mapping = aes(x = size, y = muBar)) + geom_point()<br><br>> ## media dos desvios<br>> ggplot(dados, mapping = aes(x = size, y = sigmaBar)) + geom_point()<br><br></div>Vale a pena revisar e testar tudo novamente, sobre as saídas como matriz, deixo isso para suas adaptações.<br><br></div>att,<br></div>FH<br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">2017-09-27 19:24 GMT-05:00 Andre Oliveira via R-br <span dir="ltr"><<a href="mailto:r-br@listas.c3sl.ufpr.br" target="_blank">r-br@listas.c3sl.ufpr.br</a>></span>:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div><div style="color:#000;background-color:#fff;font-family:bookman old style,new york,times,serif;font-size:16px"><div id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7991">Vou tentar explicar melhor! <br></div><span><div id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8468"><br></div><div id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8469">" <span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7919">para cada tam repetir </span><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7920"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7921">nam (vezes)" <br></span></span></div><div id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8450"><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7920"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7921"><br></span></span></div><div id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7923"><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7920"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7921"><br></span></span></div></span><div id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7924"><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7920"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7921">Seria repetir as amostragens:</span></span></div><div id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8086"><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7920"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7921"><br></span></span></div><div dir="ltr" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7987"><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7920"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7921">amostras de 2 em 2 um número k vezes. (Teria aqui k desvios-padrão e k medias). salvar media dos desvios e media das media! <br></span></span></div><div dir="ltr" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7992"><br><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8217"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8218"><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8219"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8220">amostras de 3 em 3 um número k vezes. </span></span></span></span><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8376"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8377"><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8378"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8379"><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8380"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8381">(Teria aqui k desvios-padrão e k medias). </span></span></span></span></span></span><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7920"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7921"><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7995"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7996"><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8221"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8222"><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8382"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8383">salvar media dos desvios e media das media! </span></span></span></span></span></span></span></span></div><div dir="ltr" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8028"><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7920"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7921"><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7995"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7996"><br></span></span></span></span></div><div dir="ltr" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8033"><br><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8231"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8232"><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8233"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8234"><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8235"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8236">amostras de 4 em 4 um número k vezes. </span></span></span></span></span></span><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8394"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8395"><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8396"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8397"><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8398"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8399"><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8400"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8401">(Teria aqui k desvios-padrão e k medias). </span></span></span></span></span></span></span></span><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7920"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7921"><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7995"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7996"><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8031"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8032"><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8237"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8238"><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8402"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8403">salvar media dos desvios e media das media! </span></span></span></span></span></span></span></span></span></span></div><div id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7986"><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7920"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7921"><br></span></span></div><div id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7975"><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7920"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7921">..............................<wbr>..............................<wbr>..............................<wbr>..............................<wbr>..............................<wbr>..............................<wbr>....................</span></span></div><div id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8035"><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7920"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7921"><br></span></span></div><div dir="ltr" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8041"><br><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8275"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8276"><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8277"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8278">amostras de j em j um número k vezes. </span></span></span></span><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8412"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8413"><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8414"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8415"><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8416"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8417">(Teria aqui k desvios-padrão e k medias). </span></span></span></span></span></span><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7920"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7921"><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8038"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8039"><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8279"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8280"><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8418"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8419">salvar media dos desvios e media das media! </span></span></span></span></span></span></span></span></div><div dir="ltr" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8081"><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7920"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7921"><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8038"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8039"><br></span></span></span></span></div><div dir="ltr" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8082"><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7920"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7921"><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8038"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8039"><br></span></span></span></span></div><div dir="ltr" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8127"><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7920"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7921"><span style="color:rgb(0,0,0)" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8038"><span id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_8039">Plotar os vetores salvos! <br></span></span></span></span></div><div id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7922"><span></span></div><div id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7915"> </div><div class="m_-4740202021827123803m_7358674755033931539signature" id="m_-4740202021827123803m_7358674755033931539yui_3_16_0_ym19_1_1506557539106_7850">André Oliveira Souza.
Graduação em Matemática, mestrado em estatística aplicada.Instituto Federal de Educação, Ciência e Tecnologia do Espirito Santo. IFES</div> <div class="m_-4740202021827123803m_7358674755033931539qtdSeparateBR"><br><br></div><div class="m_-4740202021827123803m_7358674755033931539yahoo_quoted" style="display:block"> <div style="font-family:bookman old style,new york,times,serif;font-size:16px"> <div style="font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:16px"><div><div class="m_-4740202021827123803h5"> <div dir="ltr"><font size="2" face="Arial"> Em Quarta-feira, 27 de Setembro de 2017 15:02, Fernando Souza <<a href="mailto:nandodesouza@gmail.com" target="_blank">nandodesouza@gmail.com</a>> escreveu:<br></font></div> <br><br> </div></div><div class="m_-4740202021827123803m_7358674755033931539y_msg_container"><div id="m_-4740202021827123803m_7358674755033931539yiv3828195357"><div><div><div class="m_-4740202021827123803h5"><div dir="ltr"><div>Acredito que isso deva te ajudar. Não entendi muito bem o que quis dizer com " <span id="m_-4740202021827123803m_7358674755033931539yiv3828195357gmail-m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6877" style="color:rgb(0,0,0)">para cada tam repetir </span><span id="m_-4740202021827123803m_7358674755033931539yiv3828195357gmail-m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6810" style="color:rgb(0,0,0)"><span id="m_-4740202021827123803m_7358674755033931539yiv3828195357gmail-m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6878">nam (vezes)" , por isso o código abaixo não faz nenhuma repetição dos valores amostrados , porém acredito que é fácil de ajustar.</span></span></div><div><br clear="none"></div><div>populacao <- rchisq(100000, df = 10)</div><div>tamanho <- c(6,14,16,18,20) # diferentes tamanhos para amostrar</div><div><br clear="none"></div><div>amostra <- function(x,n){</div><div> a <- list()</div><div><br clear="none"></div><div> for(i in 1:length(n)){</div><div> </div><div> a[[i]] <- sample(x,size = n[i])</div><div><br clear="none"></div><div> </div><div> }</div><div> return(a)</div><div><br clear="none"></div><div>}</div><div>amostrados <- amostra(populacao,tamanho)</div><div><br clear="none"></div><div>#install.packages("plyr")</div><div>library(plyr)</div><div><br clear="none"></div><div>resultado <- ldply (amostrados,function(x){</div><div> media <- mean(x)</div><div> desvio <- sd(x)</div><div><br clear="none"></div><div> resposta <- data.frame(media,desvio)</div><div> return(resposta)</div><div><br clear="none"></div><div>})</div><div><br clear="none"></div><div>##você pode converter o dataframe para matrix</div><div>as.matrix(resultado)</div><div><br clear="none"></div></div></div></div><div class="m_-4740202021827123803m_7358674755033931539yiv3828195357gmail_extra"><br clear="none"><div class="m_-4740202021827123803m_7358674755033931539yiv3828195357gmail_quote"><div><div class="m_-4740202021827123803h5">Em 26 de setembro de 2017 22:42, Andre Oliveira via R-br <span dir="ltr"><<a rel="nofollow" shape="rect" href="mailto:r-br@listas.c3sl.ufpr.br" target="_blank">r-br@listas.c3sl.ufpr.br</a>></span> escreveu:<br clear="none"></div></div><blockquote class="m_-4740202021827123803m_7358674755033931539yiv3828195357gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="m_-4740202021827123803m_7358674755033931539yiv3828195357yqt1492585374" id="m_-4740202021827123803m_7358674755033931539yiv3828195357yqt99551"><div><div style="color:#000;background-color:#fff;font-family:bookman old style,new york,times,serif;font-size:16px"><div><div class="m_-4740202021827123803h5"><div id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6686"><span>Boa noite,</span></div><div dir="ltr" id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6802"><span id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6938">preciso de amostrar em um vetor de nome </span><span id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6858"><span id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6939">populacao</span> amostras de tamanho n, com n variando de tamanhos [2; </span><span id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6877"><span id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6859">tam</span>] e para cada tam repetir </span><span id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6810"><span id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6878">nam (vezes) e assim pegar a estimativas de media e dos desvios -padrão das amostras.<br clear="none"></span></span></div><div dir="ltr" id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6903"><span id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6810"><span id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6878"><br clear="none"></span></span></div><div dir="ltr" id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6904"><span id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6810"><span id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6878"><br clear="none"></span></span></div><div dir="ltr" id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6912"><span id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6810"><span id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6878">Para cada amostra obtida extrair desvio padrão, média e guardar em uma matriz com vazia com NAs! Ao final plotar a média dos desvios e a media das medias em função de cada n.</span></span></div><div dir="ltr" id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6990"><span id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6810"><span id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6878"><br clear="none"></span></span></div><div dir="ltr" id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6927"><span id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6810"><span id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6878">Tentei fazer, mas sem sucesso! Caso alguém pude ajudar ficarei grato! <br clear="none"></span></span></div><div dir="ltr" id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6926"><span id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6810"><span id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6878"><br clear="none"></span></span></div><div dir="ltr" id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6879"><span id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6810"><span id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6878"><br clear="none"></span></span></div><div dir="ltr" id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6880"><span id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6810"><span id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6878">############################## ############################## #########################<br clear="none"></span></span></div><div dir="ltr" id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6692"><span id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6780"><br clear="none"></span></div><div dir="ltr" id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_7076"><span id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6780">n=10<br id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6751" clear="none">populacao <- rchisq(100000, df = n)<br id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6752" clear="none">mu=n<br id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6753" clear="none">s=sqrt(2*n)<br id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6754" clear="none">mu<br id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6755" clear="none">s<br id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6756" clear="none"><br id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6757" clear="none">par(mfrow = c(1, 3)) <br id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6758" clear="none">hist(populacao, prob=T, main="Y ~ Quiquadrado(GL=10)",xlab=" ", yla="Densidade",col=" limegreen")<br id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6759" clear="none"></span></div></div></div><div dir="ltr" id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_7051"><span id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6780"><br id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6760" clear="none">amostragem<-function( populacao, tam, nam)<br id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6761" clear="none"> {</span></div><span><div dir="ltr" id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_7022"><span id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6780"> SD<-NULL<br id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6762" clear="none"> media<-NULL<br id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6763" clear="none"> X <-matrix(NA, tam, 2)<br id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6764" clear="none"> {<br id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6765" clear="none"> for(i in 2:nam)<br id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6766" clear="none"> amostra<-sample(populacao,tam)<br id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6767" clear="none"> SD[i]=sd(amostra)<br id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6768" clear="none"> media[i]<-mean(amostra)<br id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6769" clear="none"> X[i,] <- c(mean(SD), mean(media))<br id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6770" clear="none"> }<br id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6771" clear="none">print(cbind(mean(SD),mean( media))<br id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6772" clear="none">print(X)<br id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6773" clear="none">plot.ts(SD, pch=19, type = "p", xlab="Número de folhas amostrada", ylab="Estimativa da Variabiliade", lty=2,xaxp=c(0,150,10))<br id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6774" clear="none">plot.ts(media, pch=19, type = "p", xlab="Número de folhas amostrada", ylab="Estimativa da média", lty=2,xaxp=c(0,150,10))<br id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6775" clear="none">}<br id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6776" clear="none"><br id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6777" clear="none"><br id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6778" clear="none">amostragem(populacao, 150, 50000)<br id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6779" clear="none"></span></div><div id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6605"><div id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_7114"> ############################# ############################## ############################## ##</div><div id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_7150"><br clear="none"></div></div><div class="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546signature" id="m_-4740202021827123803m_7358674755033931539yiv3828195357m_3582969566620523546yui_3_16_0_ym19_1_1506475707412_6629">obg <br clear="none"></div></span></div></div></div><span><br clear="none">______________________________ _________________<br clear="none">
R-br mailing list<br clear="none">
<a rel="nofollow" shape="rect" href="mailto:R-br@listas.c3sl.ufpr.br" target="_blank">R-br@listas.c3sl.ufpr.br</a><br clear="none">
<a rel="nofollow" shape="rect" href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br" target="_blank">https://listas.inf.ufpr.br/ cgi-bin/mailman/listinfo/r-br</a><br clear="none"></span>
Leia o guia de postagem (<a rel="nofollow" shape="rect" href="http://www.leg.ufpr.br/r-br-guia" target="_blank">http://www.leg.ufpr.br/r-br- guia</a>) e forneça código mínimo reproduzível.<br clear="none"></blockquote></div><span><br clear="none"><br clear="all"><div><br clear="none"></div>-- <br clear="none"><div class="m_-4740202021827123803m_7358674755033931539yiv3828195357gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><span>==============================<wbr>===========<br clear="none">
Fernando Souza<br clear="none">
Zootecnista, DSc. Produção e Alimentação Animal<br clear="none">
Celular: (31)99796-8781 (Vivo)<br clear="none">
<a rel="nofollow" shape="rect" href="mailto:e-mail%3Anandodesouza@gmail.com" target="_blank">E-mail:nandodesouza@gmail.com</a><br clear="none">
Lattes: <a rel="nofollow" shape="rect" href="http://lattes.cnpq.br/6519538815038307" target="_blank">http://lattes.cnpq.br/65195388<wbr>15038307</a><br clear="none">
Blog: <a rel="nofollow" shape="rect" href="https://producaoanimalcomr.wordpress.com/" target="_blank">https://producaoanimalcomr.wor<wbr>dpress.com/</a><br clear="none">
==============================<wbr>============</span></div></div></div></div></div></div></div></div></div></div>
</span></div></div></div><br><br></div> </div> </div> </div></div></div><br></div></div>______________________________<wbr>_________________<span class=""><br>
R-br mailing list<br>
<a href="mailto:R-br@listas.c3sl.ufpr.br" target="_blank">R-br@listas.c3sl.ufpr.br</a><br>
<a href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br" rel="noreferrer" target="_blank">https://listas.inf.ufpr.br/cgi<wbr>-bin/mailman/listinfo/r-br</a><br></span>
Leia o guia de postagem (<a href="http://www.leg.ufpr.br/r-br-guia" rel="noreferrer" target="_blank">http://www.leg.ufpr.br/r-br-g<wbr>uia</a>) e forneça código mínimo reproduzível.<br></blockquote></div><br></div>
<br>______________________________<wbr>_________________<br>
R-br mailing list<br>
<a href="mailto:R-br@listas.c3sl.ufpr.br">R-br@listas.c3sl.ufpr.br</a><br>
<a href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br" rel="noreferrer" target="_blank">https://listas.inf.ufpr.br/<wbr>cgi-bin/mailman/listinfo/r-br</a><br>
Leia o guia de postagem (<a href="http://www.leg.ufpr.br/r-br-guia" rel="noreferrer" target="_blank">http://www.leg.ufpr.br/r-br-<wbr>guia</a>) e forneça código mínimo reproduzível.<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><span>=========================================<br>
Fernando Souza<br>
Zootecnista, DSc. Produção e Alimentação Animal<br>
Celular: (31)99796-8781 (Vivo)<br>
<a href="mailto:e-mail%3Anandodesouza@gmail.com" target="_blank">E-mail:nandodesouza@gmail.com</a><br>
Lattes: <a href="http://lattes.cnpq.br/6519538815038307" target="_blank">http://lattes.cnpq.br/6519538815038307</a><br>
Blog: <a href="https://producaoanimalcomr.wordpress.com/" target="_blank">https://producaoanimalcomr.wordpress.com/</a><br>
==========================================</span></div></div></div></div></div></div></div></div></div></div>
</div>