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: Making vce(robust) the default
From
Billy Schwartz <[email protected]>
To
[email protected]
Subject
Re: st: Making vce(robust) the default
Date
Fri, 5 Aug 2011 15:47:37 -0400
Just be careful with globals -- you don't want a name conflict.
Consider salting the macro name (adding some predetermined random
string of characters inside the name--just don't begin the global name
with an underscore or it becomes a local).
On Thu, Aug 4, 2011 at 5:49 PM, Richard Williams
<[email protected]> wrote:
> At 11:38 AM 8/4/2011, Stas Kolenikov wrote:
>>
>> I guess that if you are concerned with a particular standard option of
>> Stata, you'd still want to parse the inputs from the user yourself:
>>
>> syntax ... , [vce(passthru) robust cluster(passthru)]
>>
>> * with appropriate capitalization per Stata conventions
>>
>> if "`vce'`robust'`cluster'" == "" local vce vce(robust)
>>
>> ml ... , ... maximize `vce' `robust' `cluster'
>
> Thanks to Stas & Billy for their suggestions. Here is my current workaround.
> First, I have a program called myprog_svy_check.ado.
>
> program myprog_svy_check
> version 12
> global svyused "svyused"
> end
>
> Then, within myprog.ado, I have added this code:
>
> // Make vce(robust) the default if not otherwise specified
> if "`vce'`robust'`cluster'$svyused" == "" local vce vce(robust)
> macro drop svyused
>
> Hopefully that covers all the possibilities, and does not have any
> unintended consequences. (I could just tell users that they will usually
> want to specify vce(robust), but I would prefer to just set the default to
> what should be the most common choice given the method being used).
>
> -------------------------------------------
> Richard Williams, Notre Dame Dept of Sociology
> OFFICE: (574)631-6668, (574)631-6463
> HOME: (574)289-5227
> EMAIL: [email protected]
> WWW: http://www.nd.edu/~rwilliam
>
> *
> * 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/