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]

st: Oddity with -bootstrap- handling an option on command input


From   "Lacy,Michael" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: Oddity with -bootstrap- handling an option on command input
Date   Mon, 19 Sep 2011 13:30:00 +0000

I just found a situation in which -bootstrap- appears to be confused by the presence of the letter "l" ("el") as a name for one of the parameters
of the command it is given to execute.  -bootstrap- appears to confuse this for its own level() option.  Here is a nonsense example that demonstrates this behavior:

cap prog drop test_with_l
prog test_with_l, rclass
  syntax varlist, l(integer)
  summ  `varlist'
  return scalar m = r(mean) = -999
end
//
cap prog drop test_with_hidel
prog test_with_hidel, rclass
  syntax varlist, hidel(integer)  // option renamed "l" to "hidel" to not confuse -bootstrap-
  summ  `varlist'
  return scalar m = r(mean)
end
//
sysuse auto
local somevalue = 4
//
// This works.
bootstrap r(m), reps(10) : test_with_hidel weight price, hidel(`somevalue') 
//
// The following gives an error, as -bootstrap- thinks "l" refers to its level() option
bootstrap r(m), reps(10) : test_with_l weight price, l(`somevalue') 

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

I can produce the same problem with -permute-.

Is this a feature, i.e., are option names generally to be regarded as reserved words in relation to commands that accept
a command name?  I would have thought that -bootstrap-'s own macros, and that of its input commands, would
not share namespace.

I'm running version 11.2, updated, Win XP, for what it's worth. 

Regards,

Mike Lacy
Dept. of Sociology
Colorado State University
Fort Collins CO 80523-1784


*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index