<div>Boa tarde a todos.</div>Estou tendo aulas de probabilidade e estatística nesse semestre e preciso de fazer alguns histogramas no R.<div><br></div><div>Basicamente eu tenho essa pequena amostra:</div><div><div>X<-c( 4.5 ,4.7 ,3.2 ,6.3 ,6.4 ,7.1 ,7.2 ,5.1 ,3.7 ,4.2 ,16.2 ,15.9 ,17.3 ,5.1 ,</div>
<div> 4.6, 8.4, 9.0, 3.6, 3.2, 6.3, 18.4, 3.4, 9.1, 5, 3.6, 2.6, 10.1, 5.6, 6.3)</div><div><br></div><div>Eu estou tentando construir um histograma de freqüência com intervalos de classe para uma variável contínua.</div><div>
<br></div><div>Usei essa função aqui: </div><div><br></div><div><div>hist(X,breaks=c(2.6,5.9,9.2,12.5,15.8,19.1),main="Chefes de família do Bairro Alto segundo renda mensal, em salários mínimos - Curitiba - 2002",</div>
<div>ylab="Nº de Chefes",xlab="Renda mensal, em salário mínimos",</div><div>col="red",xlim=c(2.6,19.1),sub="Fonte: Dados fictícios",cex.sub=0.9)</div></div><div><br></div><div>Problemas: </div>
<div>A ultima classe deveria estar com frequência igual a 5, mas pelo visto conta somente 4.</div><div>No eixo x eu não quero que ele fique mostrando os valores em escala "5 - 10 - 15" e sim o Ponto médio de cada classe (4.25, 7.55, 10.85, 14.15, 17.45) e que fique centralizado com a largura da coluna.</div>
<div><br></div><div>Dados:</div><div><br></div><div>Aqui estão os intervalos de classe e as frequências:</div><div><div align="center">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="639" style="width:479.25pt;margin-left:3.5pt;border-collapse:collapse">
<tbody><tr style="height:14.35pt">
<td width="639" nowrap colspan="2" valign="bottom" style="width:479.25pt;border:none;border-bottom:solid windowtext 1.0pt;padding:0cm 3.5pt 0cm 3.5pt;height:14.35pt">
<p class="MsoNormal" align="center" style="text-align:center;text-autospace:ideograph-numeric ideograph-other"><b><span style="font-family:Arial,sans-serif">Tabela 7 - Chefes de
família do Bairro Alto segundo renda mensal, em salários mínimos - Curitiba -
2002</span></b></p>
</td>
</tr>
<tr style="height:14.35pt">
<td width="488" nowrap valign="bottom" style="width:365.65pt;border:none;border-right:solid windowtext 1.0pt;padding:0cm 3.5pt 0cm 3.5pt;height:14.35pt">
<p class="MsoNormal" align="center" style="text-align:center;text-autospace:ideograph-numeric ideograph-other"><b><span style="font-family:Arial,sans-serif"> Renda mensal em salários mínimos</span></b></p>
</td>
<td width="151" nowrap valign="bottom" style="width:113.6pt;padding:0cm 3.5pt 0cm 3.5pt;height:14.35pt">
<p class="MsoNormal" align="center" style="text-align:center;text-autospace:ideograph-numeric ideograph-other"><b><span style="font-family:Arial,sans-serif">Freqüência</span></b></p>
</td>
</tr>
<tr style="height:14.35pt">
<td width="488" nowrap valign="bottom" style="width:365.65pt;border-top:solid windowtext 1.0pt;border-left:none;border-bottom:none;border-right:solid windowtext 1.0pt;padding:0cm 3.5pt 0cm 3.5pt;height:14.35pt">
<p class="Default"><span style="font-family:"Arial","sans-serif"">2,6 </span><span style="color:windowtext">|</span><span style="font-family:Symbol">¾</span><span style="font-family:"Arial","sans-serif""> 5,9</span></p>
</td>
<td width="151" nowrap valign="bottom" style="width:113.6pt;border:none;border-top:solid windowtext 1.0pt;padding:0cm 3.5pt 0cm 3.5pt;height:14.35pt">
<p class="MsoNormal" align="center" style="text-align:center;text-autospace:ideograph-numeric ideograph-other"><span style="font-family:Arial,sans-serif">15</span></p>
</td>
</tr>
<tr style="height:14.35pt">
<td width="488" nowrap valign="bottom" style="width:365.65pt;border:none;border-right:solid windowtext 1.0pt;padding:0cm 3.5pt 0cm 3.5pt;height:14.35pt">
<p class="MsoNormal"><span style="font-family:Arial,sans-serif">5,9 </span><span style="font-family:Symbol">|¾</span><span style="font-family:Arial,sans-serif"> 9,2</span></p>
</td>
<td width="151" nowrap valign="bottom" style="width:113.6pt;padding:0cm 3.5pt 0cm 3.5pt;height:14.35pt">
<p class="MsoNormal" align="center" style="text-align:center;text-autospace:ideograph-numeric ideograph-other"><span style="font-family:Arial,sans-serif">9</span></p>
</td>
</tr>
<tr style="height:14.35pt">
<td width="488" nowrap valign="bottom" style="width:365.65pt;border:none;border-right:solid windowtext 1.0pt;padding:0cm 3.5pt 0cm 3.5pt;height:14.35pt">
<p class="MsoNormal"><span style="font-family:Arial,sans-serif">9,2 </span><span style="font-family:Symbol">|¾</span><span style="font-family:Arial,sans-serif"> 12,5</span></p>
</td>
<td width="151" nowrap valign="bottom" style="width:113.6pt;padding:0cm 3.5pt 0cm 3.5pt;height:14.35pt">
<p class="MsoNormal" align="center" style="text-align:center;text-autospace:ideograph-numeric ideograph-other"><span style="font-family:Arial,sans-serif">1</span></p>
</td>
</tr>
<tr style="height:4.75pt">
<td width="488" nowrap valign="bottom" style="width:365.65pt;border:none;border-right:solid windowtext 1.0pt;padding:0cm 3.5pt 0cm 3.5pt;height:4.75pt">
<p class="MsoNormal"><span style="font-family:Arial,sans-serif">12,5 </span><span style="font-family:Symbol">|¾</span><span style="font-family:Arial,sans-serif"> 15,8</span></p>
</td>
<td width="151" nowrap valign="bottom" style="width:113.6pt;padding:0cm 3.5pt 0cm 3.5pt;height:4.75pt">
<p class="MsoNormal" align="center" style="text-align:center;text-autospace:ideograph-numeric ideograph-other"><span style="font-family:Arial,sans-serif">0</span></p>
</td>
</tr>
<tr style="height:14.35pt">
<td width="488" nowrap valign="bottom" style="width:365.65pt;border:none;border-right:solid windowtext 1.0pt;padding:0cm 3.5pt 0cm 3.5pt;height:14.35pt">
<p class="MsoNormal"><span style="font-family:Arial,sans-serif">15,8 </span><span style="font-family:Symbol">|¾|</span><span style="font-family:Arial,sans-serif"> 19,1</span></p>
</td>
<td width="151" nowrap valign="bottom" style="width:113.6pt;padding:0cm 3.5pt 0cm 3.5pt;height:14.35pt">
<p class="MsoNormal" align="center" style="text-align:center;text-autospace:ideograph-numeric ideograph-other"><span style="font-family:Arial,sans-serif">5</span></p>
</td>
</tr>
<tr style="height:14.35pt">
<td width="488" nowrap valign="bottom" style="width:365.65pt;border:solid windowtext 1.0pt;border-left:none;padding:0cm 3.5pt 0cm 3.5pt;height:14.35pt">
<p class="MsoNormal" align="center" style="text-align:center;text-autospace:ideograph-numeric ideograph-other"><span style="font-family:Arial,sans-serif">Total</span></p>
</td>
<td width="151" nowrap valign="bottom" style="width:113.6pt;border-top:solid windowtext 1.0pt;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:none;padding:0cm 3.5pt 0cm 3.5pt;height:14.35pt">
<p class="MsoNormal" align="center" style="text-align:center;text-autospace:ideograph-numeric ideograph-other"><span style="font-family:Arial,sans-serif">30</span></p>
</td>
</tr>
<tr style="height:13.7pt">
<td width="639" nowrap colspan="2" valign="bottom" style="width:479.25pt;border:none;padding:0cm 3.5pt 0cm 3.5pt;height:13.7pt">
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:Arial,sans-serif">Fonte:</span></b><span style="font-size:10pt;font-family:Arial,sans-serif"> Dados Fictícios</span></p>
</td>
</tr>
</tbody></table>
</div></div><div><div align="center"><br></div></div><div>Amplitude de classe = 3.3</div></div><div>Número de classes = 5</div><div><br></div><div>Agradeço desde já.</div><div>Adriano.</div>