Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for mgcv::gam? #177

Open
1 task
rokapre opened this issue Sep 28, 2021 · 0 comments
Open
1 task

Support for mgcv::gam? #177

rokapre opened this issue Sep 28, 2021 · 0 comments

Comments

@rokapre
Copy link

rokapre commented Sep 28, 2021

Please specify whether your issue is about:

  • a possible bug
  • [xx ] a question about package functionality
  • [xx ] a suggested code or documentation change, improvement to the code, or feature request

Hi,

I was wondering is it possible at all to use margins with models from mgcv::gam() ? This is a common situation where I fit a penalized spline model and I would like to get the AME.

Below, I get the error "Error in J %*% vcov : non-conformable arguments"

Best,

Rohan

library(mgcv)
library(margins) 

x=rnorm(1000,0,0.1)
y = log(x+1) + rnorm(1000,0,0.2)
df = data.frame(x=x,y=y)
mod = gam(y~s(x),data=df)
margins(mod)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant