Skip to main content
added 9 characters in body
Source Link
dimitriy
  • 38.3k
  • 7
  • 83
  • 167

TheyThe authors are evaluating the marginal effects at the two levels of probability. It's just the derivative of the conditional probability for the logit or probit model times the corresponding coefficient. I knew this because the multiplicative factors on the index function coefficients (.25, .4, .16, .28) correspond to those derivatives. You can do this with lincom or margins of an expression in Stata.

In response your comment, here is some code showing this calculation using lincom and margins on the cars dataset. I think you are mistaken about what these commands can accomplish. You can find the derivation of the marginal effect for logit here and probit here. There is some code at the end showing how to calculate the average marginal effects, which should have correct larger SEs, will also handle categorical variables correctly, and are arguably more representative of your data that the approach in yourthis paper. Moreover, thetheir approach in the paper treats the categorical variables as if they were continuous, which can be odd.

They are evaluating the marginal effects at the two levels of probability. It's just the derivative of the conditional probability for the logit or probit model times the corresponding coefficient. I knew this because the multiplicative factors on the index function coefficients (.25, .4, .16, .28) correspond to those derivatives. You can do this with lincom or margins of an expression in Stata.

In response your comment, here is some code showing this calculation using lincom and margins on the cars dataset. I think you are mistaken about what these commands can accomplish. You can find the derivation of the marginal effect for logit here and probit here. There is some code at the end showing how to calculate the average marginal effects, which should have correct larger SEs, will also handle categorical variables correctly, and are arguably more representative of your data that the approach in your paper. Moreover, the approach in the paper treats the categorical variables as if they were continuous, which can be odd.

The authors are evaluating the marginal effects at the two levels of probability. It's just the derivative of the conditional probability for the logit or probit model times the corresponding coefficient. I knew this because the multiplicative factors on the index function coefficients (.25, .4, .16, .28) correspond to those derivatives. You can do this with lincom or margins of an expression in Stata.

In response your comment, here is some code showing this calculation using lincom and margins on the cars dataset. I think you are mistaken about what these commands can accomplish. You can find the derivation of the marginal effect for logit here and probit here. There is some code at the end showing how to calculate the average marginal effects, which should have correct larger SEs, will also handle categorical variables correctly, and are arguably more representative of your data that the approach in this paper. Moreover, their approach in the paper treats the categorical variables as if they were continuous, which can be odd.

added 161 characters in body
Source Link
dimitriy
  • 38.3k
  • 7
  • 83
  • 167

In response your comment, here is some code showing the basicthis calculation using lincom and margins on the cars dataset. I think you are mistaken about what these commands can accomplish. You can find the derivation of the marginal effect for logit here and probit here. There is some code at the end showing how to calculate the average marginal effects, which should have correct larger SEs, will also handle categorical variables correctly, and are arguably more representative of your data that the approach in your paper. Moreover, the approach in the paper treats the categorical variables as if they were continuous, which can be odd.

#delimit;
sysuse auto, clear;

/* OLS */
regress foreign c.mpg, robust;
margins, dydx(mpg);

/* Logit MEs at p = 0.5 and p = 0.8 */
logit foreign c.mpg, nolog;
/* NB: these SEs are too small */
lincom .5*(1-.5)*_b[mpg];
lincom .8*(1-.8)*_b[mpg];
margins, expression(.8*(1-.8)*_b[mpg]);

/* Probit MEs at p = 0.5 and p = 0.8 */
probit foreign c.mpg, nolog;
/* NB: these SEs are too small */
lincom `=normalden(invnormal(.5))'*_b[mpg];
lincom `=normalden(invnormal(.8))'*_b[mpg];
margins, expression(normalden(invnormal(.8))*_b[mpg]);

/* Plot for all possible values of p (not just 0.5 and 0.8) */
tw
    (function y = .0312915)
    (function y = x*(1-x)*.1597621, range(0 1))
    (function y = normalden(invnormal(x))*.0960601, range(0 1))
, ylab(#10, angle(horizontal) grid)
ytitle("Change in Probability")
xlab(#10, grid)
xtitle("Predicted Probability of Foreign Origin")
xline(.5 .8, lpatter(dash))
title("Marginal Effect of an One Additional MPG at Different Pr(Foreign)", span size(medium))
legend(label(1 "OLS ME" ) label(2 "Logit ME") label(3 "Probit ME") rows(1));


/* Average Marginal Effects with continuous and categorical covariates */
gen high_mpg = mpg>21;
logit foreign c.weight i.high_mpg, nolog;
margins, dydx(*);

The general plot looks like this, which shows that the effect depends on the baseline probability for logit and probit, but not for OLS, where the ME is constant. That is, the effect is biggest for observations near 1/2that are likely to go either way and smallest for the very likely and very unlikely observations in the non-OLS models:

In response your comment, here is some code showing the basic calculation using lincom on the cars dataset. I think you are mistaken about what these commands can accomplish. You can find the derivation of the marginal effect for logit here and probit here. There is some code at the end showing how to calculate the average marginal effects, which should have correct larger SEs, will also handle categorical variables correctly, and are arguably more representative of your data that the approach in your paper.

#delimit;
sysuse auto, clear;

/* OLS */
regress foreign c.mpg, robust;
margins, dydx(mpg);

/* Logit MEs at p = 0.5 and p = 0.8 */
logit foreign c.mpg, nolog;
/* NB: these SEs are too small */
lincom .5*(1-.5)*_b[mpg];
lincom .8*(1-.8)*_b[mpg];

/* Probit MEs at p = 0.5 and p = 0.8 */
probit foreign c.mpg, nolog;
/* NB: these SEs are too small */
lincom `=normalden(invnormal(.5))'*_b[mpg];
lincom `=normalden(invnormal(.8))'*_b[mpg];

/* Plot for all possible values of p (not just 0.5 and 0.8) */
tw
    (function y = .0312915)
    (function y = x*(1-x)*.1597621, range(0 1))
    (function y = normalden(invnormal(x))*.0960601, range(0 1))
, ylab(#10, angle(horizontal) grid)
ytitle("Change in Probability")
xlab(#10, grid)
xtitle("Predicted Probability of Foreign Origin")
xline(.5 .8, lpatter(dash))
title("Marginal Effect of an One Additional MPG at Different Pr(Foreign)", span size(medium))
legend(label(1 "OLS ME" ) label(2 "Logit ME") label(3 "Probit ME") rows(1));


/* Average Marginal Effects with continuous and categorical covariates */
gen high_mpg = mpg>21;
logit foreign c.weight i.high_mpg, nolog;
margins, dydx(*);

The general plot looks like this, which shows that the effect depends on the baseline probability for logit and probit, but not for OLS, where the ME is constant. That is, the effect is biggest for observations near 1/2 and smallest for the very likely and very unlikely observations in the non-OLS models:

In response your comment, here is some code showing this calculation using lincom and margins on the cars dataset. I think you are mistaken about what these commands can accomplish. You can find the derivation of the marginal effect for logit here and probit here. There is some code at the end showing how to calculate the average marginal effects, which should have correct larger SEs, will also handle categorical variables correctly, and are arguably more representative of your data that the approach in your paper. Moreover, the approach in the paper treats the categorical variables as if they were continuous, which can be odd.

#delimit;
sysuse auto, clear;

/* OLS */
regress foreign c.mpg, robust;
margins, dydx(mpg);

/* Logit MEs at p = 0.5 and p = 0.8 */
logit foreign c.mpg, nolog;
/* NB: these SEs are too small */
lincom .5*(1-.5)*_b[mpg];
lincom .8*(1-.8)*_b[mpg];
margins, expression(.8*(1-.8)*_b[mpg]);

/* Probit MEs at p = 0.5 and p = 0.8 */
probit foreign c.mpg, nolog;
/* NB: these SEs are too small */
lincom `=normalden(invnormal(.5))'*_b[mpg];
lincom `=normalden(invnormal(.8))'*_b[mpg];
margins, expression(normalden(invnormal(.8))*_b[mpg]);

/* Plot for all possible values of p (not just 0.5 and 0.8) */
tw
    (function y = .0312915)
    (function y = x*(1-x)*.1597621, range(0 1))
    (function y = normalden(invnormal(x))*.0960601, range(0 1))
, ylab(#10, angle(horizontal) grid)
ytitle("Change in Probability")
xlab(#10, grid)
xtitle("Predicted Probability of Foreign Origin")
xline(.5 .8, lpatter(dash))
title("Marginal Effect of an One Additional MPG at Different Pr(Foreign)", span size(medium))
legend(label(1 "OLS ME" ) label(2 "Logit ME") label(3 "Probit ME") rows(1));


/* Average Marginal Effects with continuous and categorical covariates */
gen high_mpg = mpg>21;
logit foreign c.weight i.high_mpg, nolog;
margins, dydx(*);

The general plot looks like this, which shows that the effect depends on the baseline probability for logit and probit, but not for OLS, where the ME is constant. That is, the effect is biggest for observations that are likely to go either way and smallest for the very likely and very unlikely observations in the non-OLS models:

added 161 characters in body
Source Link
dimitriy
  • 38.3k
  • 7
  • 83
  • 167

They are evaluating the average marginal effects at the two levels of probability. It's just the logit or probit coefficient times the derivative of the conditional probability for thatthe logit or probit model times the corresponding coefficient. I knew this because the multiplicative factors on the index function coefficients (.25, .4, .16, .28) correspond to those derivatives. You can do this with lincomlincom or marginsmargins of an expression in Stata.

In response your comment, here is some code showing the basic calculation using lincom on the cars dataset. I think you are mistaken about what these commands can accomplish. You can find the derivation of the marginal effect for logit here and probit here. There is some code at the end showing how to calculate the average marginal effects, which should have correct larger SEs and also, will also handle categorical variables correctly, and are arguably more representative of your data that the approach in your paper.

They are evaluating the average marginal effects at the two levels of probability. It's just the logit or probit coefficient times the derivative of the conditional probability for that model. You can do this with lincom or margins of an expression in Stata.

In response your comment, here is some code showing the basic calculation using lincom on the cars dataset. I think you are mistaken about what these commands can accomplish. You can find the derivation of the marginal effect for logit here and probit here. There is some code at the end showing how to calculate the average marginal effects, which should have correct SEs and also will handle categorical variables correctly, and are arguably more representative that the approach in your paper.

They are evaluating the marginal effects at the two levels of probability. It's just the derivative of the conditional probability for the logit or probit model times the corresponding coefficient. I knew this because the multiplicative factors on the index function coefficients (.25, .4, .16, .28) correspond to those derivatives. You can do this with lincom or margins of an expression in Stata.

In response your comment, here is some code showing the basic calculation using lincom on the cars dataset. I think you are mistaken about what these commands can accomplish. You can find the derivation of the marginal effect for logit here and probit here. There is some code at the end showing how to calculate the average marginal effects, which should have correct larger SEs, will also handle categorical variables correctly, and are arguably more representative of your data that the approach in your paper.

added 12 characters in body
Source Link
dimitriy
  • 38.3k
  • 7
  • 83
  • 167
Loading
added 26 characters in body
Source Link
dimitriy
  • 38.3k
  • 7
  • 83
  • 167
Loading
added 2220 characters in body
Source Link
dimitriy
  • 38.3k
  • 7
  • 83
  • 167
Loading
added 131 characters in body
Source Link
dimitriy
  • 38.3k
  • 7
  • 83
  • 167
Loading
Source Link
dimitriy
  • 38.3k
  • 7
  • 83
  • 167
Loading