I would like to be able to manually reproduce the results that Stata provides from the margins command from a nonlinear regression (e.g. logit).
For example, let's say that I have 1000000 observations of a binary dependent variable Y1 and a continuous variable X1, and I am running a logit regression of Y1 on X1. How might I manually calculate the marginal effects for each observation, and then manually calculate the average marginal effect for the entire logit regression, such that I get the exact same result as what Stata produces when I type 'margins, dydx(x1)' ?
My attempts to calculate the marginal effect of each observation by using the pdf of logit seem to fail, as when I then take the average of those marginal results, I get a number that is not equal to what I get when I type 'margins, dydx(x1)'
Related Posts with How exactly does Stata calculate derivatives via the margins command for nonlinear functions?
Panels are not nested within clustersDear Statalister, I basically encounter a problem similar to this: https://www.statalist.org/forums…
Help on -mswitch- command to estimate Markov Switching Regression ModelsHello, I use Stata 14. I have a panel dataset. I want to estimate for each id/country in the panel d…
Choosing the right modeling technique available in STATADear Stata Experts: I am working on an assignment to predict state policy on a particular issue. Th…
how do the melogit and logit handle missing data? why do the results show different # of observations, despite same vars?I am trying to understand why two models with the same variables report different number of observat…
Error calculating marginal effects with a tobit modelI am looking at the effect of permitting standards, rebates, average income, and electricity price o…
Subscribe to:
Post Comments (Atom)
0 Response to How exactly does Stata calculate derivatives via the margins command for nonlinear functions?
Post a Comment