Page 1 of 1
Creating lag and differen variables
Posted: Mon Oct 13, 2025 7:17 am
by srk80
Hi,
Is there any function to create lag and first, second, ... difference variables in Jamovi?
Thanks.
Re: Creating lag and differen variables
Posted: Tue Oct 14, 2025 12:08 am
by jonathon
does the OFFSET() function do what you need?

- Screenshot 2025-10-14 at 11.07.35.png (388.79 KiB) Viewed 19152 times
Re: Creating lag and differen variables
Posted: Tue Oct 14, 2025 4:18 am
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)
Re: Creating lag and differen variables
Posted: Tue Oct 14, 2025 4:21 am
by jonathon
great. so you're sorted then?
jonathon
Re: Creating lag and differen variables
Posted: Tue Oct 14, 2025 4:59 pm
by srk80
Yes. I got the desired results. But please include these functions lag, lead, diff too in future versions. Followup question, is there any possibility that any one create a time series module based on fpp2 or fpp3?
Re: Creating lag and differen variables
Posted: Tue Oct 14, 2025 11:25 pm
by jonathon
it would certainly be possible if someone had the time and motivation.
a wrinkle is that jamovi doesn't currently support datetime data types.
jonathon