choose_model: Try out a few experimental models and return a likely working...

View source: R/de_shared.R

choose_modelR Documentation

Try out a few experimental models and return a likely working option.

Description

The _pairwise family of functions all demand an experimental model. This tries to choose a consistent and useful model for all for them. This does not try to do multi-factor, interacting, nor dependent variable models, if you want those do them yourself and pass them off as alt_model.

Usage

choose_model(
  input,
  conditions = NULL,
  batches = NULL,
  model_batch = TRUE,
  model_cond = TRUE,
  model_intercept = FALSE,
  alt_model = NULL,
  alt_string = NULL,
  intercept = 0,
  reverse = FALSE,
  contr = NULL,
  surrogates = "be",
  verbose = TRUE,
  ...
)

Arguments

input

Input data used to make the model.

conditions

Factor of conditions in the putative model.

batches

Factor of batches in the putative model.

model_batch

Try to include batch in the model?

model_cond

Try to include condition in the model? (Yes!)

model_intercept

Use an intercept model instead of cell-means?

alt_model

Use your own model.

alt_string

String describing an alternate model.

intercept

Choose an intercept for the model as opposed to 0.

reverse

Reverse condition/batch in the model? This shouldn't/doesn't matter but I wanted to test.

contr

List of contrasts.arg possibilities.

surrogates

Number of or method used to choose the number of surrogate variables.

verbose

Print some information about what is happening?

...

Further options are passed to arglist.

Details

Invoked by the _pairwise() functions.

Value

List including a model matrix and strings describing cell-means and intercept models.

See Also

[stats::model.matrix()]

Examples

## Not run: 
 a_model <- choose_model(expt, model_batch = TRUE, model_intercept = FALSE)
 a_model$chosen_model
 ## ~ 0 + condition + batch

## End(Not run)

elsayed-lab/hpgltools documentation built on May 9, 2024, 5:02 a.m.