<div dir="ltr">Olá, pessoal! <div><br></div><div>Este parece ser um problema fácil de resolver, mas não estou conseguindo!!</div><div><br></div><div>Tenho um conjunto de dados (com quase 3000 linhas) que relaciona a resposta de um voluntário sob várias condições experimentais, cada uma dela com seus respectivos níveis. Exemplo:</div><div>












<table border="0" cellpadding="0" cellspacing="0" width="256" style="border-collapse:collapse;width:192pt">

 <colgroup><col width="64" span="4" style="width:48pt">
 </colgroup><tbody><tr height="20" style="height:15pt">
  <td height="20" width="64" style="height:15pt;width:48pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-weight:400;font-style:normal;text-decoration:none;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap">         resp</td>
  <td width="64" style="width:48pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-weight:400;font-style:normal;text-decoration:none;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap">             V1</td>
  <td width="64" style="width:48pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-weight:400;font-style:normal;text-decoration:none;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap">              V2</td>
  <td width="64" style="width:48pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-weight:400;font-style:normal;text-decoration:none;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap">              V3</td>
 </tr>
 <tr height="20" style="height:15pt">
  <td height="20" align="right" style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-weight:400;font-style:normal;text-decoration:none;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap">0.35</td>
  <td align="right" style="padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-weight:400;font-style:normal;text-decoration:none;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap">1</td>
  <td align="right" style="padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-weight:400;font-style:normal;text-decoration:none;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap">1</td>
  <td align="right" style="padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-weight:400;font-style:normal;text-decoration:none;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap">1</td>
 </tr>
 <tr height="20" style="height:15pt">
  <td height="20" align="right" style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-weight:400;font-style:normal;text-decoration:none;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap">0.38</td>
  <td align="right" style="padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-weight:400;font-style:normal;text-decoration:none;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap">1</td>
  <td align="right" style="padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-weight:400;font-style:normal;text-decoration:none;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap">2</td>
  <td align="right" style="padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-weight:400;font-style:normal;text-decoration:none;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap">1</td>
 </tr>
 <tr height="20" style="height:15pt">
  <td height="20" align="right" style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-weight:400;font-style:normal;text-decoration:none;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap">0.65</td>
  <td align="right" style="padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-weight:400;font-style:normal;text-decoration:none;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap">1</td>
  <td align="right" style="padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-weight:400;font-style:normal;text-decoration:none;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap">3</td>
  <td align="right" style="padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-weight:400;font-style:normal;text-decoration:none;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap">1</td>
 </tr>
 <tr height="20" style="height:15pt">
  <td height="20" align="right" style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-weight:400;font-style:normal;text-decoration:none;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap">0.49</td>
  <td align="right" style="padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-weight:400;font-style:normal;text-decoration:none;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap">1</td>
  <td align="right" style="padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-weight:400;font-style:normal;text-decoration:none;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap">4</td>
  <td align="right" style="padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-weight:400;font-style:normal;text-decoration:none;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap">1</td>
 </tr>
 <tr height="20" style="height:15pt">
  <td height="20" align="right" style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-weight:400;font-style:normal;text-decoration:none;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap">-0.25</td>
  <td align="right" style="padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-weight:400;font-style:normal;text-decoration:none;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap">0</td>
  <td align="right" style="padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-weight:400;font-style:normal;text-decoration:none;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap">1</td>
  <td align="right" style="padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-weight:400;font-style:normal;text-decoration:none;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap">2</td>
 </tr>
 <tr height="20" style="height:15pt">
  <td height="20" align="right" style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-weight:400;font-style:normal;text-decoration:none;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap">-1</td>
  <td align="right" style="padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-weight:400;font-style:normal;text-decoration:none;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap">0</td>
  <td align="right" style="padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-weight:400;font-style:normal;text-decoration:none;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap">2</td>
  <td align="right" style="padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-weight:400;font-style:normal;text-decoration:none;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap">2</td>
 </tr>
 <tr height="20" style="height:15pt">
  <td height="20" align="right" style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-weight:400;font-style:normal;text-decoration:none;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap">-0.73</td>
  <td align="right" style="padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-weight:400;font-style:normal;text-decoration:none;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap">0</td>
  <td align="right" style="padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-weight:400;font-style:normal;text-decoration:none;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap">3</td>
  <td align="right" style="padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-weight:400;font-style:normal;text-decoration:none;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap">2</td>
 </tr>
 <tr height="20" style="height:15pt">
  <td height="20" align="right" style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-weight:400;font-style:normal;text-decoration:none;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap">-0.47</td>
  <td align="right" style="padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-weight:400;font-style:normal;text-decoration:none;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap">0</td>
  <td align="right" style="padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-weight:400;font-style:normal;text-decoration:none;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap">4</td>
  <td align="right" style="padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-weight:400;font-style:normal;text-decoration:none;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap">2</td>
 </tr>

</tbody></table>



<br></div><div><span style="color:rgb(34,34,34);font-family:sans-serif;font-size:13px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Para realizar uma análise, por exemplo, vou precisar de </span><span style="color:rgb(34,34,34);font-family:sans-serif;font-size:13px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><b>um vetor</b></span><span style="color:rgb(34,34,34);font-family:sans-serif;font-size:13px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> com as respostas apenas para o nível 1 de V2 ou, por exemplo, de</span><span style="color:rgb(34,34,34);font-family:sans-serif;font-size:13px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><b> um vetor</b></span><span style="color:rgb(34,34,34);font-family:sans-serif;font-size:13px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> com as respostas apenas para o nível 2 de V3. </span><br></div><div><span style="color:rgb(34,34,34);font-family:sans-serif;font-size:13px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div><span style="color:rgb(34,34,34);font-family:sans-serif;font-size:13px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Tentei a função aggregate mas não consegui. Vocês poderiam me ajudar?</span></div><div><span style="color:rgb(34,34,34);font-family:sans-serif;font-size:13px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div><span style="color:rgb(34,34,34);font-family:sans-serif;font-size:13px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Desde já agradeço a todos. </span></div><div><span style="color:rgb(34,34,34);font-family:sans-serif;font-size:13px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div><span style="color:rgb(34,34,34);font-family:sans-serif;font-size:13px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Um abraço,</span></div><div><span style="color:rgb(34,34,34);font-family:sans-serif;font-size:13px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Manasses</span></div><div><br></div><div><div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><i><b>I am a brain, Watson. The rest of me is a mere appendix. <br></b></i></div><i><b>(Sherlock Holmes)<br></b></i></div></div></div></div></div>