This is what you asked for.

> Prod2007 <- 1:10

> Prod2006 <- Prod2007/1+c(0,diff(Prod2007))

> Prod2005 <- Prod2006+(1+c(0,diff(Prod2006)))

> Prod2004 <- Prod2005+(1+c(0,diff(Prod2005)))

> Prod2006
 [1]  1  3  4  5  6  7  8  9 10 11

> Prod2005
 [1]  2  6  6  7  8  9 10 11 12 13

> Prod2004
 [1]  3 11  7  9 10 11 12 13 14 15

Sure that's what you want?

On Thu, Jun 3, 2010 at 12:30 PM, n.vialma@libero.it <n.vialma@libero.it>wrote:

>
> Dear list,
> I would like to ask you a question. I'm trying to build  the time series'
> production with the Divisia index. The final step would require to do the
> following calculations:
> a)PROD(2006)=PROD(2007)/1+[DELTA_PROD(2007)]
> b)PROD(2005)=PROD(2006)+[1+DELTA_PROD(2006)]
> c)PROD(2004)=PROD(2005)+[1+DELTA_PROD(2005)]
> my question is how can I tell R to take the value generated in the previous
> step (for example is the case of the produciton of 2005 that need the value
> of the production of 2006) in order to generate the time series production??
> (PS:my data.frame is not set as a time series)
> Thanks for your attention!!
>
>
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> 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.
>



-- 
Joris Meys
Statistical Consultant

Ghent University
Faculty of Bioscience Engineering
Department of Applied mathematics, biometrics and process control

Coupure Links 653
B-9000 Gent

tel : +32 9 264 59 87
Joris.Meys@Ugent.be
-------------------------------
Disclaimer : http://helpdesk.ugent.be/e-maildisclaimer.php

	[[alternative HTML version deleted]]

