Gavin Simpson
@gsimpson.bsky.social
2.6K followers 680 following 98 posts
(Palaeo)[ecologist | limnologist] & #fakeStatistican, #rstats user, wielder of #GAMs. He/him/his. Opinions mine…
Posts Media Videos Starter Packs
gsimpson.bsky.social
I have very fond memories of feeding the giraffe there; have fun enjoying Nairobi (taking breakfast at the national park at dawn, in one of the picnic / viewpoints on the high ground overlooking the rest of the park was a real treat, as was the elephant orphanage)
gsimpson.bsky.social
I’d be happy to add/use a psych example or two if you have suggestions for papers or analyses where the data are open?
gsimpson.bsky.social
As I’m a geographer by PhD working in ecology, environmental science, and now animal science, the examples tend towards the natural and life sciences, but they are quite varied so attendees from a wide array of backgrounds usually find them relatable.
gsimpson.bsky.social
I’ll be running a 3-day one at AU Viborg (about an hour from Aarhus, Denmark) June 9th through 11th that is in person. Dates are TBC but registration should be open in the next couple of weeks

I’m also running an online one with @physaliacourses.bsky.social in December this year.
Reposted by Gavin Simpson
vincentab.bsky.social
The Pink Book of #MarginalEffects (aka Model to Meaning) ships next week and I've got a backlog of Zoolander memes.

Hope you're hungry for some spam in your timeline.

#RStats #PyData
Reposted by Gavin Simpson
vincentab.bsky.social
The new {marginaleffects} release for #RStats (0.30.0) comes with two new vignettes:

1. Speed up computation with automatic differentiation (often 10x gains) marginaleffects.com/bonus/perfor...

2. Power analyses with {marginaleffects} and {DeclareDesign}. marginaleffects.com/bonus/power....
37  Performance – Model to Meaning
marginaleffects.com
Reposted by Gavin Simpson
teunbrand.bsky.social
We're glad to finally bring you this update!
thomasp85.com
I am beyond excited to announce that ggplot2 4.0.0 has just landed on CRAN.

It's not every day we have a new major #ggplot2 release but it is a fitting 18 year birthday present for the package.

Get an overview of the release in this blog post and be on the lookout for more in-depth posts #rstats
ggplot2 4.0.0
A new major version of ggplot2 has been released on CRAN. Find out what is new here.
www.tidyverse.org
gsimpson.bsky.social
Congratulations Thomas; I know this release hasn’t been an easy one
Reposted by Gavin Simpson
thomasp85.com
I am beyond excited to announce that ggplot2 4.0.0 has just landed on CRAN.

It's not every day we have a new major #ggplot2 release but it is a fitting 18 year birthday present for the package.

Get an overview of the release in this blog post and be on the lookout for more in-depth posts #rstats
ggplot2 4.0.0
A new major version of ggplot2 has been released on CRAN. Find out what is new here.
www.tidyverse.org
gsimpson.bsky.social
It is also usually an example inappropriate calculation-first-estimation-second when we should be doing things the other way round; estimate model then calculate differences/ratios from the model, not the data
Reposted by Gavin Simpson
physaliacourses.bsky.social
If you’d like to go beyond updates and truly master GAMs in R, join our online course with @gsimpson.bsky.social, 8–11 Dec.

📊 Learn how to fit, interpret, visualise, and communicate GAMs in practice, guided by one of the leading experts in the field.
www.physalia-courses.org/courses-work...
gsimpson.bsky.social
🛠️ partial_derivatives() improvements:

• handles multiple smooths better
• ignores random effect & univariate smooths
• clearer error messages
gsimpson.bsky.social
📈 quantile_residuals() supports more mgcv 📦 families:

• scat()
• nb()
• betar()
• tw()
gsimpson.bsky.social
✨ Plots: residuals_hist_plot() (and appraise()) now align histogram bins more sensibly, centering at 0.
gsimpson.bsky.social
🚀 gratia 0.11.1 is out!
Compatibility with ggplot2 4.0.0 + usability improvements + bug fixes.

#Rstats #mgcv #gam #statistics
gsimpson.bsky.social
You could try the gamlss2 package next time; it’s a lot quicker than gamlss (it’s a redevelopment of the original by same authors plus others). Only on GitHub at the moment
gsimpson.bsky.social
X_s being the model matrix for the specific smooth (i.e., the basis functions evaluated at the covariate values) and b_s being the estimates of the basis coefficients for that smooth
gsimpson.bsky.social
No that I'm aware; adding families to mgcv is tricky if you want all the standard automatic smoothness selection methods as those require many fourth-order derivatives. I think you could get close by adding observation-level random effects with `s(id, bs="re")` with standard binomial()
gsimpson.bsky.social
On the latter point, I was re-reading Hastie & Tibshirani's GAM book recently where they restrict plotting the surface to the convex hull of the data, which I could implement as an alternative.
gsimpson.bsky.social
I evaluate (X_s %*% t(b_s)) the smooth at a grid of points evenly spaced in each marginal covariate, then set to NA any coordinate that lies further than `dist` from a data point when everything is mapped to a unit square to avoid extrapolation too far beyond support of data, like mgcv::plot.gam().
gsimpson.bsky.social
I also added code to generate probability integral transform (PIT) & quantile residuals for GAMs. Right now I only handle binomial(), poisson(), gaussian(), & Gamma(), but other families can be added simply by writing a function for the CDF (& possible translating from mgcv's parameterisation)