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 cohort subject to the hazard function at each age. I'd like to combine these two density functions and recalculate the resultant hazard parameters that describe the combined group. Is there any way to do so? Unfortunately, the two datasets, from which I estimated the initial parameters, are not in the same format, so I can't just combine counts of individuals by age or age category and calculate the parameters that way. I've included my functions for the two distributions below. Any suggestions are welcome. Thanks.
--Trey group1<- function (t){ x=c(0.05893007, 0.03339980) a3<-x[1] b3<-x[2] shift<-15 S.t <- exp(a3/b3*(1-exp(b3*(t-shift)))) h.t <- a3*exp(b3*(t-shift)) return<-S.t*h.t} plot(seq(15,80,1),group1(seq(15,80,1)),type='l',xlab='Age years)',ylim=c(0,0.12)) # plot age-at-death distribution for group 1 group2<- function (t){ x=c(0.05920472, 0.01128975) a3<-x[1] b3<-x[2] shift<-15 S.t <- exp(a3/b3*(1-exp(b3*(t-shift)))) h.t <- a3*exp(b3*(t-shift)) return<-S.t*h.t} plot(seq(15,80,1),group2(seq(15,80,1)),type='l',xlab='Age (years)',ylim=c(0,0.12)) # plot age-at-death distribution for group 2 ----- 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/summing-two-probability-density-functions-from-Gompertz-hazard-model-tp4581793p4581793.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.