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: Pairing predictors in tuples.


From   Eric Booth <[email protected]>
To   "<[email protected]>" <[email protected]>
Subject   Re: st: Pairing predictors in tuples.
Date   Mon, 2 Aug 2010 16:28:33 +0000

<>

Put x4 & x5 in quotes:

****!
clear
set obs 1000
forval n=1/5 {
	g x`n' = rnormal()*100
}
g y = round(abs(rnormal()*1))

*****
tuples x1 x2 x3 "x4 x5"
forval i = 1/`ntuples'{
     logit y `tuple`i''
     di "`e(cmdline)'"
     outreg2 using "test", append

}
****!

~ Eric
__
Eric A. Booth
Public Policy Research Institute
Texas A&M University
[email protected]
Office: +979.845.6754



On Aug 2, 2010, at 11:17 AM, Bradley Fedy wrote:

> Hi,
> 
> I am using tuples to cycle through models using different subsets of
> predictors.  My code looks something like this:
> 
> tuples x1 x2 x3 x4 x5
> forval i = 1/31{
>      logit y `tuple`i"
> }
> 
> However, I do not want all possible combinations.  I would like predictors
> x4 and x5 to always enter the model together (i.e. one cannot be present
> without the other).
> 
> Any suggestions on how to make x4 and x5 always enter the model together
> would be greatly appreciated.
> 
> Thanks,
> Brad
> 
> Stata Ver. 10.1
> 
> 
> *
> *   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index