Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: problem with bootstrap in Stata 8.2


From   "Michael Blasnik" <[email protected]>
To   <[email protected]>
Subject   st: Re: problem with bootstrap in Stata 8.2
Date   Wed, 14 Apr 2004 13:04:05 -0400

I don't think you can refer to returned results in r() within the same
program as you create them as you do with:

scalar return difren=r(difren00) - r(difren91)

Maybe you should try to store each of the results in tempnamed scalars and
then calc the difference (into another tempnamed scalar) and then issue all
of the return scalar commands at the end.

Michael Blasnik
[email protected]


----- Original Message ----- 
From: "Fabio Soares" <[email protected]>
To: <[email protected]>
Sent: Wednesday, April 14, 2004 11:48 AM
Subject: st: problem with bootstrap in Stata 8.2


> Dear Statalisters,
>
> I�m running a difference-in-difference propensity score program using
logit
> and attnd commands and I didn�t manage to get the bootstrapped s.e. using
> the bootstrap command. Does anyone spot any mistake in the following code:
>
> capture program drop difatt
> program define difatt, rclass
>
> use favbar9100, clear
> drop if bairrinho==1 | nurb==1
>
> xi: logit fb dom91  agua91 esg91  lixo91  escm4_91  escm15_91  analf91 /*
>                     */  menor4_91  chmul91 up1sm_91  /*
>                    */  nmor91  mul91 chanalf91  amest_91  idade_91 ren_91
> i.RA
>
> predict pscore
>
> attnd rren_00  fb, pscore(pscore)
> scalar return difren00=r(attnd)
>
> attnd rren_91  fb, pscore(pscore)
> scalar return difren91=r(attnd)
>
> scalar return difren=r(difren00) - r(difren91)
>
> end
>
>
> bootstrap "difatt" difren=r(difren), reps(100)
>
>
> Best wishes,
>
> Fabio


*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index