piltdownpunk
2012-Jul-01 04:04 UTC
[R] significant difference between Gompertz hazard parameters?
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 example, if I
wanted to plot the hazard (i.e., mortality) functions:
pop1 <- function (t)
{
x=c(0.03286343, 0.04271132)
a3<-x[1]
b3<-x[2]
shift<-15 # only considering mortality after 15 years
h.t<-a3*exp(b3*(t-shift))
return<-h.t
}
pop2 <- function (t)
{
x=c(0.02207778, 0.04580059)
a3<-x[1]
b3<-x[2]
shift<-15 # only considering mortality after 15 years
h.t<-a3*exp(b3*(t-shift))
return<-h.t
}
ylab.name <-
expression(paste(italic(h),"(",italic(a),")"))
plot(seq(15,80,1),pop1(seq(15,80,1)),type='l',ylab=ylab.name,xlab='Age
(years)',ylim=c(0,0.8))
lines(seq(15,80,1),pop2(seq(15,80,1)),lty=2)
How may I test for a significant difference in the hazard parameters that
define the mortality experience for these two populations? Thanks in
advance.
Regards,
Trey
-----
Trey Batey---Anthropology Instructor
Division of Social Sciences
Mt. Hood Community College
Gresham, OR 97030
Alt. Email: trey.batey[at]mhcc[dot]edu
--
View this message in context:
http://r.789695.n4.nabble.com/significant-difference-between-Gompertz-hazard-parameters-tp4635018.html
Sent from the R help mailing list archive at Nabble.com.
David Winsemius
2012-Jul-01 14:40 UTC
[R] significant difference between Gompertz hazard parameters?
On Jul 1, 2012, at 12:04 AM, piltdownpunk wrote:> 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 > example, if I > wanted to plot the hazard (i.e., mortality) functions: > > pop1 <- function (t) > { > x=c(0.03286343, 0.04271132) > a3<-x[1] > b3<-x[2] > shift<-15 # only considering mortality after 15 years > > h.t<-a3*exp(b3*(t-shift)) > return<-h.t > } > > pop2 <- function (t) > { > x=c(0.02207778, 0.04580059) > a3<-x[1] > b3<-x[2] > shift<-15 # only considering mortality after 15 years > > h.t<-a3*exp(b3*(t-shift)) > return<-h.t > } > > ylab.name <- expression(paste(italic(h),"(",italic(a),")")) > plot(seq(15,80,1),pop1(seq(15,80,1)),type='l',ylab=ylab.name,xlab='Age > (years)',ylim=c(0,0.8)) > lines(seq(15,80,1),pop2(seq(15,80,1)),lty=2) > > How may I test for a significant difference in the hazard parameters > that > define the mortality experience for these two populations? Thanks in > advance. >You cannot test for differences in pre-specified parameters. These are by definition, "different". If you supply some data, possibly generated through simulations, you can test for differences in fit using parametric fits. The survival package offers facilities for fitting, and in the Archives you can find several responses from Terry Therneau to questions about fitting data to Gompertz or Gompertz- Makeham distributions.>-- David Winsemius, MD West Hartford, CT