Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: error message about bootstrp


From   Wu Zhang <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: error message about bootstrp
Date   Sun, 3 Mar 2013 23:54:41 -0800 (PST)

Hi Stas,

   Do you mind I ask you another question:

After I adopt your suggestion and modify the code a little bit, I get this error message :

insufficient observations to compute bootstrap standard errors
no results will be saved
r(2000);

The Boostrap code is as follows:



cap program drop apese
program apese, rclass
version 12.1
capture drop   xalphat ehat sdhat meanvaluen meanvalue21
reg odds  x1 x2 x3
mat paraest=e(b)
return scalar alphaj =_b[x2]
predict ehat, residual
mean x1 x2 x3 const
mat xmean=e(b)
mat meanvalue=xmean*paraest'
svmat meanvalue, names(meanvalue2)
sum meanvalue21
gen meanvaluen=r(mean)
gen sdhat=alphaj*exp(meanvaluen+ehat)/(1+exp(meanvaluen+ehat))^2

sum sdhat
return scalar apej=r(mean)

end



The running code is:  bootstrap apej=r(apej): apese

Thanks a lot!

Wu 



________________________________
From: Stas Kolenikov <[email protected]>
To: [email protected] 
Sent: Sunday, March 3, 2013 7:21 PM
Subject: Re: st: error message about bootstrp

Wu,

you are mixing up do-files and ado-files. Once you have defined
-program apese- in an ado file (in the directory that -bootstrap- can
see, type -adopath- to verify), you should refer to it as -bootstrap:
apese- without -do-.

-- 
-- Stas Kolenikov, PhD, PStat (SSC)
-- Senior Survey Statistician, Abt SRBI
-- Opinions stated in this email are mine only, and do not reflect the
position of my employer


On Sun, Mar 3, 2013 at 6:40 PM, Wu Zhang <[email protected]> wrote:
>
> Hi folks,
>
>   I did  a very simple bootstrap and get the following error:
>
> time-series operators are not allowed with bootstrap without panels, see tsset
> r(198);
>
>
> The BS code is as follows:
>
> cap program drop apese
> program apese, rclass
> version 12.0
> capture drop   xalphat ehat
> reg y  x1 x2 x3
> return scalar alphaj=_b[x3]
> predict xalphat
> predict ehat, residual
> gen sdhat=exp(xalphat+ehat)/(1+exp(xalphat+ehat))^2
> sum sdhat
> return scalar ape=r(mean)
> scalar apej=alphaj*ape
> end
>
>
> The running code is:  bootstrap apej=r(apej): do apese_bs.do
>
>
> Thanks a lot!
>
> Wu
>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*  http://www.stata.com/help.cgi?searchhttp://www.stata.com/support/faqs/resources/statalist-faq/http://www.ats.ucla.edu/stat/stata/

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


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index