Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

marginal effects

756 views
Skip to first unread message

Sabine Altiparmak

unread,
Feb 20, 2007, 3:07:05 PM2/20/07
to
I am running a binary logistic regression with interaction terms.

For ease of interpretation I have to compute the marginal effects. All my
independent variables are o/1 dummies. Therefore I should use the
differental method as described in Green.

Is there anybody who knows whether and how I can conduct this in SPSS (14)

dankeschön

Sabine


Bruce Weaver

unread,
Feb 22, 2007, 12:12:44 AM2/22/07
to

Perhaps if you explain what the differential method is, someone could help.

--
Bruce Weaver
bwe...@lakeheadu.ca
www.angelfire.com/wv/bwhomedir

sabin...@gmx.de

unread,
Mar 1, 2007, 9:30:28 AM3/1/07
to
On 22 Feb., 06:12, Bruce Weaver <bwea...@lakeheadu.ca> wrote:
> Sabine Altiparmak wrote:
> > I am running a binary logistic regression with interaction terms.
>
> > For ease of interpretation I have to compute themarginaleffects. All my

> > independent variables are o/1 dummies. Therefore I should use the
> > differental method as described in Green.
>
> > Is there anybody who knows whether and how I can conduct this inSPSS(14)
>
> > dankeschön
>
> > Sabine
>
> Perhaps if you explain what the differential method is, someone could help.
>
> --
> Bruce Weaver
> bwea...@lakeheadu.cawww.angelfire.com/wv/bwhomedir

I try..

marginal effects show the impact of changes in a single covariate xk
on the expected probability that yi yields a certain value. Here, it
is assumed that all other covariates remain constant, and usually
their mean is taken.

In general the probability model is Pr(y=m|xi, yi) = exp(xi,ßm) /
[Sum(j=1toJ)over exp(xi,ßi)]

If the independent variable is continuous the marginal effect is
therefore

del Pr(y=m|x) / del xk = Pr(y=m|x) [ ßkm - [Sum(j=1toJ)over ßkj Pr(y=j|
x)]

If the independent varibale is dichotom the marginal effect is
computed as discrete change of the expected proabability if xk changes
from 0 to1:

del Pr(y=m|x) / del xk = Pr(y=m|x,xk=1) - Pr(y=m|x,xk=0)

Because of the way this derivative is computed it is called
differential method.

Bruce Weaver

unread,
Mar 1, 2007, 10:49:41 AM3/1/07
to

I'm still not sure I know exactly what you're asking for in regards to
SPSS. But I'll have a stab.

Here are four logistic regression commands. They differ in terms of the
levels chosen to as the reference categories for the two indicator
variables. (Note that in "Indicator(x)", the x refers to the ordinal
level number, not to the value itself. I.e., for a 0/1 coded variable,
x=1 means that 0 is the reference category, and x=2 means 1 is the
reference category.)

* Version 1 .
LOGISTIC REGRESSION VARIABLES Y
/METHOD = ENTER X1 X2 X1*X2
/CONTRAST (X1)=Indicator(1)
/CONTRAST (X2)=Indicator(1)
/PRINT = CI(95)
.

* Version 2 .
LOGISTIC REGRESSION VARIABLES Y
/METHOD = ENTER X1 X2 X1*X2
/CONTRAST (X1)=Indicator(1)
/CONTRAST (X2)=Indicator(2)
/PRINT = CI(95)
.

* Version 3 .
LOGISTIC REGRESSION VARIABLES Y
/METHOD = ENTER X1 X2 X1*X2
/CONTRAST (X1)=Indicator(2)
/CONTRAST (X2)=Indicator(1)
/PRINT = CI(95)
.

* Version 4 .
LOGISTIC REGRESSION VARIABLES Y
/METHOD = ENTER X1 X2 X1*X2
/CONTRAST (X1)=Indicator(2)
/CONTRAST (X2)=Indicator(2)
/PRINT = CI(95)
.


For version 1:
Exp(B) for X1 gives the OR for X1 = 1 relative to X1 = 0 when X2 = 0;
Exp(B) for X2 gives the OR for X2 = 1 relative to X2 = 0 when X1 = 0;

For version 2:
Exp(B) for X1 gives the OR for X1 = 1 relative to X1 = 0 when X2 = 1;
Exp(B) for X2 gives the OR for X2 = 0 relative to X2 = 1 when X1 = 0;

For version 3:
Exp(B) for X1 gives the OR for X1 = 0 relative to X1 = 1 when X2 = 0;
Exp(B) for X2 gives the OR for X2 = 1 relative to X2 = 0 when X1 = 1;

For version 4:
Exp(B) for X1 gives the OR for X1 = 0 relative to X1 = 1 when X2 = 1;
Exp(B) for X2 gives the OR for X2 = 0 relative to X2 = 1 when X1 = 1;

Does this help?

Of course, you could stick the logistic regression command in a macro
and loop through the 4 combinations of reference categories. And you
could use OMS to send the coefficients to a data file for further
processing.

sabin...@gmx.de

unread,
Mar 1, 2007, 1:24:45 PM3/1/07
to
On 1 Mrz., 16:49, Bruce Weaver <bwea...@lakeheadu.ca> wrote:

> sabineca...@gmx.de wrote:
> > On 22 Feb., 06:12, Bruce Weaver <bwea...@lakeheadu.ca> wrote:
> >> Sabine Altiparmak wrote:
> >>> I am running a binary logistic regression with interaction terms.
> >>> For ease of interpretation I have to compute themarginaleffects. All my
> >>> independent variables are o/1 dummies. Therefore I should use the
> >>> differental method as described in Green.
> >>> Is there anybody who knows whether and how I can conduct this inSPSS(14)
> >>> dankeschön
> >>> Sabine
> >> Perhaps if you explain what the differential method is, someone could help.
>
> >> --
> >> Bruce Weaver
> >> bwea...@lakeheadu.cawww.angelfire.com/wv/bwhomedir
>
> > I try..
>
> >marginaleffects show the impact of changes in a single covariate xk

> > on the expected probability that yi yields a certain value. Here, it
> > is assumed that all other covariates remain constant, and usually
> > their mean is taken.
>
> > In general the probability model is Pr(y=m|xi, yi) = exp(xi,ßm) /
> > [Sum(j=1toJ)over exp(xi,ßi)]
>
> > If the independent variable is continuous themarginaleffect is

> > therefore
>
> > del Pr(y=m|x) / del xk = Pr(y=m|x) [ ßkm - [Sum(j=1toJ)over ßkj Pr(y=j|
> > x)]
>
> > If the independent varibale is dichotom themarginaleffect is

> > computed as discrete change of the expected proabability if xk changes
> > from 0 to1:
>
> > del Pr(y=m|x) / del xk = Pr(y=m|x,xk=1) - Pr(y=m|x,xk=0)
>
> > Because of the way this derivative is computed it is called
> > differential method.
>
> I'm still not sure I know exactly what you're asking for in regards toSPSS. But I'll have a stab.
> bwea...@lakeheadu.cawww.angelfire.com/wv/bwhomedir- Zitierten Text ausblenden -
>
> - Zitierten Text anzeigen -

Hallo Bruce,

manymany thanks. But: I have not enough SPSS knowledge to fully
understand or conduct your solution. I perfectly understand the part
with the indicator variables.
I don't know what OR and and OMS stand for. In the parts "For
version.." I am not sure if Exp(B) is from the probability model. But
it shouldn't be, as far as I understand(?)

What I am looking for is: If an binary logit regression is conducted
in SPSS, the coefficients refer to the odds (or log odds). As far as I
know it is possible in other statistic packages to ask for the
probability derivatives instead of the coefficient. They can be
interpretated as probability change of the dependent variable incident
with reference to the omitted variable.

My hope was that fine tuning the syntaxt would be possible. Like in
changing the contrast variable to the "third" instead of first oder
last.

Thanks again.

Sabine


Bruce Weaver

unread,
Mar 1, 2007, 2:14:47 PM3/1/07
to
sabin...@gmx.de wrote:
>
> Hallo Bruce,
>
> manymany thanks. But: I have not enough SPSS knowledge to fully
> understand or conduct your solution. I perfectly understand the part
> with the indicator variables.
> I don't know what OR and and OMS stand for. In the parts "For
> version.." I am not sure if Exp(B) is from the probability model. But
> it shouldn't be, as far as I understand(?)

OR = odds ratio

So...
For version 1:
B for X1 gives the log-OR for X1 = 1 relative to X1 = 0 when X2 = 0;


Exp(B) for X1 gives the OR for X1 = 1 relative to X1 = 0 when X2 = 0;

B for X2 gives the log-OR for X2 = 1 relative to X2 = 0 when X1 = 0;


Exp(B) for X2 gives the OR for X2 = 1 relative to X2 = 0 when X1 = 0;

And so on for versions 2-4.

OMS = Output Management System. It allows you to direct any output that
would ordinarily appear as a table in the output window to a data file.

>
> What I am looking for is: If an binary logit regression is conducted
> in SPSS, the coefficients refer to the odds (or log odds). As far as I
> know it is possible in other statistic packages to ask for the
> probability derivatives instead of the coefficient. They can be
> interpretated as probability change of the dependent variable incident
> with reference to the omitted variable.


You can have SPSS save the predicted probabilities via the /SAVE
subcommand. Maybe this example is closer to what you're after.

* ------------------------------------------------------- .

* Create a data set with one row for each of the
* 4 combinations of X1 and X2.

* DATA LIST is a convenient way to create small data
* sets such as this.

DATA LIST list / X1 X2 (2f1.0) .
begin data.
0 0
0 1
1 0
1 1
end data.

* Later, it will be convenient to have a variable
* that flags these rows (e.g., when we want to make
* a chart displaying predicted odds for the 4 cells).

compute flag = 1.
exe.

* Now use ADD FILES to add the records from the original
* data file.

ADD FILES
file = * /
file = "C:\MyData\original data.sav" .
recode flag (sysmis=0) (else=copy).
.
exe.

* Now run the logistic regression model again, but
* save the predicted probabilities this time.

* Note that we are using the 2nd method, which treats
* the 0/1 binary variables as continuous predictors.

LOGISTIC REGRESSION VARIABLES Y
/METHOD = ENTER X1 X2 X1*X2

/PRINT = CI(95)
/SAVE = PRED (predpr)
.

* Now compute predicted odds from the predicted probabilities .
* Then compute predicted log-odds, since that is what is
* actually being modeled in the logistic regression.

compute podds = predpr / (1 - predpr).
compute plogodds = ln(podds).
exe.

var lab
predpr 'Predicted probablity of Y'
podds 'Predicted odds of Y'
plogodds 'Predicted log-odds of Y'
.
format predpr podds plogodds (f8.3).
descrip predpr podds plogodds.

* Now we can plot the fitted values of the log-odds
* of Y, the odds of Y, or the probability
* of Y in the 4 cells of our 2x2 design.

* Remember to use only the first 4 rows of the file
* for these charts.

select if flag.
exe.

GRAPH
/BAR(GROUPED)=MEAN(plogodds) BY X2 BY X1
/TITLE= 'Predicted Log-Odds of Y'.

GRAPH
/BAR(GROUPED)=MEAN(podds) BY X2 BY X1
/TITLE= 'Predicted Odds of Y'.

GRAPH
/BAR(GROUPED)=MEAN(predpr) BY X2 BY X1
/TITLE= 'Predicted Probability of Y'.

* ------------------------------------------------------- .

HTH

sabin...@gmx.de

unread,
Mar 24, 2007, 9:24:39 AM3/24/07
to
On 1 Mrz., 20:14, Bruce Weaver <bwea...@lakeheadu.ca> wrote:
> sabineca...@gmx.de wrote:
>
> > Hallo Bruce,
>
> > manymany thanks. But: I have not enoughSPSSknowledge to fully

> > understand or conduct your solution. I perfectly understand the part
> > with the indicator variables.
> > I don't know what OR and and OMS stand for. In the parts "For
> > version.." I am not sure if Exp(B) is from the probability model. But
> > it shouldn't be, as far as I understand(?)
>
> OR = odds ratio
>
> So...
> For version 1:
> B for X1 gives the log-OR for X1 = 1 relative to X1 = 0 when X2 = 0;
> Exp(B) for X1 gives the OR for X1 = 1 relative to X1 = 0 when X2 = 0;
> B for X2 gives the log-OR for X2 = 1 relative to X2 = 0 when X1 = 0;
> Exp(B) for X2 gives the OR for X2 = 1 relative to X2 = 0 when X1 = 0;
>
> And so on for versions 2-4.
>
> OMS = Output Management System. It allows you to direct any output that
> would ordinarily appear as a table in the output window to a data file.
>
>
>
> > What I am looking for is: If an binary logit regression is conducted
> > inSPSS, the coefficients refer to the odds (or log odds). As far as I

> > know it is possible in other statistic packages to ask for the
> > probability derivatives instead of the coefficient. They can be
> > interpretated as probability change of the dependent variable incident
> > with reference to the omitted variable.
>
> You can haveSPSSsave the predicted probabilities via the /SAVE
> bwea...@lakeheadu.cawww.angelfire.com/wv/bwhomedir

Hallo Bruce,
again: many thanks. I tried to effectuate your solution and it seems
to be exactly what I want. But unless I dont't have your profound
knowledge of spss I will always be insecure how to handle these
results or fit them to other data and or questions. So it has been
easier for me to change to STATA which offers the marginal effects
feature. Best regards, Sabine Altiparmak


0 new messages