Skip to content

illustrate marginal effects of probit/logit models #4

@floswald

Description

@floswald

background

this app relates to this chapter in our book https://scpoecon.github.io/ScPoEconometrics/binary.html

this should illustrate why there is no single marginal effect in a probit model. that is while in the linear model

dy / dx_i = \beta_i

in the nonlinear probit/logit case we have

d Pr(y_i = 1 | x) / dx_i = g(x\beta) \beta_i 

where g is the pdf of the chosen cdf G (standard normal for probit, logistic for logit)

that is: the marginal effect depends not only on \beta_i but at which x you choose to evaluate that expression. In this app we assume for simplicity that \beta = 1.

Output of app

something like this plot:

library(ggplot2)
ggplot(data.frame(x = c(-5,5)), aes(x=x)) + 
  stat_function(fun = pnorm, aes(colour = "Probit")) + 
  stat_function(fun = plogis, aes(colour = "Logit")) + 
  theme_bw() + 
  scale_colour_manual(name = "Function G",values = c("red", "blue")) +
  scale_y_continuous(name = "Pr(y = 1 | x)")

Screenshot 2020-09-08 at 09 12 31

(but for one case at a time)

where you add a straight tangent line illustrating the slope at a certain value of x.

app input

  • dropdown menu : logit vs probit
  • slider: x \in [-3,3]. this value is evaluated in g(x). you draw a straight line through point (x,G(x)) (put a marker there), with slope g(x).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions