Statalist The Stata Listserver


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

st: bootstrapping mvprobit


From   "Stephen P. Jenkins" <stephenj@essex.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: bootstrapping mvprobit
Date   Fri, 1 Sep 2006 10:26:56 +0100

France Weaver asked about bootstrapping predicted probabilities using
-mvppred- following estimation by -mvprobit-, and provided sample
code. (See below.)

Are the "deadnext" and "marrddn" variables in program "marginal"
members of global macros $exog_rhs and $iv1?

The line
	     replace marrddn=married*deadnext
appears redundant since deadnext is set equal to one for all
observations in the preceding line.

Don't you want the lines

	gen deadnext_save=deadnext
      gen marrddn_save=marrddn

outside of the program, so that you retain a master copy of them?  And
then change their values inside the program to calculate predictions
based on changes to 0 and then 1, and then after that, just before the
end of the program, resetting them for the next regression in the
bootstrap loop? You do the last step, but I'm not sure that the rest
of the code is doing what you hope it does.

BTW Ensure that you have the latest versions of -mvprobit- and
-mvppred-, downloadable from the Stata Journal cite (Software Update
associated with vol 6, no. 2).    To speed things up, you may prefer
to use the "handspun" way of estimating MV Probit regressions, and
doing predictions, that is discussed in the article by Lorenzo
Cappellari and myself in the same issue (example code also
downloadable) -- then you can take advantage of a plug-in and speed
things up tremendously.  A pre-print version of the SJ article is
available as an ISER Working Paper (see ISER URL under my signature).

Stephen
[co-author of -mvprobit- and -mvppred-]


------------------------------

Date: Thu, 31 Aug 2006 11:51:07 -0400
From: France Weaver <france.weaver@psu.edu>
Subject: st: bootstrapping mvprobit

Dear Stata users (Sorry if you receive that message twice, I had
trouble
sending it out...),

I am wondering if any of you has tried to bootstrap the mvprobit
command? I
have created a small program (reported below) to get the confidence
intervals around predicted probabilities (mvppred command) from a
multivariate probit model (mvprobit command). I bootstrap that program
but
it does not provide any confidence intervals. It looks as if it
re-samples
always the same sample because all the iterations have the exact same
values... When I bootstrap a similar program for a probit or bivariate
probit model, I get confidence intervals... Can anyone help me?
Thank you very much,

France Weaver, Ph.D.

The bootstrap command I use is:

bootstrap p_all0=r(all0) p_all1=r(all1), reps(50) saving("s:\bs_mvp",
replace): marginal

The ado file I created is:

capture program drop marginal
program define marginal, rclass
      version 9.2

      gen deadnext_save=deadnext
      gen marrddn_save=marrddn

      mvprobit (fhmcare=$rhs)(reschddn=$exog_rhs
$iv1)(reschild=$exog_rhs $iv1)

      replace deadnext=0
      replace marrddn=0

      mvppred xb
      gen p0=norm(xb1)
      drop xb*

      replace deadnext=1
      replace marrddn=married*deadnext

      mvppred xb
      gen p1=norm(xb1)
      drop xb*

      sum p0
      return scalar all0=r(mean)

      sum p1
      return scalar all1=r(mean)

      replace deadnext=deadnext_save
      replace marrddn=marrddn_save

end


*
*   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/

------------------------------


Stephen
-------------------------------------------------------------
Professor Stephen P. Jenkins <stephenj@essex.ac.uk>
Institute for Social and Economic Research
University of Essex, Colchester CO4 3SQ, U.K.
Tel: +44 1206 873374.  Fax: +44 1206 873151.
http://www.iser.essex.ac.uk  
Survival Analysis using Stata:
http://www.iser.essex.ac.uk/teaching/degree/stephenj/ec968/ 



*
*   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