<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:12pt"><div style="font-family: arial, helvetica, sans-serif; "><span>Boa noite caros amigos, </span></div><div style="font-family: arial, helvetica, sans-serif; color: rgb(0, 0, 0); font-size: 16px; background-color: transparent; font-style: normal; "><span><br></span></div><div style="font-family: arial, helvetica, sans-serif; color: rgb(0, 0, 0); font-size: 16px; background-color: transparent; font-style: normal; "><span>A rotina abaixo</span></div><div style="font-family: arial, helvetica, sans-serif; color: rgb(0, 0, 0); font-size: 16px; background-color: transparent; font-style: normal; "><span><br></span></div><div style="font-size: 16px; background-color: transparent; font-style: normal; color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; "><span><div style="font-family: Cambria; color: rgb(195, 136, 9); margin-left: 4px;
text-indent: -4px; font-size: 18.6px; "><span style="color: #000000">tabelas</span><span style="color: #071a99"><-</span>function<span style="color: #071a99">(</span><span style="color: #000000">x</span><span style="color: #071a99">){</span></div>
<div style="font-family: Cambria; color: rgb(7, 26, 153); margin-left: 4px; text-indent: -4px; font-size: 18.6px; "><span style="color: #b01600"><span class="Apple-tab-span" style="white-space:pre"> </span></span><span style="color: #000000">Qtde</span><-table(<span style="color: #000000">x</span>)</div>
<div style="font-family: Cambria; color: rgb(7, 26, 153); margin-left: 4px; text-indent: -4px; font-size: 18.6px; "><span style="color: #b01600"><span class="Apple-tab-span" style="white-space:pre"> </span></span><span style="color: #000000">Perc</span><-<span style="color: #045218">100</span>*prop.table(table(<span style="color: #000000">x</span>))</div>
<div style="font-family: Cambria; color: rgb(0, 0, 0); margin-left: 4px; text-indent: -4px; font-size: 18.6px; "><span style="color: #b01600"><span class="Apple-tab-span" style="white-space:pre"> </span></span><span style="color: #071a99">cbind(</span>Qtde<span style="color: #071a99">,</span>Perc<span style="color: #071a99">)</span></div>
<div style="font-family: Cambria; color: rgb(176, 22, 0); margin-left: 4px; text-indent: -4px; font-size: 18.6px; "><span class="Apple-tab-span" style="white-space:pre"> </span><span style="color: #071a99">}</span></div><div style="font-family: arial, helvetica, sans-serif; color: rgb(0, 0, 0); "><br></div><div style="font-family: arial, helvetica, sans-serif; "><font color="#071a99">Gera tabelas do tipo:</font></div><div style="font-family: arial, helvetica, sans-serif; "><font color="#071a99"><br></font></div><div><font color="#071a99"><div><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;">$ida</span></div><div><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;"> Qtde Perc</span></div><div><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;">20 |-- 30 anos 39 34</span></div><div><span
style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;">30 |-- 40 anos 57 50</span></div><div><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;">40 anos ou mais 19 17</span></div><div><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;"><br></span></div><div><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;">A idade tem valores de 21 a 47 anos. </span></div><div><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;"><br></span></div><div><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;">Montei a rotina</span></div><div><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;"><br></span></div><div><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;"><div style="margin-left: 4px; text-indent:
-4px; font-size: 18.6px; font-family: Cambria; color: rgb(176, 22, 0); min-height: 22px; "><br></div>
<div style="margin-left: 4px; text-indent: -4px; font-size: 18.6px; font-family: Cambria; "><span style="color: #000000">m1</span>$<span style="color: #000000">ida</span><-rep(<span style="color: #c38809">NA</span>,length(<span style="color: #000000">m1</span>$<span style="color: #000000">idade</span>))</div>
<div style="margin-left: 4px; text-indent: -4px; font-size: 18.6px; font-family: Cambria; ">summary(<span style="color: #000000">m1</span>$<span style="color: #000000">idade</span>)</div>
<div style="margin-left: 4px; text-indent: -4px; font-size: 18.6px; font-family: Cambria; ">sd(m1$idade,na.rm=<span style="color: #c38809">T</span>)</div>
<div style="margin-left: 4px; text-indent: -4px; font-size: 18.6px; font-family: Cambria; ">m1$ida[<span style="color: #045218">20</span><=m1$idade&m1$idade<<span style="color: #045218">30</span>]<-<span style="color: #b01600">"20 |-- 30 anos"</span></div>
<div style="margin-left: 4px; text-indent: -4px; font-size: 18.6px; font-family: Cambria; ">m1$ida[<span style="color: #045218">30</span><=m1$idade&m1$idade<<span style="color: #045218">40</span>]<-<span style="color: #b01600">"30 |-- 40 anos"</span></div>
<div style="margin-left: 4px; text-indent: -4px; font-size: 18.6px; font-family: Cambria; color: rgb(176, 22, 0); "><span style="color: #000000">m1</span><span style="color: #071a99">$</span><span style="color: #000000">ida</span><span style="color: #071a99">[</span><span style="color: #000000">m1</span><span style="color: #071a99">$</span><span style="color: #000000">idade</span><span style="color: #071a99">>=</span><span style="color: #045218">40</span><span style="color: #071a99">]<-</span>"40 anos ou mais"</div><div><br></div></span></div><div><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;"><br></span></div><div><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;">Como faço para acrescentar a soma de Qtde e Perc?</span></div><div><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;"><br></span></div><div style="font-family: arial, helvetica, sans-serif;
"><br></div></font></div></span></div><div style="font-family: arial, helvetica, sans-serif; "></div><div style="font-family: arial, helvetica, sans-serif; ">[ ]'s.</div><div style="font-family: arial, helvetica, sans-serif; "> </div><div style="font-family: arial, helvetica, sans-serif; ">Edson Lira<br>Estatístico<br>Manaus-Amazonas</div></div></body></html>