Fits two linear or linear mixed-effects models that differ in their fixed effects. A difference of at least two AIC points is reported as evidence for the lower-AIC model.

predictor_competition2(
  data,
  dependent,
  independent1,
  independent2,
  random.intercept = NULL,
  random.slope = 1
)

Arguments

data

Data frame used for both models.

dependent

Name of the dependent variable.

independent1, independent2

Character vectors naming the fixed-effect terms in the two models.

random.intercept

Optional random-intercept grouping variable.

random.slope

Random-slope expression; defaults to 1, which specifies a random-intercept-only model.

Value

The two-row data frame returned by stats::AIC().

Examples

data("data_s")
predictor_competition2(data_s, "sDur", "pauseBin", "typeOfS")
#> Lower-AIC predictor set: pauseBin.
#>        df       AIC
#> model1  3 -484.5026
#> model2  4 -462.1716