<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to compute marginal effects in general linear model? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-compute-marginal-effects-in-general-linear-model/m-p/67887#M19436</link>
    <description>I guess the marginal effect of factor x_i is just (&lt;I&gt;beta_i*yhat&lt;/I&gt;), where &lt;I&gt;beta_i&lt;/I&gt; is the estimated coefficient for x_i, and &lt;I&gt;yhat&lt;/I&gt; 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.&lt;BR /&gt;
&lt;BR /&gt;
I figured this out by playing it in STATA.&lt;BR /&gt;
For dataset,&lt;BR /&gt;
/*&lt;BR /&gt;
x1 x2 y&lt;BR /&gt;
1  2  33.11&lt;BR /&gt;
2  1  2.5&lt;BR /&gt;
3  0  0.4&lt;BR /&gt;
4  1  0.1&lt;BR /&gt;
5  2  0.2 &lt;BR /&gt;
*/&lt;BR /&gt;
Try commands&lt;BR /&gt;
/*&lt;BR /&gt;
glm y x1 x2, family(gamma) link(log)&lt;BR /&gt;
mfx&lt;BR /&gt;
*/&lt;BR /&gt;
or&lt;BR /&gt;
/*&lt;BR /&gt;
glm y x1 x2, family(poisson) link(log)&lt;BR /&gt;
mfx&lt;BR /&gt;
*/&lt;BR /&gt;
The marginal effects just follow the same rule.</description>
    <pubDate>Tue, 06 Jan 2009 21:38:21 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-01-06T21:38:21Z</dc:date>
    <item>
      <title>How to compute marginal effects in general linear model?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-compute-marginal-effects-in-general-linear-model/m-p/67886#M19435</link>
      <description>Hi :&lt;BR /&gt;
&lt;BR /&gt;
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.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Thank you!</description>
      <pubDate>Mon, 05 Jan 2009 17:48:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-compute-marginal-effects-in-general-linear-model/m-p/67886#M19435</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-01-05T17:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to compute marginal effects in general linear model?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-compute-marginal-effects-in-general-linear-model/m-p/67887#M19436</link>
      <description>I guess the marginal effect of factor x_i is just (&lt;I&gt;beta_i*yhat&lt;/I&gt;), where &lt;I&gt;beta_i&lt;/I&gt; is the estimated coefficient for x_i, and &lt;I&gt;yhat&lt;/I&gt; 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.&lt;BR /&gt;
&lt;BR /&gt;
I figured this out by playing it in STATA.&lt;BR /&gt;
For dataset,&lt;BR /&gt;
/*&lt;BR /&gt;
x1 x2 y&lt;BR /&gt;
1  2  33.11&lt;BR /&gt;
2  1  2.5&lt;BR /&gt;
3  0  0.4&lt;BR /&gt;
4  1  0.1&lt;BR /&gt;
5  2  0.2 &lt;BR /&gt;
*/&lt;BR /&gt;
Try commands&lt;BR /&gt;
/*&lt;BR /&gt;
glm y x1 x2, family(gamma) link(log)&lt;BR /&gt;
mfx&lt;BR /&gt;
*/&lt;BR /&gt;
or&lt;BR /&gt;
/*&lt;BR /&gt;
glm y x1 x2, family(poisson) link(log)&lt;BR /&gt;
mfx&lt;BR /&gt;
*/&lt;BR /&gt;
The marginal effects just follow the same rule.</description>
      <pubDate>Tue, 06 Jan 2009 21:38:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-compute-marginal-effects-in-general-linear-model/m-p/67887#M19436</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-01-06T21:38:21Z</dc:date>
    </item>
  </channel>
</rss>

