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   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: error message about bootstrp
Date   Mon, 4 Mar 2013 13:27:26 +0000

You should run your program -apese- once by itself on the data to see
what it leaves behind.

Nick

On Mon, Mar 4, 2013 at 7:54 AM, Wu Zhang <[email protected]> wrote:

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