year (time variable) as an integer or factor in spatiotemporal model #284
Unanswered
ChunChen001
asked this question in
Q&A
Replies: 1 comment
-
I'm having a bit of trouble following all this. Can you provide some short reproducible code as an example? Maybe using the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
I am running a spatiotmporal model with year as a both time varying variable (time=year) as well as a fixed covariate (to estimate a yearly overall effect). I have set 2 cases of format on year: 1) fixed covaraite year is a factor (yearc=factor(year)), and time variable year is also a factor (yearc); 2) year fixed covarite is a factor (yearc) but the time variable is an integer (year). Both model work and gave the same likelihood. But model 1) does not allow me to make prediction on a new data with only one year data (e.g. year 2022 only) even after i have set it as a factor with the same levels as the input data. With model 2 i could prediction on only one year. I am just wondering if the settings of model 2) is fine, even that I have made year into 2 different variables in the model.
Beta Was this translation helpful? Give feedback.
All reactions