Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ivreghdfe followed by predictnl #42

Open
nicolaslonguetmarx opened this issue Mar 2, 2022 · 0 comments
Open

Use ivreghdfe followed by predictnl #42

nicolaslonguetmarx opened this issue Mar 2, 2022 · 0 comments

Comments

@nicolaslonguetmarx
Copy link

Hello Sergio,

I am using ivreghdfe 1.1.1 with ivreg2 4.1.11 on Stata 17 (Windows 10).
I want to estimate the predicted probability after having run an IV regression of the log odds ratio on covariates and fixed effects.
Here is what I run:

ivreghdfe log_odds_ratio (X = Z ) C [pw=weights], absorb(year county_fe) cluster(state)
predictnl pred_prob=exp(predict(xbd))/(1+exp(predict(xbd))) , se(pred_prob_se)
which returns:
you must add the resid option to reghdfe before running this prediction
predict(xbd) invalid
r(198);

then adding the resid option returns:
ivreghdfe log_odds_ratio (X = Z ) C [pw=weights], absorb(year county_fe) cluster(state) resid
predictnl pred_prob=exp(predict(xbd))/(1+exp(predict(xbd))) , se(pred_prob_se)

expression is a function of possibly stochastic quantities other than e(b)
r(498);

(Note: using margins instead of predictnl returns the exact same errors).

Any suggestions on how to estimate non-linear predictions with many fixed?

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant