Creating lag and differen variables

General help and assistance with jamovi. Bug reports can be made at our issues page: https://github.com/jamovi/jamovi/issues . (If you're unsure feel free to discuss it here)
Post Reply
srk80
Posts: 9
Joined: Sat Mar 18, 2023 7:37 am

Creating lag and differen variables

Post by srk80 »

Hi,

Is there any function to create lag and first, second, ... difference variables in Jamovi?

Thanks.
User avatar
jonathon
Posts: 2891
Joined: Fri Jan 27, 2017 10:04 am

Re: Creating lag and differen variables

Post by jonathon »

does the OFFSET() function do what you need?


Screenshot 2025-10-14 at 11.07.35.png
Screenshot 2025-10-14 at 11.07.35.png (388.79 KiB) Viewed 85 times
srk80
Posts: 9
Joined: Sat Mar 18, 2023 7:37 am

Re: Creating lag and differen variables

Post by srk80 »

Yes. This is what I need. But Lag, Lead, diff are more used verbs in econometrics.

Lag -> OFFSET(A, 1)
Lead -> OFFSET(A, -1)
diff_1 -> A - OFFSET(A, 1)
diff_2 -> A - OFFSET(A, 2)
User avatar
jonathon
Posts: 2891
Joined: Fri Jan 27, 2017 10:04 am

Re: Creating lag and differen variables

Post by jonathon »

great. so you're sorted then?

jonathon
Post Reply