You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just realized that glm() and glmmTMB both always include the offset in the prediction and always return the prediction on the original data no matter what newdata is if the offset argument is used instead of the offset() formula. This seems kind of crazy to me, but I guess that's the standard.
We need the ability to set the offset to 0 for index standardization, among other uses. It's obvious what to do when newdata and offset are specified in predict.sdmTMB(). But what about:
newdata = NULL, offset = NULL: predict on original data with offset = 0 newdata = df, offset = NULL: predict on df with offset = 0 newdata = NULL, offset = some_offset: predict on original data with offset = some_offset; this was wrong and was being returned as original data and original offset
I assume I should do the above. For one, people have code that depends on it. I never realized the difference in the formula vs. argument offset specification.
Just writing this out to document the thought process.
The text was updated successfully, but these errors were encountered:
Ah, this is timely as I was just trying to help a colleague that was having trouble estimating marginal effects with ggeffects. The error was indicating different offset lengths.
Including the offset in the formula always seems quite inelegant.
Speaking of offsets more generally, what is the best example of how different the results are with an effort offset vs modeling say cpue with 0 offset? I imagine it depends on the disparity in effort values? Or is the stats theory justification strong enough to indicate that this could substantially change important outputs or inference?
I just realized that
glm()
and glmmTMB both always include the offset in the prediction and always return the prediction on the original data no matter whatnewdata
is if theoffset
argument is used instead of theoffset()
formula. This seems kind of crazy to me, but I guess that's the standard.Created on 2023-11-03 with reprex v2.0.2
That changes if you put the offset in the formula, which sdmTMB does not currently support:
Created on 2023-11-03 with reprex v2.0.2
We need the ability to set the offset to 0 for index standardization, among other uses. It's obvious what to do when
newdata
andoffset
are specified inpredict.sdmTMB()
. But what about:newdata = NULL, offset = NULL
: predict on original data withoffset = 0
newdata = df, offset = NULL
: predict ondf
withoffset = 0
newdata = NULL, offset = some_offset
: predict on original data withoffset = some_offset
; this was wrong and was being returned as original data and original offsetI assume I should do the above. For one, people have code that depends on it. I never realized the difference in the formula vs. argument offset specification.
Just writing this out to document the thought process.
The text was updated successfully, but these errors were encountered: