Re: [R] sequential treatment of a vector for formula

2010-05-27 Thread Wu Gong
Thank you very much David. I'm sorry for this fault , hope it has not confused Frostygoat. I was clueless of recursive reference and I didn't meet any error when I test the code. So I wonder if there are some useful tips to prevent making this kind of faults:) The revised code is followed. ###

Re: [R] sequential treatment of a vector for formula

2010-05-27 Thread Bert Gunter
: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of David Winsemius Sent: Thursday, May 27, 2010 10:04 AM To: Frostygoat Cc: R-help@r-project.org Help; Bert Gunter Subject: Re: [R] sequential treatment of a vector for formula On May 27, 2010, at 12:32 PM, Frostygoat wrote:

Re: [R] sequential treatment of a vector for formula

2010-05-27 Thread David Winsemius
On May 27, 2010, at 12:32 PM, Frostygoat wrote: Thanks very much David. Bert, I've seen the Survival package and it survival ... correct capitalization is important in R. does not do what I need, which is to fit Gompertz curves to survival data and compute lifetable statistics for other f

Re: [R] sequential treatment of a vector for formula

2010-05-27 Thread Frostygoat
Thanks very much David. Bert, I've seen the Survival package and it does not do what I need, which is to fit Gompertz curves to survival data and compute lifetable statistics for other functions. There is the SSgompertz package for growth curves, not what I need either. ___

Re: [R] sequential treatment of a vector for formula

2010-05-27 Thread David Winsemius
On May 27, 2010, at 12:42 AM, Wu Gong wrote: I don't know if my understanding of P is right. P ?= (the number of lives at the end of the interval)/(the number of lives at the beginning of the interval) In standard actuarial parlance one would use lower case p_x for that quantity and wo

Re: [R] sequential treatment of a vector for formula

2010-05-26 Thread Wu Gong
I don't know if my understanding of P is right. P ?= (the number of lives at the end of the interval)/(the number of lives at the beginning of the interval) ### Compute proportion of a cohort that survives through the interval ### The formula is P0=L1/LO ## Original data is a vector of death da

Re: [R] sequential treatment of a vector for formula

2010-05-26 Thread David Winsemius
On May 26, 2010, at 10:50 PM, David Winsemius wrote: On May 26, 2010, at 6:24 PM, Frostygoat wrote: Please pardon the simplicity of this question of biological nature. I'm trying to calculate a statistic, px, the proportion of a cohort that survives through the interval x:x+1. I have the ve

Re: [R] sequential treatment of a vector for formula

2010-05-26 Thread David Winsemius
On May 26, 2010, at 6:24 PM, Frostygoat wrote: Please pardon the simplicity of this question of biological nature. I'm trying to calculate a statistic, px, the proportion of a cohort that survives through the interval x:x+1. I have the vector from which the calc is to be made but I can't figur

[R] sequential treatment of a vector for formula

2010-05-26 Thread Frostygoat
Please pardon the simplicity of this question of biological nature. I'm trying to calculate a statistic, px, the proportion of a cohort that survives through the interval x:x+1. I have the vector from which the calc is to be made but I can't figure out how to tell R to take the current value and d