[Basta-users] Repeatable Error: 1: In max(DeathAges, na.rm = TRUE) :

Colchero, Fernando Colchero at demogr.mpg.de
Wed Nov 9 10:11:08 CET 2011


Hi Cliff,

    From what I understand your study started in 1979, so I'm not sure why you want to set up the capture history matrix to start in 1978.

    The model is running through, but it cannot calculate the life table if all individuals were born before the study, since BaSTA will only use non-truncated individuals to build the life table. That is why in your second run BaSTA only uses a fraction of your records; it uses only individuals born during the study. 

   The Gompertz will not start at 0 mortality, since the b0 parameter (what demographers call 'a' parameter) will never be equal to 0. 

   Your problem, I believe, is that you are dealing with adult individuals (at least 1 year old), all or most of which were born before the study. I would use the argument minAge = 1 to avoid this problem. 

   Now, if al your records are from individuals born before the study, then I would run BaSTA with lifetable = FALSE, and then run the CalculateLifeTable function on the resulting Xq. Make sure that you subtract 1 to all the Xq so your age 0 on the life table corresponds to the minimum age.

   Finally, you are interested in finding negative senescence with these data. Gompertz won't be the best option, since you really need very high initial mortality. Use arguments model = "GO" and shape = "Makeham". This combination will allow you to detect negative senescence with very high initial mortality. For this you will need to install the BaSTA version on R-Forge, since we just corrected this.

   I hope this helps. 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 9, 2011, at 12:22 AM, Cliff Cunningham wrote:


	Dear Basta,
	I get the following error  when I run this script:

	 Fem1978only <- basta(object = Males.dat$newData, studyStart = 1978, studyEnd = 1982, model="GO" ,burnin=1000 ,niter=10000, nsim=4,parallel=TRUE, ncpus=4)

	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
	Full script and errors below

	This prevented me from using the out$lifeTable function, but was able to use the
	out$Xq  function, and count the 50% deaths.

	  I have 943 individuals of unknown age studied with the Gompertz, all marked in 1978, and followed till 1982

	Of these 773 were only seen the first year of the study (1978), yet basta estimates the first deaths at 3 years of age 

	The qx for those first deaths at 3 years old is is extremely high, but the qx for year 2 is zero.

	I interpret this absence of deaths in year 2 as being a way to fit the Gompertz mortality curve to the data, starting at 0 mortlity, and going up.  If the deaths are reported in year 3, then year 2 has 0 mortality, and goes up rapidly (the first qx is 0.95)

	This seems incorrect to me: 773 were only seen in year 1, some must have died in year 2.  As you can see the pi is 0.94, so you wouldn't expect such a long lag time to report the first deaths.  

   Estimate   StdErr Lower95%CI Upper95%CI SerAutocor UpdateRate PotScaleReduc	 	
b0	 -2.3926	 0.183197	 -2.7062	 -2.0079	 0.62626	 0.3755	 1.001	 
b1	 0.6992	 0.052093	 0.5881	 0.7925	 0.60219	 0.3755	 1	 
pi	 0.9438	 0.009978	 0.9223	 0.9617	 0.04917	 1	 1.001	 



	When I run the individuals first marked in 1979 in the same population and  followed through to 1982, I get a similar pattern of first deaths at age 3, even though 660 of the total 768 individuls were only seen in 1979 and never again, also with extremely high "pi" values of 94%

   Estimate   StdErr Lower95%CI Upper95%CI SerAutocor UpdateRate PotScaleReduc	 	
b0	 -2.3926	 0.183197	 -2.7062	 -2.0079	 0.62626	 0.3755	 1.001	 
b1	 0.6992	 0.052093	 0.5881	 0.7925	 0.60219	 0.3755	 1	 
pi	 0.9438	 0.00991978	 0.9223	 0.9617	 0.04917	 1	 1.001	 



	Finally, when I combine the 1978 and 1979 marked individuals, all hell breaks loose.  No errors are reported, but the 

	Fem78and79$lifeTable  command only reveals the life table for the 768 individuals first observed in 1979, even though basta reports that all 1711 individuals were read, and I can see all the ages at death when I use the Fem78and79$Xq  command

	This gives individuals marked in 1978 their first deaths at age 3, and individuals marked in 1979 their first deaths at age 2.

	
	I know this is complicated, but this is a dataset you may want to take a look at, as I consider the output difficult to interpret.





	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




	_______________________________________________
	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.

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


More information about the Basta-users mailing list