[Babase] RE: biograph question

Niki Learn nlearn at princeton.edu
Thu Dec 3 22:06:00 EST 2009


Right, the purpose of censoring the males is so they won't be recognized as
"alive" (i.e., cannot have data entered after their statdates).  Since we
need to have a nonzero dcause for all animals not "alive" (status = 0), we
will definitely need to add a dcause to go with the censored status.
Currently the dcauses go from 0 to 8 (0 being alive and all others some form
of dead).  Shall we use 9 for censored?  Or would a more removed number
(like 99?) be preferred to make it more obvious that the animal isn't
necessarily dead, yet is not recognized as "alive"?

I will look over the alive and dead documentation when I have a chance and
see what may need to be changed.  Thanks, Karl.

Niki

-----Original Message-----
From: Karl O. Pinc [mailto:kop at meme.com] 
Sent: Wednesday, November 25, 2009 4:35 PM
To: Niki Learn; babase at eeblistserv.Princeton.EDU
Subject: Re: biograph question

On 11/25/2009 02:17:51 PM, Niki Learn wrote:
> Karl,
> 
>  
> 
> So I was trying to implement this change to biograph where we censor
> the old
> animals and the males that have left the study groups and haven't 
> been
> seen
> for at least one update period.and I hit a snag.  I added the new
> status
> code to the statuses table - 2 for Censored.  But then if I try to
> change an
> individual to censored, I get this error message:
> 
>  
> 
> SQL error:
> 
> ERROR:  new row for relation "biograph" violates check constraint
> "Dcause
> for live animal, or no dcause for dead animal"
> 
> In statement:
> UPDATE "biograph" SET "bioid"='1386', "sname"='BAK', "name"='BAKARI',
> "pid"=NULL, "birth"='1999-10-01', "bstatus"='1', "sex"='M',
> "matgrp"='9.00',
> "statdate"='2007-11-23', "status"='2', "dcause"='0' WHERE
> "bioid"='1386'
> 
>  
> 
> It looks like there is a check in biograph that says you can't have a
> dcause
> for an animal with status 1 and you can't have an animal that is not
> "live"
> (where live is only status 1) that does not have a dcause and since
> the new
> status of 2 does not have a dcause associated with it, babase doesn't
> like
> it.  Even the one appearance of code 4 has a dcause of 7 (unknown)
> even
> though that individual isn't necessarily dead.

Yes, Babase requires that a BIOGRAPH.Status of 0 (0 not 1) be the 
only status where the individual is alive.  (See the "Special Values"
section in the docs on the STATUSES table:
https://papio.biology.duke.edu/babase_system_html/ch06s02.html
)

Anybody who's not alive needs a dcause.

> 
>  
> 
> So I guess that means either I should invent a dcause that's not
> really a
> dcause but a "censor cause" to go with the censored status or we need
> to
> revise the checks somehow.  What do you advise?  Can we make status 2
> count
> as live for the purposes of this check so it won't be violated or
> would that
> muck up other things?

I don't think we want a status of 2 to be alive -- in other words I
think we need to refine the definition of what "alive", Status code
0, means.  IIRC what Status 0 means to the system is that you can
put in data after the Statdate and the Statdate will then automatically
update to the newer date.  We probably don't want this behavior
for censored individuals and so don't want to classify them as
"alive" in this sense.  Do we?  IIRC anybody that's dead has
a "Statdate that sticks", one that does not change and one
that does not allow anything to happen to the individual
after the Statdate.  It seems right to have this sort of behavior
for censored individuals but I want to hear what everybody
else says.

"Alive" isn't really "alive in real life", it's "an individual
on which new data is continuing to be collected".

So I'd go for adding a censored "cause of death" and using that
along with the censored status value.

We also need to update the Babase system documentation to make
all of this more clear; to document exactly what 'alive' means.
It's in the documentation now but spread out in various places
where it says what alive or dead individuals can or can't do.

We may want to search the documentation for the words 'alive'
and 'dead' and see what comes up.  (Via the "everything on
one page version" would be easiest.)  If you guys want me
to do the work I can search the validation code for everyplace
the status is tested for aliveness and come up with a list
that way.  This will give us a precise idea of exactly what
alive means.

What does everybody else think and what should the above
referenced documentation say about what it means to babase
for an individual to be alive?  What about the DCAUSES
documentation.  Should it say more?


Karl <kop at meme.com>
Free Software:  "You don't pay back, you pay forward."
                 -- Robert A. Heinlein




More information about the Babase mailing list