Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down on April 23, and its replacement, **statalist.org** is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
Rich Steinberg <rsteinbe@iupui.edu> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: RE: problem with factor variable and margins. |

Date |
Tue, 16 Mar 2010 20:52:22 -0400 |

Martin -- thanks for quick reply.

e(b)[1,24]

. Martin Weiss wrote:

<>What does************* mat l e(b) ************* after the -margins,post- line give you? HTH Martin -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Rich Steinberg Sent: Dienstag, 16. März 2010 23:50 To: statalist@hsphsun2.harvard.edu Subject: st: problem with factor variable and margins.Running a tobit, then getting average marginal effects (dy/dx) using themargins command. I ask it to compute the margins for some continuousvariables and 2 kinds of factor variables. Results are only reportedfor one of the two kinds of factor variables even though raw tobitcoefficients are computed for both kinds and no error messages appear.I "post" the margins results to do some testing, and all is well fortesting continuous variables and one kind of factor variable (using"test"), but I get an error message for any tests involving the otherkind of factor variable indicating it is "not found". Is it me orstata, I say hesitantly, realizing that every time in the past that Ithought I found a bug it turned out to be a stupid error on my part.Specifically, we have all sorts of income and wealth covariates and someindicators created from them: variables beginning with 'z' areindicators that =1 if the corresponding income source =0, 0 otherwise.I have no problem with the z variables. Variables beginning with n areindicators that = 1 if the corresponding income source takes a negativevalue, 0 otherwise. Here are the relevant command lines, with a fewcomments inserted:tobit Atotgiv $income i.zlinc i.zainc i.zwelinc i.ztrinc i.zinh i.zhomei.zowlth i.nainc nainc_ainc i.nhome nhome_home i.nowlth nowlth_owlth$control, ll(24.99) vce(cluster fid1968)*runs fine, produces coefficients for the three 'n' factor variables:i.nainc, i.nhome, and i.nowlthmargins, predict(ystar(0,.)) dydx( linc2005 ainc2005 welinc2005trinc2005 pdv_totinh2005 home2005 owlth2005 zlinc zainc nainc nainc_ainczwelinc ztrinc zinh zhome nhome nhome_home zowlth nowlth nowlth_owlth) post*produces the following translation and table, where the 'n' factorvariables disappearAverage marginal effects Number of obs= 4790Model VCE : Robust Expression : E(Atotgiv*|Atotgiv>0), predict(ystar(0,.))dy/dx w.r.t. : linc2005 ainc2005 welinc2005 trinc2005 pdv_totinh2005home2005 owlth2005 1.zlinc1.zainc 1.zwelinc 1.ztrinc 1.zinh 1.zhome 1.zowlthnainc_ainc nhome_home nowlth_owlthDelta-methoddy/dx Std. Err. z P>z [95% Conf. Interval]linc2005 .0036341 .0018126 2.00 0.045 .0000814 .0071867ainc2005 .0042529 .0054043 0.79 0.431 -.0063394 .0148451welinc2005 -.0227912 .0274355 -0.83 0.406 -.0765638.0309814trinc2005 -.0009717 .0044668 -0.22 0.828 -.0097265 .007783pdv_tot~2005 .0018556 .0016007 1.16 0.246 -.0012817.004993home2005 .0001909 .0004784 0.40 0.690 -.0007468 .0011286 owlth2005 .0002804 .0001727 1.62 0.104 -.0000581 .0006189 1.zlinc -318.2919 220.6601 -1.44 0.149 -750.7777 114.194 1.zainc -392.2745 79.73669 -4.92 0.000 -548.5555 -235.9935 1.zwelinc 22.76784 236.5038 0.10 0.923 -440.7712 486.3069 1.ztrinc 69.08922 71.11036 0.97 0.331 -70.28453 208.463 1.zinh -93.65764 124.6813 -0.75 0.453 -338.0284 150.7131 1.zhome -413.516 85.3139 -4.85 0.000 -580.7282 -246.3038 1.zowlth -874.5375 135.0824 -6.47 0.000 -1139.294 -609.7809 nainc_ainc .0071456 .0273387 0.26 0.794 -.0464373 .0607286 nhome_home .0011568 .0057747 0.20 0.841 -.0101613 .012475nowlth_owlth .0016043 .0015222 1.05 0.292 -.0013791.0045878Note: dy/dx for factor levels is the discrete change from the baselevel.*And then I do many tests, including the following that work and don't work: test (ainc)(1.zainc) ( 1) ainc2005 = 0 ( 2) 1.zainc = 0 chi2( 2) = 28.57 Prob > chi2 = 0.0000 test (1.nainc) (nainc_ainc) 1.nainc not found r(111);

* * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**Follow-Ups**:**RE: st: RE: problem with factor variable and margins.***From:*"Martin Weiss" <martin.weiss1@gmx.de>

**References**:**st: problem with factor variable and margins.***From:*Rich Steinberg <rsteinbe@iupui.edu>

**st: RE: problem with factor variable and margins.***From:*"Martin Weiss" <martin.weiss1@gmx.de>

- Prev by Date:
**Re: st: xtlogit stata option: tech(bhhh) vce(opg)** - Next by Date:
**Re: st: Re: Post-Hoc test for Kruskal Wallis** - Previous by thread:
**st: RE: problem with factor variable and margins.** - Next by thread:
**RE: st: RE: problem with factor variable and margins.** - Index(es):