Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: standard errors from -mfx- without resorting to -force- (second attempt)


From   Partha Deb <[email protected]>
To   Statalist <[email protected]>
Subject   st: standard errors from -mfx- without resorting to -force- (second attempt)
Date   Thu, 11 Jan 2007 11:59:41 -0500

Hi,

Apologies for reposting this query (with editing to improve information content, I hope). I asked this question over the holidays and got no responses at all. I'm wondering if it was the timing, my inability to express the question, or whether I've got everyone stumped!! ;)

I have a model for which -mfx- does not report standard errors without the ,force option. I think I understand why from reading the online FAQ, but then I'm puzzled as to how -treatreg- gets around this issue. An alternative solution here would be to apply ,force, but that seems so inelegant. Any insights would be greatly appreciated. Thanks a lot.

Details of the problem:

I have a nonlinear model with an endogenous regressor that is specified as

y1 = g(x,y2,e)
y2 = f(x,u)
E(e.u) ne 0

A ML algorithm is implemented using -ml- using the following syntax:

ml model d2 myfunc_lf (`lhs': `lhs' = `rhs' `tlhs') ///
(`tlhs': `tlhs' = `trhs')

I also have a myfunc_p routine that calculates E(y1)=g(x,y2)

When I apply -mfx-, I get marginal effects, but no standard errors. -mfx, diagnostics(all)- shows that it fails the test of "constancy" of the effects.

Here's the relevant output:

Check prediction function does not depend on dependent variables,
covariance matrix, or stored scalars.
dfdx:

-.00142824 .11596216 1.6437031 0 0

dfdx, after resetting dependent variables, covariance matrix, and stored scalars:

-.00126149 .10242362 1.6437031 0 0

Relative difference = .0122807

My guess is this is because tlhs, the dependent variable in the second equation is a regressor in the first. When -mfx- sets "all dependent variables to zero" this causes the marginal effect to change.

-treatreg- is specified using

ml model lf treat_ll /*
*/ (`depn': `dep' = `ind' `trtdep', `nc') /*
*/ (`trtdepn': `trtdep' = `trtind', `trtnc') /*

which looks like very much like my -ml model-. But here, -mfx- gives marginal effects and standard errors. Here's the relevant output:

Check prediction function does not depend on dependent variables,
covariance matrix, or stored scalars.
dfdx:

-.00506916 .1283985 2.1940167 0 0

dfdx, after resetting dependent variables, covariance matrix, and stored scalars:

-.00506916 .1283985 2.1940167 0 0

Relative difference = 2.295e-12


Why? Am I missing a trick in treatr_p?


cheers,

Partha
--
Partha Deb
Department of Economics
Hunter College
ph: (212) 772-5435
fax: (212) 772-5398
http://urban.hunter.cuny.edu/~deb/

Emancipate yourselves from mental slavery
None but ourselves can free our minds.
- Bob Marley

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index