<html><body><div style="color:#000; background-color:#fff; font-family:lucida console, sans-serif;font-size:16px">Veja se te ajuda<table width="100%" summary="page for bartlett.test {stats}" style="font-family: Times;" class="" id="yui_3_16_0_1_1420258107921_10014"><tbody class="" style="" id="yui_3_16_0_1_1420258107921_10013"><tr class="" style="" id="yui_3_16_0_1_1420258107921_10012"><td class="" style="" id="yui_3_16_0_1_1420258107921_10011"><div id="yui_3_16_0_1_1420258107921_10015"><br></div><div id="yui_3_16_0_1_1420258107921_10016"><br></div><div>bartlett.test {stats}</div></td><td align="right" class="" style="">R Documentation</td></tr></tbody></table><h2 style="color: rgb(102, 102, 102); font-family: monospace; font-size: large; text-align: center;" class="" id="yui_3_16_0_1_1420258107921_10010">Bartlett Test of Homogeneity of Variances</h2><h3 style="color: rgb(102, 102, 102); font-family: monospace; font-size: large;" class="">Description</h3><div style="font-family: Times; font-size: medium;" class="">Performs Bartlett's test of the null that the variances in each of the groups (samples) are the same.</div><h3 style="color: rgb(102, 102, 102); font-family: monospace; font-size: large;" class="">Usage</h3><pre class="" style="">bartlett.test(x, ...)

## Default S3 method:
bartlett.test(x, g, ...)

## S3 method for class 'formula'
bartlett.test(formula, data, subset, na.action, ...)
</pre><h3 style="color: rgb(102, 102, 102); font-family: monospace; font-size: large;" class="">Arguments</h3><table summary="R argblock" style="font-family: Times;" class="" id="yui_3_16_0_1_1420258107921_10009"><tbody class="" style="" id="yui_3_16_0_1_1420258107921_10008"><tr valign="top" class="" style=""><td class="" style=""><code class="" style="">x</code></td><td class="" style=""><div class="" style="">a numeric vector of data values, or a list of numeric data vectors representing the respective samples, or fitted linear model objects (inheriting from class <code class="" style="">"lm"</code>).</div></td></tr><tr valign="top" class="" style=""><td class="" style=""><code class="" style="">g</code></td><td class="" style=""><div class="" style="">a vector or factor object giving the group for the corresponding elements of <code class="" style="">x</code>. Ignored if <code class="" style="">x</code> is a list.</div></td></tr><tr valign="top" class="" style=""><td class="" style=""><code class="" style="">formula</code></td><td class="" style=""><div class="" style="">a formula of the form <code class="" style="">lhs ~ rhs</code> where <code class="" style="">lhs</code> gives the data values and <code class="" style="">rhs</code> the corresponding groups.</div></td></tr><tr valign="top" class="" style="" id="yui_3_16_0_1_1420258107921_10007"><td class="" style=""><code class="" style="">data</code></td><td class="" style="" id="yui_3_16_0_1_1420258107921_10006"><div class="" style="" id="yui_3_16_0_1_1420258107921_10005">an optional matrix or data frame (or similar: see <code class="" style=""><a href="http://127.0.0.1:10077/library/stats/help/model.frame" style="background-color: white; color: rgb(128, 0, 128); background-position: initial initial; background-repeat: initial initial;" class="">model.frame</a></code>) containing the variables in the formula<code class="" style="">formula</code>. By default the variables are taken from <code class="" style="">environment(formula)</code>.</div></td></tr><tr valign="top" class="" style=""><td class="" style=""><code class="" style="">subset</code></td><td class="" style=""><div class="" style="">an optional vector specifying a subset of observations to be used.</div></td></tr><tr valign="top" class="" style=""><td class="" style=""><code class="" style="">na.action</code></td><td class="" style=""><div class="" style="">a function which indicates what should happen when the data contain <code class="" style="">NA</code>s. Defaults to<code class="" style="">getOption("na.action")</code>.</div></td></tr><tr valign="top" class="" style=""><td class="" style=""><code class="" style="">...</code></td><td class="" style=""><div class="" style="">further arguments to be passed to or from methods.</div></td></tr></tbody></table><h3 style="color: rgb(102, 102, 102); font-family: monospace; font-size: large;" class="">Details</h3><div style="font-family: Times; font-size: medium;" class="">If <code class="" style="">x</code> is a list, its elements are taken as the samples or fitted linear models to be compared for homogeneity of variances. In this case, the elements must either all be numeric data vectors or fitted linear model objects, <code class="" style="">g</code> is ignored, and one can simply use <code class="" style="">bartlett.test(x)</code> to perform the test. If the samples are not yet contained in a list, use<code class="" style="">bartlett.test(list(x, ...))</code>.</div><div style="font-family: Times; font-size: medium;" class="">Otherwise, <code class="" style="">x</code> must be a numeric data vector, and <code class="" style="">g</code> must be a vector or factor object of the same length as <code class="" style="">x</code> giving the group for the corresponding elements of <code class="" style="">x</code>.</div><h3 style="color: rgb(102, 102, 102); font-family: monospace; font-size: large;" class="">Value</h3><div style="font-family: Times; font-size: medium;" class="">A list of class <code class="" style="">"htest"</code> containing the following components:</div><table summary="R valueblock" style="font-family: Times;" class="" id="yui_3_16_0_1_1420258107921_9989"><tbody class="" style="" id="yui_3_16_0_1_1420258107921_10003"><tr valign="top" class="" style=""><td class="" style=""><code class="" style="">statistic</code></td><td class="" style=""><div class="" style="">Bartlett's K-squared test statistic.</div></td></tr><tr valign="top" class="" style=""><td class="" style=""><code class="" style="">parameter</code></td><td class="" style=""><div class="" style="">the degrees of freedom of the approximate chi-squared distribution of the test statistic.</div></td></tr><tr valign="top" class="" style=""><td class="" style=""><code class="" style="">p.value</code></td><td class="" style=""><div class="" style="">the p-value of the test.</div></td></tr><tr valign="top" class="" style=""><td class="" style=""><code class="" style="">method</code></td><td class="" style=""><div class="" style="">the character string <code class="" style="">"Bartlett test of homogeneity of variances"</code>.</div></td></tr><tr valign="top" class="" style="" id="yui_3_16_0_1_1420258107921_10002"><td class="" style=""><code class="" style="">data.name</code></td><td class="" style="" id="yui_3_16_0_1_1420258107921_10001"><div class="" style="" id="yui_3_16_0_1_1420258107921_10000">a character string giving the names of the data.</div></td></tr></tbody></table><h3 style="color: rgb(102, 102, 102); font-family: monospace; font-size: large;" class="" id="yui_3_16_0_1_1420258107921_9988">References</h3><div style="font-family: Times; font-size: medium;" class="" id="yui_3_16_0_1_1420258107921_9991">Bartlett, M. S. (1937). Properties of sufficiency and statistical tests. <em class="" style="">Proceedings of the Royal Society of London Series A</em><b class="" style="" id="yui_3_16_0_1_1420258107921_10004">160</b>, 268–282.</div><h3 style="color: rgb(102, 102, 102); font-family: monospace; font-size: large;" class="" id="yui_3_16_0_1_1420258107921_9990">See Also</h3><div style="font-family: Times; font-size: medium;" class="" id="yui_3_16_0_1_1420258107921_9987"><code class="" style=""><a href="http://127.0.0.1:10077/library/stats/help/var.test" style="background-color: white; color: rgb(128, 0, 128); background-position: initial initial; background-repeat: initial initial;" class="">var.test</a></code> for the special case of comparing variances in two samples from normal distributions; <code class="" style=""><a href="http://127.0.0.1:10077/library/stats/help/fligner.test" style="background-color: white; color: rgb(128, 0, 128); background-position: initial initial; background-repeat: initial initial;" class="">fligner.test</a></code> for a rank-based (nonparametric) <i class="" style="">k</i>-sample test for homogeneity of variances; <code class="" style=""><a href="http://127.0.0.1:10077/library/stats/help/ansari.test" style="background-color: white; color: rgb(128, 0, 128); background-position: initial initial; background-repeat: initial initial;" class="">ansari.test</a></code> and <code class="" style=""><a href="http://127.0.0.1:10077/library/stats/help/mood.test" style="background-color: white; color: rgb(128, 0, 128); background-position: initial initial; background-repeat: initial initial;" class="">mood.test</a></code> for two rank based two-sample tests for difference in scale.</div><h3 style="color: rgb(102, 102, 102); font-family: monospace; font-size: large;" class="">Examples</h3><pre class="" style="" id="yui_3_16_0_1_1420258107921_9986">require(graphics)

plot(count ~ spray, data = InsectSprays)
bartlett.test(InsectSprays$count, InsectSprays$spray)
bartlett.test(count ~ spray, data = InsectSprays)</pre><div></div><div id="yui_3_16_0_1_1420258107921_9860"> </div><div id="yui_3_16_0_1_1420258107921_9862"><div id="yui_3_16_0_1_1420258107921_9861">Edson Lira<br>Estatístico<br>Manaus-Amazonas</div></div> <div class="qtdSeparateBR"><br><br></div><div class="yahoo_quoted" style="display: block;"> <div style="font-family: lucida console, sans-serif; font-size: 16px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div dir="ltr"> <font size="2" face="Arial"> Em Sexta-feira, 2 de Janeiro de 2015 10:44, Andre Oliveira <andreolsouza@yahoo.com.br> escreveu:<br> </font> </div>  <br><br> <div class="y_msg_container"><div id="yiv1409437344"><div><div style="color:#000;background-color:#fff;font-family:HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:10px;"><div dir="ltr" id="yiv1409437344yui_3_16_0_1_1420209702300_2615">Qual seria  o  procedimento para para subdividida?  <br></div><div dir="ltr" id="yiv1409437344yui_3_16_0_1_1420209702300_2605">Obrigado pessoal!<span><br></span></div><div></div><div id="yiv1409437344yui_3_16_0_1_1420209702300_2603"> </div><div id="yiv1409437344yui_3_16_0_1_1420209702300_2583"><div id="yiv1409437344yui_3_16_0_1_1420209702300_2582">
<br>
<br>André Oliveira Souza. 
<br>Graduação em Matemática, mestrado em estatística aplicada.Instituto Federal de Educação, Ciência e Tecnologia do Espirito Santo.  IFES
<br>
<br></div></div> <div class="yiv1409437344qtdSeparateBR"><br><br></div><div class="yiv1409437344yahoo_quoted" style="display: block;"> <div style="font-family:HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:10px;"> <div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;"> <div dir="ltr"> <font size="2" face="Arial"> Em Quinta-feira, 1 de Janeiro de 2015 23:23, Fernando Antonio de souza <nandodesouza@gmail.com> escreveu:<br> </font> </div>  <br><br> <div class="yiv1409437344y_msg_container"><div id="yiv1409437344"><div><div dir="ltr">VC pode criar uma variável interação e fazer o Bartlett. Teste sobre ela<br clear="none">
Dados$interação<-interaction(fator1,fator2)<br clear="none">
bartlett.test(resid(modelo2), dados$interaction)</div>
<div class="yiv1409437344gmail_quote">Em 01/01/2015 18:57, "Andre Oliveira" <<a rel="nofollow" shape="rect" ymailto="mailto:andreolsouza@yahoo.com.br" target="_blank" href="mailto:andreolsouza@yahoo.com.br">andreolsouza@yahoo.com.br</a>> escreveu:<br clear="none"><blockquote class="yiv1409437344gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="yiv1409437344yqt9694283183" id="yiv1409437344yqt38489"><div><div style="color:#000;background-color:#fff;font-family:HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:10px;"><div>Mas neste caso como aplicar o bartlett.test?</div><div><br clear="none"></div><div><br clear="none"></div><div dir="ltr">bartlett.test(modelo2$residuals,fat1) # Homogeneidade de variâncias <br clear="none">bartlett.test(modelo2$residuals,fat2) # Homogeneidade de variâncias </div><div dir="ltr"><br clear="none"></div><div dir="ltr">Só assim? Por fatores separadamente? <br clear="none"></div><div dir="ltr"><br clear="none"></div><div dir="ltr"><br clear="none"></div><div><span></span></div><div> </div><div><div>
<br clear="none">
<br clear="none">André Oliveira Souza. 
<br clear="none">Graduação em Matemática, mestrado em estatística aplicada.Instituto Federal de Educação, Ciência e Tecnologia do Espirito Santo.  IFES
<br clear="none">
<br clear="none"></div></div> <div><br clear="none"><br clear="none"></div><div style="display:block;"> <div style="font-family:HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:10px;"> <div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;"> <div dir="ltr"> <font face="Arial"> Em Quinta-feira, 1 de Janeiro de 2015 18:40, henrique jose de paula alves paula alves <<a rel="nofollow" shape="rect" ymailto="mailto:jpahenrique@gmail.com" target="_blank" href="mailto:jpahenrique@gmail.com">jpahenrique@gmail.com</a>> escreveu:<br clear="none"> </font> </div>  <br clear="none"><br clear="none"> <div><div><div><div dir="ltr">O teste de Bartley deve funcionar bem.</div><div><br clear="none"><div>Em 1 de janeiro de 2015 17:52, Andre Oliveira <span dir="ltr"><<a rel="nofollow" shape="rect" ymailto="mailto:andreolsouza@yahoo.com.br" target="_blank" href="mailto:andreolsouza@yahoo.com.br">andreolsouza@yahoo.com.br</a>></span> escreveu:<br clear="none"><blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div><div style="color:#000;background-color:#fff;font-family:HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:10px;"><div><span></span></div><div><div dir="ltr"> Pessoal boa tarde, dado meu modelo em fatorial.</div><div dir="ltr"> modelo=aov(respsota~factor1*factor2) <br clear="none"></div><div dir="ltr">Como avaliar homogeneidade de variâncias?</div><div dir="ltr"><br clear="none"></div><div dir="ltr">O que fiz aqui foi ..par(mfrow=c(2,2))<br clear="none">boxplot(resp~fat1)<br clear="none">boxplot(resp~fat2)<br clear="none">boxplot(resp~fat1*fat2)<br clear="none">interaction.plot(fat1,fat2,resp,ylab="Médias",main="Interação  Fat1 vs Fat2")</div><div dir="ltr"><br clear="none"></div><div dir="ltr"><br clear="none"></div><div dir="ltr"><br clear="none"></div><div dir="ltr">Mas está muito subjetivo. <br clear="none"></div><div dir="ltr"><br clear="none"></div></div><div><div>
<br clear="none">
<br clear="none">André Oliveira Souza. 
<br clear="none">Graduação em Matemática, mestrado em estatística aplicada.Instituto Federal de Educação, Ciência e Tecnologia do Espirito Santo.  IFES
<br clear="none">
<br clear="none"></div></div></div></div></div><br clear="none">_______________________________________________<br clear="none">
R-br mailing list<br clear="none">
<a rel="nofollow" shape="rect" ymailto="mailto:R-br@listas.c3sl.ufpr.br" target="_blank" href="mailto:R-br@listas.c3sl.ufpr.br">R-br@listas.c3sl.ufpr.br</a><br clear="none">
<a rel="nofollow" shape="rect" target="_blank" href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a><br clear="none">
Leia o guia de postagem (<a rel="nofollow" shape="rect" target="_blank" href="http://www.leg.ufpr.br/r-br-guia">http://www.leg.ufpr.br/r-br-guia</a>) e forneça código mínimo reproduzível.<br clear="none"></blockquote></div><br clear="none"><br clear="all"><div><br clear="none"></div>-- <br clear="none"><div><div dir="ltr">Henrique José de Paula Alves<div>Pós-graduando em Estatística - 35 9103-3364</div><div>UFLA - LAVRAS -  MG</div></div></div>
</div></div></div><br clear="none"><br clear="none"></div>  </div> </div>  </div> </div></div></div><br clear="none">_______________________________________________<br clear="none">
R-br mailing list<br clear="none">
<a rel="nofollow" shape="rect" ymailto="mailto:R-br@listas.c3sl.ufpr.br" target="_blank" href="mailto:R-br@listas.c3sl.ufpr.br">R-br@listas.c3sl.ufpr.br</a><br clear="none">
<a rel="nofollow" shape="rect" target="_blank" href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a><br clear="none">
Leia o guia de postagem (<a rel="nofollow" shape="rect" target="_blank" href="http://www.leg.ufpr.br/r-br-guia">http://www.leg.ufpr.br/r-br-guia</a>) e forneça código mínimo reproduzível.<br clear="none"></blockquote></div></div></div><br><br></div>  </div> </div>  </div> </div></div></div><br>_______________________________________________<br>R-br mailing list<br><a ymailto="mailto:R-br@listas.c3sl.ufpr.br" 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" target="_blank">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a><br>Leia o guia de postagem (<a 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><br></div>  </div> </div>  </div> </div></body></html>