We typically treat such data as errors, as in the team either putting in the wrong sname, or simply having a typo.  However, when it occurs this much, I often talk with Susan about the possibility that he wasn&#39;t really gone, just missed in a lot of censuses as a result of being left off the sheet.<div>
<br></div><div>At any rate, our protocol calls for just changing it to unk neighbor since it is clear someone was the neighbor, just not the animal the team put in.</div><div><br></div><div>I will be out this afternoon with more appointments, but can start to fix these tomorrow if need be.</div>
<div><br></div><div>As far as a view goes, we don&#39;t tend to use that data often, and when we do, it is fairly simple to pull together with sample and point ids. It just seems like a lot more than it is when presented in query format.</div>
<div><br></div><div>Lacey<br><br><div class="gmail_quote">On Wed, Jan 20, 2010 at 10:46 AM, Niki Learn <span dir="ltr">&lt;<a href="mailto:nlearn@princeton.edu">nlearn@princeton.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5">-----Original Message-----<br>
From: <a href="mailto:babase-bounces@eeblistserv.Princeton.EDU">babase-bounces@eeblistserv.Princeton.EDU</a><br>
[mailto:<a href="mailto:babase-bounces@eeblistserv.Princeton.EDU">babase-bounces@eeblistserv.Princeton.EDU</a>] On Behalf Of Karl O. Pinc<br>
Sent: Tuesday, January 19, 2010 4:12 PM<br>
To: The Baboon Database Project<br>
Subject: Re: [Babase] Samples/neighbors error when attempting to censor<br>
males<br>
<br>
On 01/19/2010 01:11:55 PM, Niki Learn wrote:<br>
<br>
&gt; ERROR:  DIG: BIOGRAPH.Statdate cannot be less than SAMPLES.Date<br>
&gt; unless<br>
&gt; NEIGHBORS.Sname individual is alive<br>
&gt;<br>
&gt; ERROR:  LUI: BIOGRAPH.Statdate cannot be less than SAMPLES.Date<br>
&gt; unless<br>
&gt; NEIGHBORS.Sname individual is alive<br>
<br>
&gt; So I looked these guys up in samples and Luigi didn&#39;t even have an<br>
&gt; entry.<br>
&gt; Meanwhile Digit had many entries but his last entry was for 25 Aug<br>
&gt; 2007,<br>
&gt; which matches his last census entry and current statdate.  I am<br>
&gt; trying<br>
&gt; to<br>
&gt; change his statdate to a censordate of 27 Aug 2007, which is NOT less<br>
&gt; than<br>
&gt; the last samples date.  Neighbors doesn&#39;t even have dates.  I&#39;m not<br>
&gt; real<br>
&gt; familiar with how those tables interact so I don&#39;t know where else to<br>
&gt; look<br>
&gt; for whatever is causing this error.<br>
<br>
The place to look is the social interactions ER diagram on page<br>
10 of the pocket reference.<br>
<br>
DIG is a neighbor of DIB as of 2008-10-13, so you can&#39;t &quot;stop his<br>
existance&quot; after 27 Aug 2007, which is what setting his Statdate<br>
back would do, when his Status is not 0 (alive).  I presume you&#39;re<br>
also changing his Status to 2 (censored).<br>
<br>
select samples.date, samples.sname, neighbors.sname, neighbors.ncode<br>
  from samples, point_data, neighbors<br>
  where neighbors.sname = &#39;DIG&#39;<br>
        and neighbors.pntid = point_data.pntid<br>
        and point_data.sid = samples.sid<br>
  order by samples.date desc, samples.stime desc;<br>
<br>
We could change the rules for Status = 2 (censored) but<br>
I don&#39;t think we really want to.  (Right?)<br>
<br>
The error message is not the best.  The key indicator<br>
is that it talks about NEIGHBORS.Sname as the problematic<br>
column.  I&#39;d be happy to come up with a better message<br>
but suspect this is a systemic problem.  I&#39;m<br>
(very likely) using the same error message you&#39;d get<br>
if you messed around in the NEIGHBORS table<br>
and have probably written error messages in this<br>
fashion all over the system.  Anyhow, suggestions<br>
are welcome.<br>
<br>
I didn&#39;t look at LUI but I suspect something similar.<br>
If he&#39;s still a problem let me know and please tell<br>
me exactly what it was you were trying to do when<br>
you got the error.  (I know your brain is running<br>
on empty at times these days.)<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>
</div></div>NIKI WRITES:<br>
Okay - that&#39;s a lot of typing to find out who someone&#39;s neighbor is.  Should<br>
we have a view for that or something?<br>
<br>
I&#39;m still confused as to how DIG (or any others) could be listed as another<br>
baboon&#39;s neighbor after he has stopped showing up in the census.  So Digit<br>
was last censused on 25 Aug 2007 but according to the output of Karl&#39;s code<br>
he was someone&#39;s neighbor 18 times after that in September 2007 and<br>
September and October 2008.  How is this possible?  And why isn&#39;t it<br>
reflected in his statdate?<br>
<br>
2008-10-13 | DIB   | DIG   | 1<br>
2008-10-13 | DIB   | DIG   | 1<br>
2008-10-13 | DIB   | DIG   | 1<br>
2008-09-18 | VIN   | DIG   | 1<br>
2008-09-18 | VIN   | DIG   | 1<br>
2008-09-18 | VIN   | DIG   | 1<br>
2008-09-18 | VIN   | DIG   | 1<br>
2008-09-18 | VIN   | DIG   | 1<br>
2008-09-18 | RIS   | DIG   | 2<br>
2008-09-06 | ROX   | DIG   | 1<br>
2008-09-06 | ROX   | DIG   | 1<br>
2008-09-06 | DIB   | DIG   | 3<br>
2008-03-24 | YOK   | DIG   | 1<br>
2008-03-24 | YOK   | DIG   | 1<br>
2007-09-01 | VEB   | DIG   | 1<br>
2007-09-01 | VEB   | DIG   | 1<br>
2007-09-01 | VEB   | DIG   | 1<br>
2007-09-01 | VEB   | DIG   | 2<br>
2007-08-18 | DUN   | DIG   | A<br>
2007-08-08 | IRI   | DIG   | 2<br>
<div><div></div><div class="h5"><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>
</div></div></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>

</div>