Skip to contents

Applies linear models for each restriction in a list of data frames, testing ability of restrictions to explain specified response variables. Extracts ANOVA statistics and model summaries.

Usage

eval_restriction_performance(df_list, response_vars)

Arguments

df_list

List of data frames each containing species data and restrictions (starting after "_flag" columns).

response_vars

Character vector of response variable names to test in the linear models. Must be included in the df_list.

Value

A data frame combining ANOVA results for all models and response variables, with columns:

  • method: Identifier of the combo/data frame.

  • model: Restriction name.

  • response_variable: Response variable tested.

  • AIC: Akaike Information Criterion value for the model.

  • df: Degrees of freedom used in the ANOVA.

  • F_statistic: F statistic from the ANOVA.

  • p_value: p-value from the ANOVA F-test.

  • multiple_R2: Multiple R-squared of the model.

  • adjusted_R2: Adjusted R-squared of the model.

Note

To run highly multidimensional models such as GDR, the number of species must outnumber the possible rarity types (i.e., at least 63 species for GDR) to ensure the linear models work correctly.