Displaying 1 result from an estimated 1 matches for "zzcum".
Did you mean:
zum
2006 Aug 31
2
cumulative growth rates indexed to a common starting point over n series of observations
What is the R way of computing cumulative growth rates given a series of
discrete values indexed .
For instance, given a matrix of 20 observations for each of 5 series (zz),
what is the most straight forward technique in R for computing cumulative
growth (zzcum) ?
It seems for the solution I'm after might be imbedding the following cum
growth rate calc as a function into a function call to apply, mapply, ...?
zz = rnorm(100)
dim(zz) = c(20,5)
zz
zzcum=matrix(nrow=20,ncol=5)
zzcum
zzcum[1,]=100*(1+zz[1,]/100)
zzcum
for(i in 2:20){zzcum[i,] = zzcum...