Statalist


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

st: RE: From: Woolton Lee <[email protected]>


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: RE: From: Woolton Lee <[email protected]>
Date   Thu, 7 Jan 2010 22:46:22 +0100

<>

I did not advise to make any correction, simply pointed out an error - which
has since seen official confirmation, so it is hard to argue that it is not
an error...

Your code initially stopped because there was a line beginning "resample...
which Stata could not understand. This initial finding does not preclude the
existence of other errors.

The bare minimum to make corrections on your own - which is strongly
discouraged - is to -prog drop _all - to get rid of any leftovers from the
old code. From your error message, it seems you put the corrected code into
a new .ado file, but I would not encourage you to do that. 


HTH
Martin

-----Original Message-----
From: [email protected]
[mailto:[email protected]] 
Sent: Donnerstag, 7. Januar 2010 22:07
To: statalist
Subject: st: From: Woolton Lee <[email protected]>

Martin,

When I apply your correction to bsample.ado I get another error
(assuming I made the corrrection correctly).

. forvalue i=1/5{
  2.         clear
  3.       use bsampletest, clear
  4.       qui tab trmtgp
  5.         scalar prnt=0.5                 // to set 50 percent
sampling, can change
> the number here
  6.         qui count if trmtgp==0     // comparision market in beginning
year
  7.         scalar tabgp1=int(r(N)*prnt)
  8.         qui count if trmtgp==1     // treatment market in beginning
year
  9.         scalar tabgp3=int(r(N)*prnt)
 10.         *display "tabgp1="tabgp1, "tabgp3=" tabgp3
.         gen nsamp=cond(trmtgp==0 , tabgp1, 0) + cond(trmtgp==1, tabgp3, 0)
 11.
.
.         bsample_correction010710 nsamp, cluster(pat_zip) strata(trmtgp)
 12.       egen mean_dist=mean(dis)
 13.         display "_N=" _N, "mean_dis=" mean_dis
 14. }
SRSWR already defined
(error occurred while loading bsample_correction010710.ado)
r(110);



bsample.ado Currently reads:

***
               if _rc {
                       di as err
               "resample size must not be greater than number of clusters"
                       exit 498
               }
***

Should be:

***
               if _rc {
                       di as err ///
               "resample size must not be greater than number of clusters"
                       exit 498
               }
***


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

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