[R] how to construct a time series
dwinsemius at comcast.net
Thu Apr 1 18:17:23 CEST 2010
On Apr 1, 2010, at 9:56 AM, n.vialma at libero.it wrote:
> I need to generate the time series of the production, but as I'm new
> to this
> topic I am not able to do that. This is what the time series should
It would make more sense to give a name to the LHS series that was
different than the (higher dimensional) data input.
> from PROD(t-2)...it will get the same expression; where PROD(t,T) is
> the value
> of the production at t for the sample of firms presented at T and T-1;
> Someone knows how to get it???
You have not provided a reproducible example from which to proceed
(and have not even used correct R syntax in what you request), but it
appears you will probable get success with matrix indexing that
generates diagonal or sub-diagonal series processed with the cumprod
> PROD <- matrix(1:25, nrow=5)
[4,] 9 14 19 24
 2 8 14 20
 2 16 224 4480
#cumulative product of first sub-diagonal.
More information about the R-help