<br><div class="gmail_quote">On Sat, Dec 26, 2009 at 10:04 PM, Karl O. Pinc <span dir="ltr">&lt;<a href="mailto:kop@meme.com">kop@meme.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On 12/26/2009 08:32:27 PM, Lacey Maryott Roerish wrote:<br>
<br>
&gt; There are no longer any males in the DB with a matgrp of 9, but whose<br>
&gt; members records place them in a study group since birth!<br>
<br>
</div>I&#39;m not sure exactly what you&#39;re cleaning up but there are a few<br>
left matching your conditions above.   And there also seem to be<br>
a number of others where somebody tried to clean up by putting<br>
census.status of A and C at the birthdate but census.status B<br>
rows remain and place the individuals into study groups (because<br>
the Bs were never removed?).  It&#39;s possible somebody did something<br>
for the conversion, maybe, to fix some sort of data integrity error<br>
and get the rows to go into the database.   In any case, there&#39;s<br>
something artificial going on because we don&#39;t have real A and C<br>
census rows going back that far.  (Do we?)<br></blockquote><div> </div><div>This is our temporary way of fixing this until real data goes in, but yes, in most (all but about 2) cases, these were pulled from actual census sheets that are just not yet digitized. </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Maybe what&#39;s left are the males that really were in the<br>
study groups when real censuses started?<br>
<br>
babase=&gt; select distinct sname from census where status = &#39;B&#39; order by<br>
sname;<br>
 sname<br>
-------<br>
 ALY<br>
 BAR<br>
 BJX<br>
 COW<br>
 DAR<br>
 DUT<br>
 HAR<br>
 IBI<br>
 IVA<br>
 KUS<br>
 LIP<br>
 MAX<br>
 MWA<br>
 NGU<br>
 PET<br>
 PIG<br>
 RAD<br>
 SEK<br>
 SIN<br>
 SLK<br>
 STB<br>
 TUL<br>
 WYM<br>
(23 rows)<br>
<br></blockquote><div>This matches perfectly the group of males I just fixed. I wasn&#39;t getting rid of all B rows. I was just fixing their records to indicate their exact date of entry into a study group and before hand, so that they are in grp 9 prior to their arrival...  The rest of the rows will get fixed with the &#39;true&#39; census fix in the spring. </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
babase=&gt; select census.grp, census.sname, biograph.matgrp, count(*)<br>
from census, biograph where census.status = &#39;B&#39; and biograph.sname =<br>
census.sname group by census.grp, census.sname, biograph.matgrp order<br>
by census.grp, census.sname;<br>
 grp  | sname | matgrp | count<br>
------+-------+--------+-------<br>
 1.00 | BJX   |   9.00 |     4<br>
 1.00 | COW   |   9.00 |   210<br>
 1.00 | DUT   |   9.00 |  1486<br>
 1.00 | IVA   |   9.00 |   329<br>
 1.00 | MAX   |   9.00 |  2023<br>
 1.00 | PET   |   9.00 |  2639<br>
 1.00 | SIN   |   9.00 |   471<br>
 1.00 | STB   |   9.00 |  1564<br>
 2.00 | ALY   |   9.00 |   515<br>
 2.00 | BAR   |   9.00 |   664<br>
 2.00 | HAR   |   9.00 |   810<br>
 2.00 | LIP   |   9.00 |    98<br>
 2.00 | SEK   |   9.00 |   232<br>
 2.00 | SLK   |   9.00 |  1902<br>
 2.00 | WYM   |   9.00 |   222<br>
 3.00 | NGU   |   9.00 |  1853<br>
 3.00 | RAD   |   9.00 |  3078<br>
 3.00 | TUL   |   9.00 |  1494<br>
 4.00 | IBI   |   9.00 |   570<br>
 4.00 | KUS   |   4.00 |  3413<br>
 4.00 | MWA   |   9.00 |  4019<br>
 4.00 | PIG   |   9.00 |   121<br>
 6.00 | DAR   |   9.00 |     1<br>
 9.00 | DAR   |   9.00 |  3638<br>
 9.00 | IBI   |   9.00 |  3267<br>
(25 rows)<br>
<br>
A lot seem to match the pattern shown below....<br>
<br>
babase=&gt; select * from census where census.sname = &#39;BJX&#39; order by<br>
census.date;<br>
  cenid  |    date    | sname |  grp  | status | cen<br>
---------+------------+-------+-------+--------+-----<br>
 2024695 | 1971-07-31 | BJX   |  1.00 | A      | t<br>
 2024694 | 1971-08-01 | BJX   |  1.00 | C      | t<br>
  147562 | 1971-08-02 | BJX   |  1.00 | B      | f<br>
  147635 | 1971-08-03 | BJX   |  1.00 | B      | f<br>
  147708 | 1971-08-04 | BJX   |  1.00 | B      | f<br>
  147781 | 1971-08-05 | BJX   |  1.00 | B      | f<br>
  147924 | 1971-08-06 | BJX   | 99.00 | S      | f<br>
  147997 | 1971-08-07 | BJX   | 99.00 | S      | f<br>
  148070 | 1971-08-08 | BJX   | 99.00 | S      | f<br>
  148143 | 1971-08-09 | BJX   | 99.00 | S      | f<br>
  148216 | 1971-08-10 | BJX   | 99.00 | S      | f<br>
  148289 | 1971-08-11 | BJX   | 99.00 | S      | f<br>
...<br>
<br>
While you&#39;re cleaning up arn&#39;t the &#39;S&#39; rows with<br>
a group of 99.00 redundant and able to be eliminated?<br></blockquote><div><br></div><div>Group 99 is our next project to get rid of.  It&#39;s on the list.  I am just doing one thing at a time based on problems that show up (males in study groups at birth who have mat grp 9, etc).    </div>
<div><br></div><div>Like I said above, we hope to have a LOT of the true census entered next semester.  We can&#39;t be sure yet how much will get done, but plan to devote at least 1 undergrad to that project alone. At that time this will all be cleaned up. This was just a temporary fix, and wasn&#39;t intended to affect males records after their date of entry, just before, and wasn&#39;t meant to be a full cleanup of B rows. But we&#39;re getting there :)</div>
<div><br></div><div>Cheers</div><div>Lacey</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
<br>
Karl &lt;<a href="mailto:kop@meme.com">kop@meme.com</a>&gt;<br>
Free Software:  &quot;You don&#39;t pay back, you pay forward.&quot;<br>
                 -- Robert A. Heinlein<br>
<br>
<br>
_______________________________________________<br>
Babase mailing list<br>
<a href="mailto:Babase@www.eco.princeton.edu">Babase@www.eco.princeton.edu</a><br>
<a href="http://www.eco.princeton.edu/mailman/listinfo/babase" target="_blank">http://www.eco.princeton.edu/mailman/listinfo/babase</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>- -<br>Lacey K. Maryott Roerish<br>Alberts Lab<br>Department of Biology<br>Duke University<br>ph: 919-660-7306<br>fax: 919-660-7293<br><a href="mailto:Lacey.Maryott@duke.edu">Lacey.Maryott@duke.edu</a><br>