<font face="trebuchet ms,sans-serif">Carla,<br><br>Você esqueceu de atribuir a algum objeto o resultado do var.test() que usa na pergunta lógica. Contruí uma função (super simples por sinal) na disciplina de Estatística Computacional que faz justamente o procedimento que você apresentou. Confira em <a href="http://www.leg.ufpr.br/doku.php/disciplinas:ce223-2011-01">http://www.leg.ufpr.br/doku.php/disciplinas:ce223-2011-01</a> o script da aula15.R a função auto.t.test().<br>
<br><span style="font-family: courier new,monospace;"># meus dados simulados milsa</span><br><span style="font-family: courier new,monospace;">milsa <- data.frame(instrucao=gl(2,14))</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">milsa$salario <- rnorm(nrow(milsa))</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">str(milsa)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">var.test <- var.test(milsa$salario~milsa$instrucao) # aqui ó <---------------- </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">alpha <- 0.05 # especifica valor da signific^ancia</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">if(var.test$p.value > alpha){</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> diff.test <- t.test(milsa$salario ~ milsa$instrucao,</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> alternative="two.sided", var.equal=TRUE,</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> conf.level=1-alpha)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> } else {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> diff.test <- t.test(milsa$salario ~ milsa$instrucao,</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> alternative="two.sided", var.equal=FALSE,</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> conf.level=1-alpha)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> }</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">diff.test</span><br style="font-family: courier new,monospace;">
<br>À disposição.<br>Walmes.<br><br clear="all"></font><span style="font-family: trebuchet ms,sans-serif;">==========================================================================</span><br style="font-family: trebuchet ms,sans-serif;">
<span style="font-family: trebuchet ms,sans-serif;">Walmes Marques Zeviani</span><br style="font-family: trebuchet ms,sans-serif;"><span style="font-family: trebuchet ms,sans-serif;">LEG (Laboratório de Estatística e Geoinformação, 25.450418 S, 49.231759 W)</span><br style="font-family: trebuchet ms,sans-serif;">
<span style="font-family: trebuchet ms,sans-serif;">Departamento de Estatística - Universidade Federal do Paraná</span><br style="font-family: trebuchet ms,sans-serif;"><span style="font-family: trebuchet ms,sans-serif;">fone: (+55) 41 3361 3573</span><br style="font-family: trebuchet ms,sans-serif;">
<span style="font-family: trebuchet ms,sans-serif;">VoIP: (3361 3600) 1053 1173</span><br style="font-family: trebuchet ms,sans-serif;"><span style="font-family: trebuchet ms,sans-serif;">e-mail: <a href="mailto:walmes@ufpr.br" target="_blank">walmes@ufpr.br</a></span><br style="font-family: trebuchet ms,sans-serif;">
<span style="font-family: trebuchet ms,sans-serif;">twitter: @walmeszeviani</span><br style="font-family: trebuchet ms,sans-serif;"><span style="font-family: trebuchet ms,sans-serif;">homepage: <a href="http://www.leg.ufpr.br/%7Ewalmes" target="_blank">http://www.leg.ufpr.br/~walmes</a></span><br style="font-family: trebuchet ms,sans-serif;">
<span style="font-family: trebuchet ms,sans-serif;">linux user number: 531218</span><br style="font-family: trebuchet ms,sans-serif;"><span style="font-family: trebuchet ms,sans-serif;">==========================================================================</span><br>