Asking my students to use the margins command after mlogit for computing marginal effects (using dydx), I've found that including variables into the mlogit model by using the ## operator would give you different results from not using the operator.
For example:
mlogit y x1 x2 c.x3##c.x3 /* model 1*/
and
mlogit y x1 x2 x3 x3_2 /* model 2 */
where x3_2 is generated by: gen x3_2 = x3*x3
After model 1 or model 2 run,
margins, dydx(x1) at(x2=(0 1)) atmeans
would give you different results depending on which model is run first.
After model 2, the sample mean values of x3 and x3_2 are explicitly used while after model 1, only x3 mean is specified while x3_2 is not set at its mean (presumably individual x3_2 values are used before averaging the final result?).
It appears that if x3 is entered as at() such as "... at(x3=(20(1)80)), then the squared computation is passed on correctly but not when it's involved in "atmeans"... It is hard to imagine if that's a reasonable way to compute.
Anyone knows any reasons for this that we failed to see? Thank you.
Related Posts with How margins handles the atmeans option
WLS methodDear Statalist, I have a project with cross-sectional data, but my data have problem with heterosced…
Fixed effects on panel dataHi there, I have a panel dataset on conflict events, rainfall deviation, GDP and some more variable…
Stopwords Removal with TxttoolI would like to remove stopwords from strings and I have received the advice to use txtool. However,…
The GEE and regression with robust error varianceHi Statisticians, Is any one known the difference of GEE and regression with robust error variance? …
Unique Identifier for Time SeriesHi Everyone, I am not sure if I need to create a unique ID for time series data. I have annual data…
Subscribe to:
Post Comments (Atom)
0 Response to How margins handles the atmeans option
Post a Comment