[Basta-users] out$lifetable errors

Owen Jones jonesor at gmail.com
Mon Nov 7 11:58:08 CET 2011


When it is called from within the basta function, MakeLifeTable subsets the data to only include those individuals that are born within the study period.

You can run MakeLifeTable *after* basta has run, on the out$Xq matrix.

e.g. MakeLifeTable(out$Xq[1,])

In the case where you make all birth dates within the study period, and the error messages are not produced, a life table will be produced.

out$lifeTable (note the upper case T in table - you had a typo in your code).


Cheers,
Owen



On 7 Nov 2011, at 11:45, Cliff Cunningham wrote:

> Dear Fernando and Owen,
> 
> 	I get the "NULL" when I type
> out$lifetable
> 
> even  when I make all the birthdates at 1979 (within the time of the study), though these errors disappear:
> 
>>> .Warning messages:
>>> 1: In max(DeathAges, na.rm = TRUE) :
>>>   no non-missing arguments to max; returning -Inf
>>> 2: In max(wa) : no non-missing arguments to max; returning -Inf
>>> 3: In MakeLifeTable(x, ax = 0.5, n = 1) : NAs introduced by coercion
> 
> 
> 
> 	On the very bright side I was able to calculate a great life table by hand that made perfect sense when I used
> 
> out$Xq
> 
> 	to output all the ages at death.  This gave exactly the qx's I was expecting (since this example had 100% recapture rate, just to test the output).  
> 
> 	So its not that it wasn't calculating the ages at death.
> 	
> 	All the best!
> 
>    	Cliff Cunningham
> 
> 
>         Professor
> 	Biology Department
>     	Duke University
>         130 Science Drive
> 	Durham NC 27708
> 	Phone 919-660-7356
> 
> http://www.biology.duke.edu/cunningham
> 
> 
> 
> 
> On Nov 7, 2011, at 11:23 AM, Colchero, Fernando wrote:
> 
>> Dear Cliff,
>> 
>>    Were all birth times in 1978? If that's the case, then the life table cannot be constructed because it uses non-truncated individuals (i.e. only those that were born during the study). Still, we do have a bug, since the model should report that more explicitly. We'll try to fix it as soon as possible.
>> 
>>    Best,
>> 
>>    Fernando
>> 
>> ______________________________________________
>>  
>> Fernando Colchero
>> 
>> Max Planck Institute for Demographic Research
>> Konrad Zuse Str. 1, 18057, Rostock, Germany
>> Tel:  +49 (0) 381 2081 113
>> Fax: +49 (0) 381 2081 529
>> E-mail: Colchero at demogr.mpg.de
>> ______________________________________________
>> 
>> 
>> 
>> 
>> 
>> On Nov 7, 2011, at 11:03 AM, Cliff Cunningham wrote:
>> 
>>> Dear BaSTa,
>>> 	After several runs I have typed  out$lifetable and got the following
>>> 
>>> > out$lifetable
>>> NULL
>>> 
>>> 	I should report I got several warning messages (see bottom) when I ran the following: 
>>> Survival parameters converged appropriately. 
>>> DIC was calculated
>>> .Warning messages:
>>> 1: In max(DeathAges, na.rm = TRUE) :
>>>   no non-missing arguments to max; returning -Inf
>>> 2: In max(wa) : no non-missing arguments to max; returning -Inf
>>> 3: In MakeLifeTable(x, ax = 0.5, n = 1) : NAs introduced by coercion
>>> 
>>> 
>>> My code was as follows, 
>>> 
>>> out <- basta(object = Males.dat$newData, studyStart = 1979, studyEnd = 1982, burnin=1000 ,niter=10000, nsim=4, parallel=TRUE, ncpus=4)
>>> 
>>> 	In this one I had all the birthdays at 1978, and first captures in 1979.
>>> 
>>> 
>>> 
>>> 
>>> Here are the errors from the 
>>> Multiple simulations finished.
>>> Total MCMC computing time: 3.91 minutes
>>> 
>>> Thanks so much!!
>>> 
>>>    	Cliff Cunningham
>>> 
>>> 
>>>         Professor
>>> 	Biology Department
>>>     	Duke University
>>>         130 Science Drive
>>> 	Durham NC 27708
>>> 	Phone 919-660-7356
>>> 
>>> http://www.biology.duke.edu/cunningham
>>> 
>>> 
>>> 
>>> 
>>> _______________________________________________
>>> Basta-users mailing list
>>> Basta-users at lists.r-forge.r-project.org
>>> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/basta-users
>> 
>> ----------
>> 
>> This mail has been sent through the MPI for Demographic Research. Should you receive a mail that is apparently from a MPI user without this text displayed, then the address has most likely been faked. If you are uncertain about the validity of this message, please check the mail header or ask your system administrator for assistance.
>> 
>>  
> 
> _______________________________________________
> Basta-users mailing list
> Basta-users at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/basta-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/basta-users/attachments/20111107/78f0f1ff/attachment.htm>


More information about the Basta-users mailing list