Hi R-helpers

 

I want a function that performs the opposite of lag() with panel data.

I have transformed my data before with pdata.frame(mydata,
index=c("groupindex", “timeindex"))

And then I’ve done lag(mydata, -1) but it doesn’t work. 

 

The error message was:

Error in rep(1, ak) : invalid 'times' argument

 

Thank you in advance,

 

Cecília Carmo


	[[alternative HTML version deleted]]

