Learn R Programming

mmodely (version 0.2.5)

get.model.combos: All combinations of predictor variables

Description

Enumerate all combinations of predictor variables in a multivariate regression model.

Usage

get.model.combos(outcome.var, predictor.vars, min.q=1)

Value

a vector of models as character strings of the form "y ~ x1 + x2 ..."

Arguments

predictor.vars

predictor variables names (a vector of character strings)

outcome.var

outcome variable name (character string)

min.q

minimum number of predictor variables to include in the mode (default is 2)

Examples

Run this code

path <- system.file("extdata","primate-example.data.csv", package="mmodely")
data <- read.csv(path, row.names=1)

get.model.combos(outcome.var='OC', predictor.vars=names(data),  min.q=2)

Run the code above in your browser using DataLab