[R] significant difference between Gompertz hazard parameters?

2012-06-30 Thread piltdownpunk
Hello, all. I have co-opted a number of functions that can be used to plot the hazard/survival functions and associated density distribution for a Gompertz mortality model, given known parameters. The Gompertz hazard model has been shown to fit relatively well to the human adult lifespan. For ex

[R] summing two probability density functions from Gompertz hazard model

2012-04-23 Thread piltdownpunk
Hi, r-help members. I have a question about summing two density distributions. I have two samples from which I've estimated hazard parameters for a Gompertz mortality model. With those parameters, I can calculate the PDF (survival function times hazard function) of ages-at-death in a birth cohor

[R] using a loop with an integration

2012-04-22 Thread piltdownpunk
Hi, all. I've written a function that returns the survival function for a Gompertz mortality model. I've specified the two model parameters. Using a simple integration, I can calculate the life expectancy at any age. Is there a way I can use a loop with the integration that will quickly return

[R] Gompertz-Makeham hazard models---test for significant difference

2012-04-15 Thread piltdownpunk
Hi, all. I'm working with published paleodemographic data (counts of skeletons that have been assigned into an age-range category, based upon observed morphological characteristics). For example, the following is the age distribution from a prehistoric cemetery in Egypt: naga <- structure(c(15,2