Skip to content
Back to formatted view

Raw Message

Message-ID: <41ACE9D9.5080902@acelerate.com>
Date: 2004-11-30T21:44:57Z
From: Kjetil Halvorsen
Subject: Relative subscripting
In-Reply-To: <41ACDBF4.7070804@lse.ac.uk>

Tobias Muhlhofer wrote:

> Hi!
>
> I'm trying to do the following.
>
> I have monthly a dataset with, among other things, "marketcap", and 
> "return".
>
> I want to multiply return by the marketcap of the previous month. How 
> do I do this?
>
> In STATA (which I have used frequently in the past) I would simply use 
> an expression of the form
>
> return[_n]*marketcap[_n-1]
>
> I believe they call this relative subscripting. Is there something 
> like this in R?
>
> On a completely different note, are there books on R? I read the 
> "Getting Started" notes, but, while helpful, I would need more than 
> those.

Q 2.7 in the R faq (yes, there are many)!

Kjetil

>
> Thanks,
>     Toby
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
>
>


-- 

Kjetil Halvorsen.

Peace is the most effective weapon of mass construction.
               --  Mahdi Elmandjra