BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi :

How to get the marginal effects of each independent variable(x1,x2,x3) in general linear model with Y(dependent variable) continuous and link function is log and built-in distribution is gamma.


Thank you!
1 REPLY 1
deleted_user
Not applicable
I guess the marginal effect of factor x_i is just (beta_i*yhat), where beta_i is the estimated coefficient for x_i, and yhat is the predicted value of y. It seems that the built-in distribution of y doesn't make a difference. Only the link function counts. Maybe it's always the partial derivative of the inverse link function with respect to x_i for all generalized linear models.

I figured this out by playing it in STATA.
For dataset,
/*
x1 x2 y
1 2 33.11
2 1 2.5
3 0 0.4
4 1 0.1
5 2 0.2
*/
Try commands
/*
glm y x1 x2, family(gamma) link(log)
mfx
*/
or
/*
glm y x1 x2, family(poisson) link(log)
mfx
*/
The marginal effects just follow the same rule.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 875 views
  • 0 likes
  • 1 in conversation