Statalist


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

Re: st: stata code for two-part model


From   "Austin Nichols" <[email protected]>
To   [email protected]
Subject   Re: st: stata code for two-part model
Date   Sat, 16 Aug 2008 11:49:34 -0400

Shehzad Ali et al. --
See also
http://www.nber.org/papers/t0228
The two part models of health expenditures have always struck me as a
bad idea; think about how you would get predictions for each indiv in
your sample.  The "stage 1" probit classifies people as having
expenditures or not (some correctly, some not) and then the "stage 2"
ols model gives predicted expenditures only for those people who
actually have positive expenditures (not those who are classified by
the probit as likely to have positive expenditures) unless you predict
out of sample.  At least one preferred approach of calculating
marginal effects by comparing predictions over the whole sample turns
out to be practically and analytically difficult in that setting.
However, a -glm- with a log link (or equivalently a -poisson-
regression) has no trouble: those people with extremely low predicted
expenditures would round to zero predicted expenditures if you thought
about a survey with expenditures measured discretely in dollars, say.
Everyone has E(y)=exp(Xb) and there is no real issue with calculating
marginal effects.  Once you are in the -glm- framework it is also easy
to think about model fit and alternative links...

On Sat, Aug 16, 2008 at 3:41 AM, Eva Poen <[email protected]> wrote:
> Shehzad,
>
> this looks like a hurdle model. Have you search the ssc archives to
> see if someone else has programmed it for you? Have a look at
> -hplogit-, for example.
>
> If you end up doing it yourself, I think you need to do a bit of
> programming. In order for -mfx- to work after your estimation, you
> need a way of telling it what you want the marginal effects to be
> calculated for. In your case, this would be the overall expected cost
> of care from your model. The way to feed this to -mfx- is via the
> predict(predict_option), but for this to work you need to write a
> -predict- command and an estimation command for your model.
>
> See for example this post:
> http://www.stata.com/statalist/archive/2005-10/msg00091.html
>
> Hope this helps,
> Eva
>
>
>
> 2008/8/16 Shehzad Ali <[email protected]>:
>> Hi,
>>
>> I was wondering if someone can help with stata code for calculating marginal
>> effects after two-part models for say, cost of care. Here, first part is a
>> probit model for seeking care or not, and the second part is an OLS model of
>> cost of care, conditional on decision to seek care. Here is the simplified
>> code:
>>
>> probit care $xvar
>>
>> reg cost $zvar if care==1
>>
>> mfx
>>
>> I understand that mfx after the second part gives us the marginal effects
>> for the OLS part only, and not the conditional marginal effects.
>>
>> Any help would be appreciated.
>>
>> Thanks,
>>
>> Shehzad
*
*   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/



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