Closed floswald closed 4 years ago
not sure ggplot is the best way to achieve this btw. maybe with base R you are better off eg.
curve( expr = pnorm, from,to)
# compute start and end points, given x and above formula (x0,x1 etc)
segment(x0 = x0,x1=x1,y0=y0,y1=y1)
looks perfect to me. let's talk about submitting this via PR next time we talk. thanks!
No problem! I am learning more git skills and keep working on the rest APPs!
@dxy99999 you know what would be really cool here to add: in the box on the left where you have the slider, just at the bottom, a text output that gives the current value of the derivative. in your code, you would just display the value of tangent
. can you add that please?
Sure, no problem!
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
in the nonlinear probit/logit case we have
where
g
is the pdf of the chosen cdfG
(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:
(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