[R] Calculation of lags

Gabor Grothendieck ggrothendieck at gmail.com
Mon Jul 3 13:52:23 CEST 2006


Represent your series as a ts object and see ?lag
Also lag.plot may or may not be of use to  you.


On 7/2/06, Ronaldo Reis-Jr. <chrysopa at gmail.com> wrote:
> Hi,
>
> If I have the follow situation:
>
> A dependent variable (i.e. number of insects) that is affected by an
> independent variable (i.e. rain). The problem is that the measure of rain
> affect the population in other moment. So there exit a lag between the rain
> and the number of insects. Exist in R any tool to find what is this lag?
>
> Explain better.
>
> Suppose that I have a linear relationship between rain and insects. More rain
> make more insects. If I try to model the rain and insects in the same moment
> I cant see this relationship because the rain today affect the number of
> insects in the future. Thus, I need to model the present rain with the number
> of insect in the future. But when is this future? 1 day after, 2 days after,
> etc.
>
> How the best way to calculate this lag?
>
> Thanks
> Ronaldo
> --
>        Todos chegamos um dia como a agua e nos vamos como o vento
>                -- Graham Greene
> --
> > Prof. Ronaldo Reis Júnior
> |  .''`. UNIMONTES/Depto. Biologia Geral/Lab. Ecologia Evolutiva
> | : :'  : Campus Universitário Prof. Darcy Ribeiro, Vila Mauricéia
> | `. `'` CP: 126, CEP: 39401-089, Montes Claros - MG - Brasil
> |   `- Fone: (38) 3229-8190 | chrysopa at gmail.com
> | ICQ#: 5692561 | LinuxUser#: 205366
>
> ______________________________________________
> 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
>



More information about the R-help mailing list