Statalist


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

Re: st: RE: Tobit coefficients


From   <vfgate-demog@yahoo.com.br>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: Tobit coefficients
Date   Fri, 27 Jul 2007 01:01:58 -0300 (ART)

Austin, thank you very much for your help.

Yes, I was talking about -prvalue- from spost package.

Let me try to explain my situation more clearly. I am
estimating a classic triple-difference model. So I
have three dummies: TREAT, AFTER and AFFECTED. I also
have TREAT*AFTER, TREAT*AFFECTED, AFTER*AFFECTED and
TREAT*AFTER*AFFECTED. And I also have a vector of
variables (sex, education, etc.)

My dependent variable (Y) is the amount of money
received from parents. (many people receive zero). I
want to have predicted values E(Y|Y>0), and respective
Standard Errors, for every combination of the three
dummies:

1) TREAT=1, AFTER=1, TREAT=1, TREAT*AFTER=1, ...
2) TRATE=0, AFTER=1, TREAT=0, TREAT*AFTER=0, ...
3) etc...
(total of 8 possibilities)

While keeping the set controlling variables (sex,
education, etc.) constant at some values.

I want the Standard Errors because I want to check if
the estimated E(Y|Y>0) are significant.

With this estimated values, I will fill the cell of a
triple-diference table. Like the one on page 30, here
(if you want to look at):
CARVALHO (2004)
http://wwwtest.aup.edu/lacea2005/system/step2_php/papers/decarvalhofilho_idec.pdf

I suppose the -predict- strategy you proposed could
work. But in fact I need predicted values for a
certain vector of X, not at every observed value of X.

In any case, it would be good to have a faster way,
because I will estimate for every each one of the 8
possibilities listed above. Besied, I need to do this
for 10 different years!

Even if I was going to do that manually by -predict-,
it would be very time consuming, and I most certainly
would make a typing error.

The -predict- algorithmon you sent is great. Thank you
very much! Already helped a lot to clear the situation
to me. But if you or anyone else has an alternative
faster/eaiser solution, it would be also great.

Thank you for your help,
Vitor


--- Austin Nichols <austinnichols@gmail.com> wrote:
>
> Vitor
> -prvalue- is some user-written code, I guess
> (http://www.indiana.edu/~jslsoc/spost.htm)?
> I'm not quite sure what standard error you want--but
> it seems plain
> that -mfx- has nothing to do with it.  You can use
> the formulas in
> May's email mechanically to plug into -nlcom- and
> get a point estimate
> and SE on anything, I suppose.  However, the
> estimate of y conditional
> on y>0 (and its SE) and X equal to the sample mean
> of X need not
> *mean* anything in particular--the mean of X could
> even be an
> infeasible value for X, so not a particularly
> interesting point at
> which to calculate predictions.  More interesting is
> to calculate
> predictions at every observed value of X.
> That said, try this on for size [aside: can anyone
> give an easier method?]:
> 
> clear
> sysuse auto
> replace mpg=mpg-20
> version 7
> tobit mpg len, ll(0)
> predict xb,xb
> predict y, ystar(0,.)
> la var y "E(y|x) unconditional expected y"
> predict e, e(0,.)
> la var e "E(y|x,y>0) conditional on y being
> uncensored, from predict"
> predict p, pr(0,.)
> la var p "E(y>0) probability uncensored"
> gen
>
m_e=xb+_b[_se]*normden((0-xb)/_b[_se])/norm(-((0-xb)/_b[_se]))
> la var m_e "E(y) conditional on y being uncensored,
> manual calc"
> su e m_e
> su len, meanonly
> loc v=r(mean)
> local xb="(`v'*_b[len]+_b[_cons])"
> di "Estimate of E(y|x=E(X),y>0) and its SE"
> nlcom
>
`xb'+_b[_se]*normden((-`xb')/_b[_se])/norm((`xb')/_b[_se])
> di "Now get SE for two types of predictions for each
> obs:"
> predict stdp, stdp
> g hixb=xb+1.96*stdp
> g loxb=xb-1.96*stdp
> g se=.
> loc n=_N
> qui {
> forv i=1/`n' {
> su len in `i', meanonly
> loc v=r(mean)
> local xb="(`v'*_b[len]+_b[_cons])"
> nlcom
>
`xb'+_b[_se]*normden((-`xb')/_b[_se])/norm((`xb')/_b[_se])
> mat v=r(V)
> replace se=sqrt(v[1,1]) in `i'
> }
> }
> g hie=e+1.96*se
> g loe=e-1.96*se
> version 8.2
> sort len
> tw rarea hixb loxb len || scatter xb len, yli(0)
> c(l) name(xb)
> tw rarea hie loe len || scatter e len, yli(0) c(l)
> name(e)
> gr combine xb e, ycommon
> 
> 
> On 7/26/07, vfgate-demog@yahoo.com.br
> <vfgate-demog@yahoo.com.br> wrote:
> I have a problem estimating predicted values that is
> somehow related to the messages fro Lisa and May
> below.
> I estimated I tobit model and I want E(y|x,y>0)
> conditional on vector x on its mean values. After
> reading the messages below I understand that the
> following command gives me what I want:
> mfx compute, predict(e(0,.))
> (It also gives me the marginal effects, but I don't
> need them)
> My problem is that mfx does not give me the Standard
> Error of E(y|x,y>0). And I need this.
> I have tried the prvalue command. Simply typing
> "prvalue", with no options", it gives me the
> predicted
> value and a confidence interval, which would be
> enough. But what prvalue estimate is E(y|x), and not
> E(y|x,y>0).
> Does anyone know how to make prvalue estimate
> E(y|x,y>0) after a Tobit model, rather than E(y|x)?
> Or is there another way to do what I want?
> Or am I getting it all wrong from the beginning and
> my
> question makes no sense at all?!..
> 
> ----- Original Message -----
> From: May Boggess <mboggess@stata.com>
> Date: 03 Jan 2005 16:57:24 -0600
> 
> On Monday, Lisa wrote:
>  For the following command:
>  tobit facil4p $demo5, ll(0);
>  mfx compute,  predict(e(0,.));
>  does this give marginal effects in terms of
>  1) E(y|x,y>0)  OR   2) E(y|x) = P(y>0) * E(y|x,y>0)
>  If it is (1) (which I am pretty sure that it is)
>  could someone please tell me how to specify (2) in
> STATA.
> 
> It gives (1). Here is an example that shows how the
> various
> predictions available after -tobit- are calculated:
> 
>  clear
>  sysuse auto
>  replace mpg=mpg-20
>  version 7
>  tobit mpg len, ll(0)
>  predict xb,xb
>  predict y, ystar(0,.)
>  la var y "Unconditional Expected Value"
>  predict e, e(0,.)
>  la var e "Conditional on being Uncensored"
>  predict p, pr(0,.)
>  la var p "Probability Uncensored"
>  gen myy = p*e
>  sum y myy
>  gen mye = xb + _b[_se]*normden((0-xb)/_b[_se])/p
>  sum e mye
>  gen myp = norm(-((0-xb)/_b[_se]))
>  sum p myp
> 
> This shows that ystar is the function Lisa is
> looking for in (2).
> That means she can calculate the marginal effect,
> and its standard
> error, as follows:
> 
>  mfx, predict(ystar(0,.))
> 
>  --May
>  mmb@stata.com
> 



      Alertas do Yahoo! Mail em seu celular. Saiba mais em http://br.mobile.yahoo.com/mailalertas/
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index