dredge_regression: dredge_regression

Description Usage Arguments Value Author(s) See Also Examples

Description

data dredge a data.frame using lm

Usage

1
2
dredge_regression(data, grid, min_pvalue = getOption("mndredge_min_pvalue",
  0), max_pvalue = getOption("mndredge_max_pvalue", 0.05), ...)

Arguments

data

a data.frame to operate over

grid

a search grid in the form of make_regression_grid to use in guiding the dredging

min_pvalue

the maximum the pvalue from lm can be before the result is filtered out. this generaly is an issue only in overfitted models or synthetic data

max_pvalue

the maximum the pvalue from lm can be before the result is filtered out

...

addtional parameters to pass to lm

Value

a tidy data.frame containing the following components:

formula

the model being applied to the data.frame

best_pvalue

the best p.value for any model coefficient

adjusted_r_squared

the overall r for the model

Author(s)

Mark Newman, mark@trinetteandmark.com

See Also

Other dredging: dredge_correlation

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
  
  set.seed(0)
  y1 <- c(rnorm(10), rnorm(10, mean = 2))
  y2 <- rep(c("a", "b"), c(10,10))
  registerDoParallel(cores=2)
  data <-
    data.frame(y1, y2) %>%
    adjust_grid_for_regression()
  grid <- data %>% make_regression_grid()
  data %>% dredge_regression(grid)

markanewman/mndredge documentation built on May 9, 2019, 5:52 a.m.