Replies: 1 comment 1 reply
-
Hi Gavin,
Thanks so much for your reply. I really enjoyed the GAM video you made on YouTube, it has been very useful for me.
I managed to get the plots I needed before you sent your reply. I needed to back-transform the data and had my ‘exp()’ at the wrong place in the R code.
I tried the codes you suggested and plot it out but it looked really strange. Could you explain or direct me to a resource that explains the codes? I had used a binary model.
Many thanks,
Tiff
… On 10 Aug 2023, at 8:47 AM, Gavin Simpson ***@***.***> wrote:
If I follow what you want to do, you should be able to do:
mld7p.est <- gratia::smooth_estimates(mld7p) |>
add_confint() |> # add confint
add_constant(constant = coef(mld7p)[1]) |> # add constant to est, and confint
transform_fun(fun = inv_link(mld7p)) # transform using inverse of link function
to at least get the data how you want.
—
Reply to this email directly, view it on GitHub <#229 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/BB2HHA35TLKTMLUFHSZLEG3XUSGYHANCNFSM6AAAAAA3KGMXZM>.
You are receiving this because you modified the open/close state.
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there,
I am trying to plot GAM smooth estimates. I had log-transformed my predictor variable and also scaled it before running the model (there were a couple other variables in the model).
I've used gratia::smooth_estimates to extract the model estimates and CIs. I think I managed to unscale the variable but I'm not quite sure if I managed to inverse log it. The plot (attached) definitely does not look right... These are the codes,
HPSightingsMLD consist of the raw data (not log-transformed nor scaled).
Hopefully someone can point out to me what I'm missing! Many thanks in advance :)
mld.pdf
Beta Was this translation helpful? Give feedback.
All reactions