fit_all_subsets_one: Fit All Subsets of a Global Model

View source: R/model-fitting.R

fit_all_subsets_oneR Documentation

Fit All Subsets of a Global Model

Description

Fit All Subsets of a Global Model

Usage

fit_all_subsets_one(
  global_model,
  fit_data,
  parallel = FALSE,
  reduce_colinearity = FALSE,
  cwt_retain = 1
)

Arguments

global_model

A fitted model object with class lm.

fit_data

data.frame storing the variables for regression fitting.

parallel

Logical: should model fitting be performed with parallel processing? Defaults to FALSE.

reduce_colinearity

Logical: Should variables that are known to be colinear be prevented from being included in the same model? Defaults to FALSE (i.e., allows colinear variables).

cwt_retain

Numeric value between 0 and 1: what cumulative model weight should be used to trim the set of models? Defaults to 1 (i.e., keep models all models).

Value

A list of fitted model objects (each with class lm).

Note

If parallel = TRUE, models will be fitted using MuMIn::pdredge() with the number of parallel cores used set to max(parallel::detectCores() - 1, 1). Otherwise, the models will be fitted using MuMIn::dredge(). In either case, the printing of fixed terms (intercept only) is suppressed. Additionally, regardless of the value of cwt_retain, if 5 or fewer models are in the all allowed subsets of the global model, no trimming will be conducted. Additionally, if the trimmed model set has fewer than 2 models, no trimming will be conducted.


bstaton1/KuskoHarvPred documentation built on Aug. 15, 2024, 3:30 p.m.