[R] Variable Combinations in Regression

Whit Armstrong armstrong.whit at gmail.com
Fri Jan 8 21:49:02 CET 2010


?expand.grid

On Fri, Jan 8, 2010 at 3:26 PM, Richardson, Patrick
<Patrick.Richardson at vai.org> wrote:
> Let's say I have 8 variables and I want to generate all combinations of those variables (In pairs, threes fours, etc) to run in multiple linear regression. Is there a built-in function to do that in R?
>
> Or at a minimum, how could I take those variables and generate all possible combinations.
>
> Thank you for any assistance.
>
> Patrick
>
>
> This email message, including any attachments, is for th...{{dropped:9}}
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list