s-news
[Top] [All Lists]

[S] power set of a vector

To: s-news <s-news@wubios.wustl.edu>
Subject: [S] power set of a vector
From: Bin Chen <pbchen@gsbphd.uchicago.edu>
Date: Wed, 20 Oct 1999 11:19:56 -0500
Organization: GSB, University of Chicago
Sender: owner-s-news@wubios.wustl.edu
Hi. Is there a simple command that gives the power set of a vector
(that is, all its subsets)? I'm trying to run 256 variants of a least
squares model involving a maximum of 8 independent variables
(including the intercept) and then compute their posterior odds. I
figure if I can get all the subsets of the names of the X data.frame I
would be able to do this quickly, using a loop in which

subset.of.names <-- ?? names(X) ??
lm(data.frame(y,X[,row(matrix(names(X)))[names(X)==subset.of.names]]))
...

Thanks a lot in advance.

- Bin Chen
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message:  unsubscribe s-news

<Prev in Thread] Current Thread [Next in Thread>
  • [S] power set of a vector, Bin Chen <=