Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: selecting default parameters


From   Kit Baum <baum@bc.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: selecting default parameters
Date   Sun, 18 Sep 2005 07:21:51 -0400

Fred said

You can do this with macros, as in the example below.

local vset1 x1 x2 x4 x7 x13 x18 x19 x25
global vset1 x1 x2 x4 x7 x13 x18 x19 x25



>Is there a way to bundle variables together in groups so I can simply
>type the groupname and all the variables in the group will be included?
>And is there a way to set which parameters that are to be default when
>running a command?
>
>I'm thinking of something in the line of
>
>set groupvar vset1 x1 x2 x4 x7 x13 x18 x19 x25
>set groupvar vset2 x1 x3 x5 x6 x7 x13 x17
>set default streg d(weibull) nolog nohr difficult
>
>The commands could then be issued in a much easier manner like this
>
>streg vset1
>streg vset2
>streg vset1 not x2
>streg vset1 and x3


To expand a bit on this,

local opt nolog nohr difficult

local vset1 x1 x4 x7 x13 x18 x19 x25
local vset2 x1 x3 x5 x6 x7 x13 x17

streg `vset1' x2, `opt'
streg `vset2', `opt'
streg `vset1', `opt'
streg `vset2' x3, `opt'

Kit Baum, Boston College Economics
http://ideas.repec.org/e/pba1.html


*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index